Discussion:
[Middlegen-user] entity-cmp20.xtd
D***@apcc.com
2002-04-26 15:11:16 UTC
Permalink
I think there may be some errors in this template. Most regarding jboss.
There were some changes in the way relationships are defined in
jbosscmp-jdbc as of jboss 3 rc1. I think this is what is causing the
problem. Here is what I have done

in the forAllRelationshipRoles there is a line

related-pk-field
="<XDtMgCore:primaryKey/>"</XDtMgCore:forAllColumnMaps></XDtMgCore:ifIsRolePrimaryKey>

jboss now expects the primary key field in the field-name this line seems
to fix the problem

related-pk-field
="<XDtMgEntity20:primkeyField/>"</XDtMgCore:forAllColumnMaps></XDtMgCore:ifIsRolePrimaryKey>



Also I have changed the setter getter creation to exclude foreign keys
since they are handled by cmr

<XDtMgCore:forAllFields>
<XDtMgCore:ifIsNotFk>
/**
* Returns the <XDtMgJava:fieldJavaName/>
*
* @return the <XDtMgJava:fieldJavaName/>
*
* @ejb:persistent-field
<XDtMgEntity20:ifIsGetterInterfaceMethod>
* @ejb:interface-method view-type="<XDtMgEntity20:getterViewType/>"
</XDtMgEntity20:ifIsGetterInterfaceMethod>
<XDtMgCore:ifIsPk>
* @ejb:pk-field
</XDtMgCore:ifIsPk>
*
* @weblogic:dbms-column <XDtMgCore:fieldSqlName/>
*
* @jboss:column-name <XDtMgCore:fieldSqlName/>
*/
public abstract <XDtMgJava:fieldJavaType/>
get<XDtMgJava:fieldJavaNameCapitalised/>();

/**
* Sets the <XDtMgJava:fieldJavaName/>
*
* @param <XDtMgJava:fieldJavaType/> the new <XDtMgJava:fieldJavaName/>
<XDtMgEntity20:ifIsSetterInterfaceMethod>
* @ejb:interface-method view-type="<XDtMgEntity20:setterViewType/>"
</XDtMgEntity20:ifIsSetterInterfaceMethod>
*/
public abstract void set<XDtMgJava:fieldJavaNameCapitalised/>
(<XDtMgJava:fieldJavaType/> <XDtMgJava:fieldJavaName/>);
</XDtMgCore:ifIsNotFk>
</XDtMgCore:forAllFields>


The last problem I am having is that the part that generates the relation
mapping tags for jboss is on the wrong side of the relation
for example I have a bean Contact and a bean Phone this is the tag.
Rather than being in contact were it is generated it should be in phone,
the many side of the relation

* @jboss:relation
* fk-constraint="true"
* fk-column="ContactGUID"
* related-pk-field="guid"


If someone could help me figure out how to fix this one I would appreciate
it.

Loading...