EJB generator bug with plural table names

[email protected] Fri, 18 Feb 2005 17:31:44 -0500
Newsgroups gmane.comp.java.ejb.middlegen.user
Message-ID <[email protected]>
Middlegen emits bad EJB code that doesn't compile if a related table name is plural.  For example, a table name of X_CLASSES generates EJBs that won't compile but X_CLASSES_X compiles just fine.

Specifically, in the build.xml file, I define this relationship:

>		<table name="X_CLASS_SYM" generate="true">
>		</table>
>
>		<table name="X_CLASSES" generate="true">
>			<crossref fktable="X_CLASS_SYM" pkcolumn="CLASS_INDEX" fkcolumn="CLASS_INDEX" name="classesXToClassSymCrossRef"/>
>		</table>

It causes this error:

>compile-ejb:
>    [javac] Compiling 83 source files to C:\middlegen-2.1\samples\build\classes
>    [javac] C:\middlegen-2.1\samples\build\gen-src\xtree\ejb\XClassBean.j
ava:223: cannot resolve symbol
>    [javac] symbol  : variable xClassSyms
>    [javac] location: class xtree.ejb.XClassBean
>    [javac]       setXClassSyms(xClassSyms);
>    [javac]                       ^
>    [javac] 1 error

Fortunately, if I rename the table, the generated EJBs compile without error:

>		<table name="X_CLASSES_X" generate="true">
>			<crossref fktable="X_CLASS_SYM" pkcolumn="CLASS_INDEX" fkcolumn="CLASS_INDEX" name="classesXToClassSymCrossRef"/>
>		</table>

Who maintains the generator code that handles single/plural logic?

Best Regards,
Mark


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click