-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: The many2many relation ... was declared, but not identified.
PostPosted: Thu May 20, 2004 10:22 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 9:36 am
Posts: 28
I'm attempting to utilize the <many2many> element in my middlegen build file. Unfortunatly I keep getting this error message:

Code:
[middlegen] (middlegen.MiddlegenPopulator 1044) The many2many relation groups-users_groups-users was declared, but not identified.



I'm using a simple HSQL setup here's the SQL for the tables:

Code:
CREATE TABLE USERS(
ID INTEGER NOT NULL IDENTITY PRIMARY KEY,
NAME LONGVARCHAR(255) NOT NULL
)

CREATE TABLE GROUPS(
ID INTEGER NOT NULL IDENTITY PRIMARY KEY,
NAME LONGVARCHAR(255) NOT NULL
)

CREATE TABLE USERS_GROUPS(
USER_ID INTEGER NOT NULL,
GROUP_ID INTEGER NOT NULL,
CONSTRAINT SYS_PK_USERS_GROUPS PRIMARY KEY(USER_ID,GROUP_ID),
CONSTRAINT SYS_FK_1 FOREIGN KEY(USER_ID) REFERENCES USERS(ID),
CONSTRAINT SYS_FK_2 FOREIGN KEY(GROUP_ID) REFERENCES GROUPS(ID))



and the <many2many> element looks like this

Code:
<many2many>
    <tablea generate="true" name="users"/>
    <jointable name="users_groups" generate="false"/>
    <tableb generate="true" name="groups"/>
</many2many>



I've read through the sample that comes with the Middlegen package (airline) and I just can't seem to pinpoint where I'm going wrong. As always, any help is greatly appreciated

Thanks,
Tyler Pitchford


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 11:47 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 9:36 am
Posts: 28
After much tinkering, fiddling and who knows what else, I figured it out. Apparently HSQL stores the table names in UPPERCASE even though I entered them as lower case. Since my <many2many> was trying to use the lowercase names, it wasn't detecting the relationship correctly.

Is there anyway to make Middlegen case agnostic?

Thanks,
Tyler


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.