cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Gentry" <blackn...@gmail.com>
Subject Re: CayenneModeler and Reengineering Database Schema
Date Tue, 27 Nov 2007 14:19:53 GMT
Hi Michael,

This question seems to pop up ever 3 months or so.  There currently is
not a good way, inside the modeler, to re-reengineer the database
schema.  It is a fairly difficult problem and we just haven't looked
into it enough yet.  People have different techniques of handling
this.  I personally just manually update the model once it is created
(since it doesn't change that frequently or drastically).  Since you
are doing file compares (step 8), it would be really helpful if you
have a good graphical comparison tool.  If on OS X, FileMerge is
really nice (and comes with the free Apple developer tools or might
even be part of the base OS).  For Windows/Linux, I'm sure a Google
search would help you there.

Sorry there isn't a better answer currently,

/dev/mrg


On Nov 26, 2007 5:06 PM, Michael Lepine <mikelepine@gmail.com> wrote:
> 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
>

Mime
View raw message