Discussion:
[Middlegen-user] Middlegen gets creative with table names
Casper Højstrup
2004-11-24 11:13:44 UTC
Permalink
I have a naming problem.
For some reason a table 'SUBSCRIPTIONS' get renamed to Subscription(no trainling s)..
Thus, when OC4J see's that this table down exisit, it creates it.
That's kind of ironic since the beans or build FROM the subscriptions table.. What How and Why ?

Here's the XML
<target
name="RUN MIDDLEGEN"
description="Run Middlegen"
unless="middlegen.skip"
depends="check-driver-present"
<taskdef
name="middlegen"
classname="middlegen.MiddlegenTask"
classpathref="cho.middlegen.classpath"
/>
<middlegen
appname="${name}"
prefsdir="${src.dir}"
gui="${gui}"
databaseurl="${database.url}"
initialContextFactory="${java.naming.factory.initial}"
providerURL="${java.naming.provider.url}"
datasourceJNDIName="${datasource.jndi.name}"
driver="${database.driver}"
username="${database.userid}"
password="${database.password}"
schema="${database.schema}"
catalog="${database.catalog}"
<table name="SUBSCRIPTIONS"/>
<!-- <table name="ADDRESS"/>-->
<!-- <table name="CUST"/>-->
<!-- <table name="CUST_AUX"/>-->
<!-- <table name="CUST_PER_CATEGORY"/>-->
<!-- <table name="CONTACT"/>-->
<!-- <table name="CONTACT_TYPE"/>-->
<!-- <table name="CONTACT_TYPE_PARAM"/>-->
<!-- <table name="CONTACT_ROLES"/>-->
<!-- <table name="CONTACT_METHOD"/>-->
<!-- <table name="CONTACT_METHOD_TYPES"/>-->
<!-- <table name="ZIPCODE_MST"/>-->


<cmp20
destination="../src"
package="${subscription.package.name}.server.persistence.ejb"
interfacepackage="${subscription.package.name}.server.persistence.interfaces"
jndiprefix="${unique.name}"
pkclass="true"
dataobject="true"
valueobject="true"
sessionfacade="true"
viewtype="local"
mergedir="${basedir}/src/middlegen"
readonly="false"
fkcmp="true"
guid="false"
</cmp20>
</middlegen>
</target>


ps. CONTACT_ROLES get truncated too, to ContactRol!

Fist off, the bean will look like this ;
SubscriptionBean (no s)
@ejb.persistence table-name="SUBSCRIPTIONS" (this is right)
When XDOCLET comes along, it will autocreate a table names Subscription.


Ideas ?



Casper Hojstrup
J2EE & DBA Plumber
Sondagsavisen a-s

Loading...