Exclude condition set still getting ModelException for CrossSchema

29 views
Skip to first unread message

HessB

unread,
Jan 27, 2014, 4:11:51 PM1/27/14
to minute...@googlegroups.com
I am trying to use minuteProject to create annotated JPA2 classes from an Oracle schema:  SCHEMATRAC.

SCHEMATRAC.DT_ITEM has a foreign key which references a table in another schema.

In my mp-config-schematrac file I set the business-model like so:

<business-model>
   <generation-condition>
      <condition type="exclude" startsWith="DT_"></condition>
      <condition type="exclude" startsWith="PIC_"></condition>            
</generation-condition>

As I understand it, DT_ITEM should be ignored.  However, I am still getting the exception:


C:\minuteProject\mywork\config>call model-generation.cmd mp-config-schematrac.xml
config mp-config-schematrac.xml
0    [main] INFO  net.sf.minuteProject.application.ModelGenerator  - start time = Mon Jan 27 14:59:04 CST 2014
827  [main] INFO  net.sf.minuteProject.application.AbstractGenerator  - load catalog-entry JPA2
org.apache.ddlutils.model.ModelException: The foreignkey DT_ITEM_DATA_ERROR_FK2 in table DT_ITEM references the undefined table DATA
_ERROR_TYPE
        at org.apache.ddlutils.model.Database.initialize(Database.java:337)
        at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:488)
        at org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:436)
        at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1884)
        at org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1869)
        at net.sf.minuteProject.configuration.bean.model.data.impl.DDLUtils.DatabaseDDLUtils.loadDatabase(DatabaseDDLUtils.java:76)
        at net.sf.minuteProject.configuration.bean.model.data.impl.DDLUtils.DatabaseDDLUtils.<init>(DatabaseDDLUtils.java:58)
        at net.sf.minuteProject.configuration.bean.model.data.DataModelFactory.getDatabase(DataModelFactory.java:18)
        at net.sf.minuteProject.configuration.bean.DataModel.loadDatabase(DataModel.java:49)
        at net.sf.minuteProject.application.ModelGenerator.loadModel(ModelGenerator.java:254)
        at net.sf.minuteProject.application.ModelViewGenerator.loadModel(ModelViewGenerator.java:64)
        at net.sf.minuteProject.application.ModelGenerator.getEnrichedModel(ModelGenerator.java:200)
        at net.sf.minuteProject.application.ModelGenerator.generate(ModelGenerator.java:169)
        at net.sf.minuteProject.application.AbstractGenerator.generate(AbstractGenerator.java:219)
        at net.sf.minuteProject.application.ModelViewGenerator.main(ModelViewGenerator.java:52)
51987 [main] INFO  net.sf.minuteProject.application.ModelGenerator  - end time = Mon Jan 27 14:59:56 CST 2014
51989 [main] INFO  net.sf.minuteProject.application.ModelGenerator  - time taken : 52s.



Is there any way to avoid this behavior?
   

Florian Adler

unread,
Jan 27, 2014, 5:02:55 PM1/27/14
to minute...@googlegroups.com
Hi Benjamin,

Do you have the sql of the schematrac?

I will investigate on this schema.

To answer to your question:
Is there any way to avoid this behavior?
At first sight ... no, because from the stacktrace, I deduce that Minuteproject is at the set of loading the entire schema relationships (the exclusions are processed after when generating the artifact).
It means that I need to know where DATA _ERROR_TABLE is stored. The name of table seems to be split between DATA and _ERROR_TABLE.

Best regards,

Florian. 


2014-01-27 HessB <benjami...@gmail.com>

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes minuteproject.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse minuteprojec...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .

Florian Adler

unread,
Jan 28, 2014, 8:46:19 AM1/28/14
to minute...@googlegroups.com
Hi Benjamin,

The technical way I see to avoid this behavior is to drop the cross schema constraint on Oracle.

The problem comes from DDLUtils library that cannot retrieve the DATA ERROR TABLE metadata, I have debug it from your config.

Best regards,

Florian.


2014-01-27 Florian Adler <minute...@gmail.com>
Message has been deleted

HessB

unread,
Jan 28, 2014, 10:24:43 AM1/28/14
to minute...@googlegroups.com
Thanks, Florian.  Unfortunately, I do not have rights to drop the constraint.  I will talk to the DBA to see what I can do. 

Thanks again for your help.

Florian Adler

unread,
Jan 28, 2014, 11:34:46 AM1/28/14
to minute...@googlegroups.com
If you are using Oracle, he (the DBA) can just disable the constraint and then enable it back again.

Best regards,

Florian.


2014-01-28 HessB <benjami...@gmail.com>

Florian Adler

unread,
Feb 7, 2014, 9:30:48 AM2/7/14
to minute...@googlegroups.com
Hi Benjamin,

I come back to you on this issue, and i think you can solve it but creating oracle synonym whose name match the other schema name.
This is how I've done.

Best regards,

Florian.
Reply all
Reply to author
Forward
0 new messages