• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to force kodo to generate the Foreign Keys while creating the SQL script?

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to generate the SQL script using the schema.xml that Kodo generated. The Foreign Keys are still missing in the script. But they exist in the schema.xml.

I put this line inside the kodo.properties but nothing has changed
kodo.jdbc.ForeignKeyConstraints: true


How can I force kodo to generate the Foreign Keys while creating the SQL script?

Thanks


kodo.properties

kodo.LicenseKey=XXXX-XXXX-XXXX-XXXX-XXXX
kodo.ee.ManagedRuntimeProperties=TransactionManagerName=java:/TransactionManager
kodo.Log: DefaultLevel=ERROR

javax.jdo.PersistenceManagerFactoryClass=kodo.jdbc.runtime.JDBCPersistenceManagerFactory
javax.jdo.option.ConnectionDriverName=oracle.jdbc.driver.OracleDriver
javax.jdo.option.ConnectionUserName=USERNAME
javax.jdo.option.ConnectionPassword=PASSWORD
javax.jdo.option.ConnectionURL=jdbc racle:thin:@coyote:1521 EV
javax.jdo.option.Optimistic=true
javax.jdo.option.RetainValues=true
javax.jdo.option.NontransactionalRead=true



build.xml
......
<target name="jdo-copy">
<copy todir="${classes.dir}">
<fileset dir="${java.dir}">
<include name="**/*.jdo"/>
</fileset>
</copy>
</target>
<target name="jdo-enhance" depends="jdo-copy">
<jdoc>
<classpath refid="class.path"/>
<fileset dir="${classes.dir}">
<include name="**/*.jdo"/>
</fileset>
<config propertiesFile="kodo.properties"/>
</jdoc>
<mappingtool action="refresh" schemaFile="${target.dir}/schema.xml">
<classpath refid="tools.class.path"/>
<fileset dir="${classes.dir}">
<include name="**/*.jdo"/>
</fileset>
<config propertiesFile="kodo.properties"/>
</mappingtool>
</target>
<target name="refresh-datastore" depends="jdo-copy">
<schematool action="refresh">
<classpath refid="tools.class.path"/>
<fileset file="${target.dir}/schema.xml"/>
<config propertiesFile="kodo.properties"/>
</schematool>
</target>
<target name="generate-sql" depends="jdo-copy">
<schematool action="dropDB" file="${sql.dir}/oracle/scripts/Kodo-DropTables.sql">
<classpath refid="tools.class.path"/>
<fileset file="${target.dir}/schema.xml"/>
<config propertiesFile="kodo.properties"/>
</schematool>
<schematool action="refresh" file="${sql.dir}/oracle/scripts/Kodo-CreateTables.sql">
<classpath refid="tools.class.path"/>
<fileset file="${target.dir}/schema.xml"/>
<config propertiesFile="kodo.properties"/>
</schematool>
</target>
......


schema.xml

<schemas>
<schema>
......
<table name="SUBCA_JOBSET">
<column name="JOBSET_MSISDN" type="varchar" size="255"/>
<column name="KEY0" type="varchar" size="255"/>
<fk name="F_SBC_BST_JOBSET_REF" to-table="SUBCAMPAIGN" column="KEY0"/>
<fk name="F_SBC_BST_JOBSET_ELEMENT" to-table="JOB" column="JOBSET_MSISDN"/>
<index name="I_SBC_BST_JOBSET" column="KEY0"/>
<index name="I_SBC_BST_JOBSET1" column="JOBSET_MSISDN"/>
</table>
......
</schema>
</schemas>
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic