Re: Extrapolation of DB structure analisys

From: antonio-petrelli..ibero\.it (antonio-petrelli@libero.it)
Date: Mon Nov 24 2003 - 05:38:22 EST

  • Next message: Andriy Shapochka: "Maven + Re: Cayenne Data View Modeler merged with Cayenne 1.1-dev"

    Here is my humble contribute to the project. The attachment contains:
    - a modified version of the "build.xml" for another project from ObjectStyle,
    Ashwood: the target "dbutil" builds a jar file that contains only the "dbutil"
    folder.
    - a modified version of "build.xml" for Cayenne: the target "reverse-jar" builds
    a jar with all the needed classes and files that can be used for reverse
    engineering of a database.
    - two new classes: ModifiedDbLoader (a modified version of the DbLoader class)
    and DefaultDbLoaderDelegate (an implementation of the DbLoaderDelegate interface
    that does nothing at all).
    - a simple test class "demos.TestModifiedDbLoader".
    I hope these things are useful.
    Greetings
    Antonio Petrelli

    >
    > On Nov 20, 2003, at 4:55 AM, antonio-petrell..libero..it wrote:
    >
    > > I noticed that inside Cayenne Modeler there is a powerful mechanism to
    > > capture
    > > the database schema. I would like to extrapolate this feature into a
    > > separate
    > > library to be used in other cases (i.e. I need to write an XML file
    > > that
    > > represents the captured schema) and then submit it to you.
    > > Have you got anything to tell about this, such as package names,
    > > reccomendations, etc.? Everything is appreciated.
    > > Regards
    > > Antonio Petrelli
    >
    > Hi Antonio,
    >
    > On Cayenne side of things the API to get DB metadata is fairly
    > straightforward. Look at DbLoader class:
    >
    >
    > http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/
    > access/DbLoader.html
    >
    > It has no UI dependencies and can be embedded in other applications. In
    > constructor it requires access to Cayenne DbAdapter which abstracts the
    > differences in metadata handling between the databases. Also it takes a
    > DbLoaderDelegate parameter that is being notified of the reverse
    > engineering process, and is consulted about certain steps:
    >
    >
    > http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/
    > access/DbLoaderDelegate.html
    >
    > The only currently existing delegate implementation is an inner class
    > of GUI ImportDBAction (writing your own should be very easy):
    >
    >
    > http://objectstyle.org/cayenne/api/modeler/org/objectstyle/cayenne/
    > modeler/action/ImportDbAction.html
    >
    > When you do reverse engineering, DbLoader produces an instance of
    > DataMap - a Cayenne representation of the schema. This is just a tree
    > of objects, so it should be easy to save in whatever format you desire.
    > Cayenne saves it to the XML format you may have seen already. If you
    > need another format, you can implement it too.
    >
    > Andrus
    >
    >




    This archive was generated by hypermail 2.0.0 : Mon Nov 24 2003 - 05:38:23 EST