[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Order of adding Join Attribute Expressions when using Dynamic Persistence

Hi Christopher

Here is the stack trace:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
ÂÂÂ at java.util.ArrayList.add(Unknown Source)
ÂÂÂ at org.eclipse.persistence.internal.queries.JoinedAttributeManager.addExpressionAndBaseToGroupedList(JoinedAttributeManager.java:828)
ÂÂÂ at org.eclipse.persistence.internal.queries.JoinedAttributeManager.prepareJoinExpressions(JoinedAttributeManager.java:780)
ÂÂÂ at org.eclipse.persistence.queries.ObjectLevelReadQuery.prePrepare(ObjectLevelReadQuery.java:2057)
ÂÂÂ at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrePrepare(ObjectLevelReadQuery.java:834)
ÂÂÂ at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:817)
ÂÂÂ at org.eclipse.persistence.queries.DatabaseQuery.prepareCall(DatabaseQuery.java:1584)

Thanks

Can you post the exception?

Â


----- Original Message -----
From: rohit.banga@xxxxxxxxxx
To: eclipselink-users@xxxxxxxxxxx
Sent: Saturday, December 18, 2010 6:27:18 AM GMT -05:00 US/Canada Eastern
Subject: [eclipselink-users] Order of adding Join Attribute Expressions when using Dynamic Persistence

Hello All

I have a customer table, a phone table and an order table.
The customer table has a one-to-many with both the phone and order tables.

I am querying the order table.

If I add the join attributes in the following sequence then it works fine:

ÂÂÂ ÂÂÂ query.addJoinedAttribute(query.getExpressionBuilder().get("cust9.order9.custid"));
ÂÂÂ ÂÂÂ query.addJoinedAttribute(query.getExpressionBuilder().get("cust9.order9.custid").anyOf("cust9.phone9.custid"););

However, if I add in this sequence I get an IndexOutOfBounds Exception.

ÂÂÂ ÂÂÂ query.addJoinedAttribute(query.getExpressionBuilder().get("cust9.order9.custid").anyOf("cust9.phone9.custid"););
ÂÂÂ ÂÂÂ query.addJoinedAttribute(query.getExpressionBuilder().get("cust9.order9.custid"));


Could you please explain the reason for this exception? Is it expected that the join attributes be passed in a particular order?

Thanks in Advance.

--
Thanks and Regards
Rohit Banga
Member Technical Staff
Oracle Server Technologies

--
Thanks and Regards
Rohit Banga
Member Technical Staff
Oracle Server Technologies