Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException at SQLMergeClause.execute() #939

Closed
cowwoc opened this issue Sep 19, 2014 · 3 comments
Closed

IndexOutOfBoundsException at SQLMergeClause.execute() #939

cowwoc opened this issue Sep 19, 2014 · 3 comments
Milestone

Comments

@cowwoc
Copy link
Contributor

@cowwoc cowwoc commented Sep 19, 2014

Hi,

I just got the following exception:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    at java.util.ArrayList.get(ArrayList.java:429)
    at com.mysema.query.sql.dml.SQLMergeClause.getIds(SQLMergeClause.java:298)
    at com.mysema.query.sql.dml.SQLMergeClause.executeCompositeMerge(SQLMergeClause.java:303)
    at com.mysema.query.sql.dml.SQLMergeClause.execute(SQLMergeClause.java:267)

Looking at the source-code, it seems you expect me to invoke keys(). Please improve the error message, for all cases where the code invokes keys.get(0) (there are 3 locations by my count).

@timowest timowest added this to the 3.5.0 milestone Sep 20, 2014
@timowest
Copy link
Member

@timowest timowest commented Sep 20, 2014

I provided a pull request which uses the primary key columns as a fallback, if a primary key is defined and otherwise throws an exception.

@cowwoc
Copy link
Contributor Author

@cowwoc cowwoc commented Sep 20, 2014

Looks good to me.

@timowest
Copy link
Member

@timowest timowest commented Sep 30, 2014

Released in 3.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.