Re: [CONF] Apache Cayenne Documentation: Reverse Engineer Database (page edited)

From: Michael Gentry (blacknex..mail.com)
Date: Fri Nov 21 2008 - 14:22:52 EST

  • Next message: Andrus Adamchik: "Re: Preparing 3.0M5"

    I'll try to do this over the weekend. If someone beats me to it, just
    drop a note here.

    Thanks!

    On Thu, Nov 20, 2008 at 1:14 PM, Andrey Razumovsky
    <razumovsky.andre..mail.com> wrote:
    > Currently all screenshots of modeler are done in OS X. I don't have Mac, so
    > could someone update the second screenshot on this page?
    >
    > 2008/11/20, confluenc..pache.org <confluence@apache.org>:
    >>
    >> Page Edited : CAYDOC <http://cwiki.apache.org/confluence/display/CAYDOC> :
    >> Reverse Engineer Database<http://cwiki.apache.org/confluence/display/CAYDOC/Reverse+Engineer+Database>
    >>
    >> Reverse Engineer Database<http://cwiki.apache.org/confluence/display/CAYDOC/Reverse+Engineer+Database>has been edited by Andrey
    >> Razumosky <http://cwiki.apache.org/confluence/display/~andrey> (Nov 20,
    >> 2008).
    >>
    >> (View changes)<http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=10662&originalVersion=3&revisedVersion=4>
    >> Content:
    >> Reverse Engineer Database
    >>
    >> *Start Reverse Engineering.* To reverse engineer a database you need to
    >> select either a DataDomain or one of its children on the project tree. Then
    >> select "Tools > Reengineer Database Schema" from the menu. "Connect to
    >> Database" dialog will be presented.
    >> Reverse-engineering behavior is sensitive to the current project tree
    >> selection. If you selected a DataDomain or a DataNode, a new DataMap will be
    >> created and all reengineered tables will be put in this DataMap. If you had
    >> an existing DataMap (or one of its entities) selected when you started
    >> reverse engineering, new tables will be merged into the existing DataMap.
    >>
    >> *Configure Database Connection.* "Connect to Database" dialog allows to
    >> specify alternative connection parameters. If a DataNode was selected when
    >> reverse engineering started, its connection information is shown by default.
    >> You can use suggested default connection, select one of the stored local
    >> DataSources from "Saved DataSources" dropdown (those can be edited on the
    >> spot by clicking "..." button), or type your own info. When desired
    >> connection is selected, click "Continue". Cayenne will attempt to connect to
    >> the database and if connection is successful, "Select Options" dialog is
    >> presented.
    >>
    >> *Configure Options.* "Select Options" dialog allows to specify what needs
    >> to be reverse engineered. If a database supports schemas, one of the listed
    >> schemas should be selected. Table and stored procedure patterns allow to
    >> control which tables/procedures are included in reverse engineering.
    >> Patterns should be in the format used by SQL LIKE clause (e.g. "ABC", "ABC%"
    >> or" %" or "A%T", etc.).
    >>
    >> *Naming strategies.* Since Cayenne 3.0 you can obtain control over
    >> DbRelationship, ObjEntity, ObjAttribute and ObjRelationship names
    >> generation. This is achieved by implementing
    >> org.apache.cayenne.access.reveng.NamingStrategy interface. Modeler itself is
    >> distrubuted with two default strategies.
    >>
    >> org.apache.cayenne.access.reveng.BasicNamingStrategy generates names in
    >> Cayenne 2.0-style. Thus, to-one relationships will be prefixed by "to",
    >> to-many relationships will be postfixed by 'Array'. Examples of such names
    >> are "toArtist" and "paintingArray".
    >>
    >> org.apache.cayenne.modeler.util.SmartNamingStrategy uses FK column names
    >> for to-one relationship names (e.g. if FK column is called "ARTIST_ID" or
    >> "ARTISTID" the relationship's name will be just "artist"). To-many
    >> relationship names are pluralized forms of other-side entities names, e.g.
    >> "paintings". Pluralization is done in rules of English language using
    >> Inflector <https://inflector.dev.java.net/>.
    >>
    >> To use one of predefined strategies or your own one you must specify
    >> strategy class name in "Naming Stragegy" field of "Select Options" dialog.
    >> JAR with user strategy must be attached using Tools->Preferences->ClassPath
    >> bookmark. NamingStrategy implementation must have a public default
    >> constructor.
    >>
    >> *Running Reverse Engineering.* After desired options are selected, click
    >> "Continue". Progress dialog will open. It will close automatically when
    >> reverse-engineering is done. After that all database tables and stored
    >> procedures that matched selected criteria will be added to the DataMap.
    >> Default ObjEntity mapping will be created as well.
    >>
    >>
    >> TODO: Change the screenshot.
    >>
    >> Powered by Atlassian Confluence<http://www.atlassian.com/software/confluence/default.jsp?clicked=footer>(Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature
    >> request <http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470>
    >>
    >> Unsubscribe or edit your notifications preferences<http://cwiki.apache.org/confluence/users/viewnotifications.action>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Fri Nov 21 2008 - 14:23:40 EST