Skip to main content

[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

Back to the top