Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1273

database reverse engineer w/ MySQL and foreign keys across multiple schemas/catalogs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.1.0.M3
    • Fix Version/s: 1.1.0.RC1
    • Component/s: PERSISTENCE
    • Labels:
      None
    • Environment:
      Eclipse 3.6, MySQL 5.1, STS 2.3.3.M2, Hibernate 3.5.4

      Description

      I just tried the new database reverse engineer functionality with an existing MySQL database which has got multiple catalogs (as MySQL doesn't support schemas). There are various tables with foreign key relation to tables in other catalogs.
      When trying to run "database reverse engineer" it always ends with "NullPointerException at org.springframework.roo.addon.dbre.DbreMetadata.addManyToOneFields(DbreMetadata.java:235)" (see an example run below)

      de.st.db.model roo> database reverse engineer --package de.st.db.model --schema CM
      Managed SRC_MAIN_RESOURCES\META-INF\spring\dbre.xml
      Created SRC_MAIN_JAVA\de\st\db\model
      Created SRC_MAIN_JAVA\de\st\db\model\CmBillContracts.java
      Created de.st.db.model.CmBillContracts
      Created SRC_MAIN_JAVA\de\st\db\model\CmBillInvoices.java
      Created de.st.db.model.CmBillInvoices
      Created SRC_MAIN_JAVA\de\st\db\model\CmBillInvoiceItems.java
      Created de.st.db.model.CmBillInvoiceItems
      Created SRC_MAIN_JAVA\de\st\db\model\CmBillInvoiceItemTypes.java
      Created de.st.db.model.CmBillInvoiceItemTypes
      Created SRC_MAIN_JAVA\de\st\db\model\CmBillRates.java
      Created de.st.db.model.CmBillRates
      Created SRC_MAIN_JAVA\de\st\db\model\CmBillServices.java
      Created de.st.db.model.CmBillServices
      Created SRC_MAIN_JAVA\de\st\db\model\CmCallCalls.java
      Created de.st.db.model.CmCallCalls
      Created SRC_MAIN_JAVA\de\st\db\model\CmCallPhoneLines.java
      Created de.st.db.model.CmCallPhoneLines
      Created SRC_MAIN_JAVA\de\st\db\model\CmCallPhoneLineTypes.java
      Created de.st.db.model.CmCallPhoneLineTypes
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctAddresses.java
      Created de.st.db.model.CmCtctAddresses
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctAddressCities.java
      Created de.st.db.model.CmCtctAddressCities
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctAddressLocations.java
      Created de.st.db.model.CmCtctAddressLocations
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctAddressStreets.java
      Created de.st.db.model.CmCtctAddressStreets
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctCommunicationMeanTypes.java
      Created de.st.db.model.CmCtctCommunicationMeanTypes
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctEmailAddresses.java
      Created de.st.db.model.CmCtctEmailAddresses
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctEmailPrefixes.java
      Created de.st.db.model.CmCtctEmailPrefixes
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctGroups.java
      Created de.st.db.model.CmCtctGroups
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctGroupOwners.java
      Created de.st.db.model.CmCtctGroupOwners
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctNamesFirst.java
      Created de.st.db.model.CmCtctNamesFirst
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctNamesFirstCountries.java
      Created de.st.db.model.CmCtctNamesFirstCountries
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctNamesLast.java
      Created de.st.db.model.CmCtctNamesLast
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctPersons.java
      Created de.st.db.model.CmCtctPersons
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctPersonEmailAddresses.java
      Created de.st.db.model.CmCtctPersonEmailAddresses
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctPersonGroups.java
      Created de.st.db.model.CmCtctPersonGroups
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctPersonPhoneNos.java
      Created de.st.db.model.CmCtctPersonPhoneNos
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctPersonRelations.java
      Created de.st.db.model.CmCtctPersonRelations
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctPhoneAreaCodes.java
      Created de.st.db.model.CmCtctPhoneAreaCodes
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctPhoneNos.java
      Created de.st.db.model.CmCtctPhoneNos
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctRelations.java
      Created de.st.db.model.CmCtctRelations
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctSuperGroups.java
      Created de.st.db.model.CmCtctSuperGroups
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctSuperGroupGroups.java
      Created de.st.db.model.CmCtctSuperGroupGroups
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctTapirexCache.java
      Created de.st.db.model.CmCtctTapirexCache
      Created SRC_MAIN_JAVA\de\st\db\model\CmCtctTitles.java
      Created de.st.db.model.CmCtctTitles
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsCommunities.java
      Created de.st.db.model.CmLocsCommunities
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsCounties.java
      Created de.st.db.model.CmLocsCounties
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsCountries.java
      Created de.st.db.model.CmLocsCountries
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsDistricts.java
      Created de.st.db.model.CmLocsDistricts
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsMunicipalities.java
      Created de.st.db.model.CmLocsMunicipalities
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsNames.java
      Created de.st.db.model.CmLocsNames
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsNamesLang.java
      Created de.st.db.model.CmLocsNamesLang
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsOfficialMunicipalityKey.java
      Created de.st.db.model.CmLocsOfficialMunicipalityKey
      Created SRC_MAIN_JAVA\de\st\db\model\CmLocsStates.java
      Created de.st.db.model.CmLocsStates
      Created SRC_MAIN_JAVA\de\st\db\model\CmBillContracts_Roo_Entity.aj
      Created SRC_MAIN_JAVA\de\st\db\model\CmBillInvoices_Roo_Entity.aj
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmBillInvoices_Roo_Entity.aj
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmBillContracts_Roo_Entity.aj
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsStates.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsOfficialMunicipalityKey.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsNamesLang.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsNames.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsMunicipalities.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsDistricts.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsCountries.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsCounties.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmLocsCommunities.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctTitles.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctTapirexCache.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctSuperGroupGroups.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctSuperGroups.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctRelations.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctPhoneNos.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctPhoneAreaCodes.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctPersonRelations.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctPersonPhoneNos.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctPersonGroups.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctPersonEmailAddresses.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctPersons.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctNamesLast.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctNamesFirstCountries.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctNamesFirst.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctGroupOwners.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctGroups.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctEmailPrefixes.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctEmailAddresses.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctCommunicationMeanTypes.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctAddressStreets.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctAddressLocations.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctAddressCities.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCtctAddresses.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCallPhoneLineTypes.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCallPhoneLines.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmCallCalls.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmBillServices.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmBillRates.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmBillInvoiceItemTypes.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmBillInvoiceItems.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmBillInvoices.java
      Undo create SRC_MAIN_JAVA\de\st\db\model\CmBillContracts.java
      Undo create SRC_MAIN_JAVA\de\st\db\model
      Undo manage SRC_MAIN_RESOURCES\META-INF\spring\dbre.xml
      NullPointerException at org.springframework.roo.addon.dbre.DbreMetadata.addManyToOneFields(DbreMetadata.java:235)

      From "database introspect" I also couldn't see any schema information inside for those foreign key relations, so it seems, that Roo currently cannot handle data across multiple schemas/catalogs.
      I wouldn't like the idea to have to merge 250+ tables from separate schemas into one single schema, only to get Roo working.

        Attachments

          Activity

            People

            Assignee:
            stewarta Alan Stewart
            Reporter:
            stefan.tandecki Stefan Tandecki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: