The Artima Developer Community
Sponsored Link

Java Answers Forum
How to force kodo to generate the Foreign Keys while creating the SQL ?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Brian Grey

Posts: 3
Nickname: ngok
Registered: Feb, 2005

How to force kodo to generate the Foreign Keys while creating the SQL ? Posted: Feb 4, 2005 9:12 AM
Reply to this message Reply
Advertisement
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
kod o.ee.ManagedRuntimeProperties=TransactionManagerName=java:/TransactionManager
ko do.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.optio n.ConnectionPassword=PASSWORD
javax.jdo.option.ConnectionURL=jdbc:oracle:thin:@c oyote:1521:DEV
javax.jdo.option.Optimistic=true
javax.jdo.option.RetainValues=tr ue
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>

Topic: Parallelism in Java Previous Topic   Next Topic Topic: problems with jakarta commons fileupload

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use