Results 1 to 7 of 7

Thread: DBRE leaving out _DbManaged and _ToString

  1. #1
    Join Date
    Jan 2011
    Posts
    12

    Default DBRE leaving out _DbManaged and _ToString

    Hi, I ran DBRE against a live mysql db with approximately 100 tables. I now have all the entities in their ITD managed forms - but one entity, call it Automobile didn't get an Automobile_Roo_DbManaged or Automobile_Roo_ToString file - it appears that the rest of the entities did though. The DBRE task completed with no errors.

    Can I rerun DBRE for just one entity? Can I create one by hand and have roo recognize it? I don't know why it happened but I'm interested in the best way to proceed.

    Thanks.

  2. #2
    Join Date
    Dec 2005
    Posts
    929

    Default

    Are there other fields in the table besides a primary key or version field? These two fields are added to the entity ITD,

    If there are other fields, when you re-start Roo, is the Roo_DbManaged ITD created?
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  3. #3
    Join Date
    Jan 2011
    Posts
    12

    Default

    There are many fields in the table including primary key, 4 FK's to other tables and approx 20 other fields. In the entity ITD there is only the PK field and crud methods - no version. Same for all the other entities that were successfully created with all their other fields in the dbmanaged ITD. Also I have restarted roo several times and the dbmanaged entity is not created.

    I'm thinking I should just run rerun dbre with --includeTable option for just this table. If I do, will dbre handle the FK's correctly to the other tables that are already set up right?

  4. #4
    Join Date
    Dec 2005
    Posts
    929

    Default

    The --includeTables will only bring back that table and will delete all other tables in the .roo-dbre file and in-turn will delete all your entities except the table you want to include. So this is not the option to use.

    Please raise a Jira request and attach your MySQL DDL and .roo-dbre file. I need to be able to reproduce it.
    Thanks
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  5. #5
    Join Date
    Jan 2011
    Posts
    12

    Default

    OK, thx. While I put that together would it be worth a try to shut down roo and attempt to create the missing ITD's by hand and then restart? Would that fool roo into thinking it had generated the entity/ITD's correctly?

  6. #6
    Join Date
    Dec 2005
    Posts
    929

    Default

    ITDs are managed by Roo. If you create an ITD that wasn't there it will be deleted. If you delete an ITD it will be recreated and if you edit an ITD, your changes will be overwitten when Roo is restarted.
    Alan Stewart
    Spring Roo Committer
    twitter @alankstewart

  7. #7
    Join Date
    Jan 2011
    Posts
    12

    Default

    I found my problem - I imported my mysql schema to my local dev box prior to running dbre. There was one of the 188 tables that didn't make it in. The partial entity was dependent on that missing table so it was not completing correctly. Didn't see an error for it though when the dbre ran.

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
  •