Error with Multiple 1:M and M:N relations between 2 tables

Ben Litchfield <[email protected]>
Newsgroups gmane.comp.java.ejb.middlegen.user
Message-ID <[email protected]>
I am using the latest version from CVS.  I did not notice any open issues
that covered this issue.

It appears that middlegen is incorrectly identifying relationship type and
method names when there are multiple relationships between 2 tables.

I am getting methods names like

public abstract java.util.Collection getUserMasters-by--created_by();

This is wrong for two reasons
1)The obvious compile errors due to the '-'
2)This method should return a single UserMaster and not a collection.


Is there any workaround for this?


Below is my schema.  Any help would be great.

Ben

<table name="user_master">
  <column name="user_id" required="true" primaryKey="true"
type="INTEGER"/>
  <column name="username" required="true" size="16" type="VARCHAR"/>
  <column name="password" required="false" size="50" type="VARCHAR"/>
  <column name="created_by" required="true" type="INTEGER"/>
  <foreign-key foreignTable="user_master">
    <reference local="created_by" foreign="user_id"/>
  </foreign-key>
</table>
<table name="user_group_xsect">
  <column name="user_id" required="true" primaryKey="true"
type="INTEGER"/>
  <column name="group_id" required="true" primaryKey="true"
type="INTEGER"/>
    <column name="create_ts" required="true" type="TIMESTAMP"/>
  <column name="created_by" required="true" type="INTEGER"/>
  <foreign-key foreignTable="user_master">
    <reference local="created_by" foreign="user_id"/>
  </foreign-key>
  <foreign-key foreignTable="user_master">
    <reference local="user_id" foreign="user_id"/>
  </foreign-key>
  <foreign-key foreignTable="group_master">
    <reference local="group_id" foreign="group_id"/>
  </foreign-key>
</table>
<table name="group_master">
  <column name="group_id" required="true" primaryKey="true"
type="INTEGER"/>
  <column name="full_name" required="false" size="50" type="VARCHAR"/>
  <column name="created_by" required="true" type="INTEGER"/>
  <foreign-key foreignTable="user_master">
    <reference local="created_by" foreign="user_id"/>
  </foreign-key>
</table>


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.