Bugs item #520650, was opened at 2002-02-20 13:19
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=520650&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
Status: Closed
Resolution: Invalid
Priority: 5
Submitted By: Jason Robertson (jrslim)
Assigned to: Dain Sundstrom (dsundstrom)
Summary: Relationships Broken

Initial Comment:
I'm running code pulled form CVS on 02/20/02 and 
relationships are not being handled correctly in that 
the field associated with the relation is being 
thought of as a cmp field and is being used in the sql 
generation when loading the bean. Thus, the sql is bad 
and causes the DB to throw an error.

I tried running the cmp-example that comes with the 
documentation and it fails in the same way as my code, 
specifically including an "order" field in the 
LineItemEJB load, and the order field is a cmr field.

I did not try running the JBoss testsuite, so I don't 
know if anything there fails.

Sorry I don't have detailed logs as I didn't copy them 
originally, but it seems easy to reproduce.

----------------------------------------------------------------------

Comment By: Infogest (infogest)
Date: 2002-02-21 03:45

Message:
Logged In: YES 
user_id=167837

most probably that "order" you see is the foreign key field
for an entity called "order". That's why it is in the select
clause.
but as it is also an SQL keyword it will cause an sql error.
You should user jboss-cmp.xml to change the name of the
foreign key field.

----------------------------------------------------------------------

Comment By: Jay Walters (jwalters)
Date: 2002-02-20 19:00

Message:
Logged In: YES 
user_id=183794

Order is generally a reserved word because it is a SQL
token, so one shouldn't use it as either a table or column name.

----------------------------------------------------------------------

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-02-20 18:07

Message:
Logged In: YES 
user_id=251431

The examples that come with the JBossCMP docs only run on
JBoss 3.0 alpha.  There have been many changes since the alpha.

----------------------------------------------------------------------

Comment By: Jason Robertson (jrslim)
Date: 2002-02-20 15:34

Message:
Logged In: YES 
user_id=464997

When I run the cmp-examples code, I get at least the 
following error (many pages of stack trace fly by and out 
of my screen buffer):

18:24:11,234 ERROR [LogInterceptor] 
TransactionRolledbackException, causedBy:
java.sql.SQLException: Unexpected token: ORDER in statement 
[SELECT id,quantity,
 shipped, order FROM LineItemEJB WHERE (id=10000) OR 
(id=10001) OR (id=10002) OR
 (id=10003) OR (id=10004) OR (id=10005) OR (id=10006) OR 
(id=10007) OR (id=10008
) OR (id=10009) OR (id=10010) OR (id=10011) OR (id=10012) 
OR (id=10013) OR (id=1
0014) OR (id=10015) OR (id=10016) OR (id=10017) OR 
(id=10018) OR (id=10019)]

The "Unexpected token: ORDER" error is the problem I'm also 
seeing in my code. It's an error because 'order' is not a 
field in the database, it is a container-managed-
relationship field.

It's entirely possibly that I have something configured 
wrong, as does possibly the cmp-examples stuff (I had to 
fix at least one EJB-QL typo to get it to deploy). I won't 
post the code specifics since I'm pretty sure you have the 
cmp-examples code! :) If your code works on your machine 
perhaps the code shipping with the documentation is a bit 
out of date.

I admit I haven't run the testsuite yet, I'll try it with 
my code as soon as I have a chance.

----------------------------------------------------------------------

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-02-20 15:08

Message:
Logged In: YES 
user_id=251431

Relationships work fine.  We have a relationship testsuite.
 You need to be more detailed.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=520650&group_id=22866

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to