Results 1 to 3 of 3

Thread: DbManaged.aj deleted even with automaticallyDelete=false

  1. #1
    Join Date
    Apr 2011
    Posts
    20

    Default DbManaged.aj deleted even with automaticallyDelete=false

    Hi there,
    do somebody know why Roo (1.1.5) deletes a Roo_DbManaged.aj when the table introspect in dbre.xml is removed even if automaticallyDelete property of RooDbManaged annotation is set to false?

    I have the following scenario:
    I did the reverse engineer of a DB schema. And Roo generated one entity with all its aj files (also Roo_DbManaged.aj). As I need to reverse engineer another schema, so I set automaticallyDelete to false in this Entity. I ran reverse engineer command over the other schema but Roo delted the DbManaged.aj of the first Entity.

    Is not supposed that with that property value, it wouldn't happen?
    Óscar Rovira Casanova
    orovira@disid.com
    Disid Technologies S.L.
    Software Engineer
    http://www.disid.com

  2. #2
    Join Date
    Dec 2005
    Posts
    930

    Default

    Is not supposed that with that property value, it wouldn't happen?
    The property is there to prevent the .java file from being deleted. Since you have overwritten the dbre.xml with a new schema, the DbreMetadataProviderImpl class won't find your entity anymore as a managed entity and returns null, preventing the DbreMetadata from being instantiated and hence creating (preserving) the ITD.

    In your scenario, you should push in all the fields, and then let JavaBeanMetadata takeover and create your accessors and mutators.

    But remember the present of tables in the dbre.xml determines if metadata is created for the @RooDbManaged annotation.

    Alan
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    Apr 2011
    Posts
    20

    Default

    Than you Alan, that's just what I did
    Óscar Rovira Casanova
    orovira@disid.com
    Disid Technologies S.L.
    Software Engineer
    http://www.disid.com

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •