Title: middlegen-devel digest, Vol 1 #631 - 1 msg

Thanks. I tried using the singular and plural properties but perhaps didn’t use them correctly. I’ll give it another shot.

 


From: Darren Hartford [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 11:32 AM
To: [EMAIL PROTECTED]
Subject: bug report: bad EJB code when related table name is plural

 

Hi Mark,

This is a known issue. You should be able to work around the problem by using 'singular' and 'plural' properties in your table definition.

 

example:

 

<table name="X_CLASSES" singular="X_CLASSES" plural="X_CLASSES"......>

 

This is usually what I do because I do not want to get confused between singular/plural items for my particular projects.  Hopefully this will help!

-D

 

To: [EMAIL PROTECTED]
Subject: [Middlegen-devel] bug report: bad EJB code when related table name is plural
Reply-To: [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

Reply via email to