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

Column Index out of range error while executing select having two fields with same name in mapped superclass and inheriting class #2307

Open
MarekChr opened this issue Nov 21, 2024 · 0 comments

Comments

@MarekChr
Copy link

Stack trace
stack_trace.txt

To Reproduce

  1. Create @MappedSuperclass
  2. Create @Entity, which inherits from MappedSuperclass created earlier
  3. In MappedSuperclass, add field, eg. @Column protected Boolean alive;
  4. In Entity, add field with same name and type, eg. @Column private boolean alive;
  5. Create named query ("select all" and add where clause, which include field created earlier) and execute it (getResultList()). You can see specific example in stack trace.

(I do not know how EclipseLink handle fields internally, so I am not sure if different access modifiers or wrapped primitive type change something, In steps to reproduce I chosed the same while encountering this bug.)

EclipseLink version
3.0.4

Java/JDK version openjdk version
"1.8.0_412"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_412-b08)
OpenJDK 64-Bit Server VM (Temurin)(build 25.412-b08, mixed mode)

DB used (which is probably unrelated)
MySQL 8.4

Additional info
Parameter bounding seems OK (1 parameter expected, 1 parameter provided), however it looks like it has problem with same fields in inheriting and inherited classes while trying to map them to ?: Column Index out of range, 2 > 1 (see stack trace).

This is a design bug. Solution is to remove same field from inheriting class, however Index out of range error message seems related to something else.

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

No branches or pull requests

1 participant