RE: Reengineering Overwrites

From: Weddle, Anthony (Anthony.Weddl..luescopesteel.com)
Date: Thu Apr 09 2009 - 00:28:48 EDT

  • Next message: Robert Zeigler: "Re: Reengineering Overwrites"

    Well, if I do reverse engineering in the modeler, the process wants to
    create new ObjEntity entries. For any table that I accept an overwrite
    for, it creates a new corresponding ObjEntity. I thought it might
    overwrite the old one but it creates a new one, with a unique suffix.
    This newly created ObjEntity doesn't know anything about changes I may
    have made to the original one, instead, it just uses the table
    definition in the DbEntity as a basis.

    There may actually be valid schema changes that have found their way to
    the newly created ObjEntity which I'd want to merge into the existing
    customised ObjEntity for the table.

    For example, suppose I customised a Java type to be an extended type,
    instead of a String. If I change that table in the schema (perhaps
    adding or removing columns, and changing varchar widths) and use the
    reverse engineering function, I get an ObjEntity that has a different
    name to the existing ObEntity and doesn't have any of the manual
    customisations I made. I don't really want to have to re-do my
    customisations, especially as there may be several classes that have had
    schema changes and there is no way to easily see which tables have
    changed.

    As we have over 170 tables in the schema that we use, I wouldn't want to
    manually go through every generated ObjEntity to check for, and re-do,
    customisations and also wouldn't want to manually delete the unneeded
    ObjEntities that were generated.

    There are other potential changes to the ObjEntity but the above is a
    common example.

    Tony

    -----Original Message-----
    From: Aristedes Maniatis [mailto:ar..sh.com.au]
    Sent: Thursday, 9 April 2009 3:50 p.m.
    To: use..ayenne.apache.org
    Subject: Re: Reengineering Overwrites

    On 09/04/2009, at 1:18 PM, Weddle, Anthony wrote:

    > We occasionally make database schema changes. We also modify some of
    > the
    > attributes of ObjEntity entries. It looks like a reverse engineering
    > run
    > would ignore any changes to ObjEntity entries. Is there any way to
    > have
    > changes merged?

    You should make all the additions you need to the subclass. So you'll
    have

    _Artist.java

    and then you modify

    Artist.java

    with your overrides.

    However, you are able to specify ID generation strategy, superclasses,
    relationships and extended types in the modeler. Is there something
    specific you are wanting to do which you find missing in the modeler?

    Regards
    Ari

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A



    This archive was generated by hypermail 2.0.0 : Thu Apr 09 2009 - 00:28:58 EDT