CayenneModeler and Reengineering Database Schema

From: Michael Lepine (mikelepin..mail.com)
Date: Mon Nov 26 2007 - 17:06:46 EST

  • Next message: Andrus Adamchik: "Re: Cayenne 3.0M2 for Production"

    Hello all.

    I am currently using CayenneModeler version 2.0.3 to reengineer a
    database schema and generate the subsequent Java classes. Some of the
    ObjEntity instances have primary/foreign keys mapped manually because
    these keys are generated by another process (outside of the Cayenne
    framework). The schema that I manage is very large and is periodically
    updated as part of maintenance and new development tasks. In order to
    update the model (...map.xml file) with the schema changes, I go
    through a fairly tedious process that involves the following:

    1. update database schema
    2. copy cayenne configuration files (cayenne.xml, ....map.xml and
    ...driver.xml) to a temp directory
    3. start CayenneModeler
    4. open the project from the temp directory
    5. run Tools > Reengineer Database Schema
    6. when prompted that a table exists, I opt to overwrite it to ensure
    I get all updates
    7. save (temp) project
    8. compare the differences between the temp map.xml and original
    map.xml files, manually copying the updates from the original to the
    temp file
    9. test that I haven't made mistakes by opening the temp project and
    then double-checking it visually if it loads

    I do this because the manual mappings in the ObjEntity instances are
    removed when I run Reengineer Database Schema which does not seem like
    desired behavior. I would expect manual attribute mappings created in
    the ObjEntity instances to remain after reengineering a schema if:

    1. the same schema is being reengineered
    2. the corresponding DbEntity attribute still exists

    I downloaded the 2.0.4 and 3.0M2 versions of the Modeler to see if the
    behavior was different. It appears that manually mapped ObjEntity
    attributes are dropped in all versions under the above scenario.

    Is there an easier/more efficient way to update my model (map.xml) files?

    Has anyone else encountered a similar issue?

    Thank you for your help.

    - Mike



    This archive was generated by hypermail 2.0.0 : Mon Nov 26 2007 - 17:07:19 EST