-
Notifications
You must be signed in to change notification settings - Fork 92
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
EntityViewRepository findAll(start,max) fails with ClassCastException #720
Comments
Thanks for the report, but I couldn't reproduce it with H2 on the latest TomEE. I'm not sure, but this might be a DB2 + EclipseLink related issue |
Thank you for the quick look, but I think the issue could be with blaze deltaspike/eclipselink integration as EntityRepository.findAll(start,max) method of deltaspike data works with DB2 + eclipselink, but when I use EntityViewRepository of blaze deltaspike integration then it fails with the ClassCastException. |
Do you think you could share that example via e.g. a PR? I just tried to reproduce this with DB2 but couldn't. |
I finally reproduced it. Configuring DB2 for TomEE was harder than I thought. Looking into this now |
IMO this is an EclipseLink bug. I create a query like |
…ct of wrong type for count expression
There is an open PR associated with this issue that contains the workaround. You can build it yourself for now if you want to give it a try. I will try to do a release later this week, but I can't promise anything yet. |
Thanks. will check and confirm. |
…ct of wrong type for count expression
Count query works, but it fails in next step with below exception.
SQL query works after removing
|
Seems like this is another EclipseLink issue. I can look into it, maybe we can automatically adapt the EclipseLink DatabasePlatform to yield the correct behavior. |
Thanks |
The latest push should fix the issues with the null precedence handling on DB2 with EclipseLink |
I noticed EntityRepository.findAll(start, max) fails with NullPointerException.
It seems to be because of viewClass() being null in the EntityViewRepositoryHandler.idAttribute() method. |
Is the class for which it fails annotated with |
No. I am using Deltaspike's EntityRepository<E,PK> which does not require view class. I am passing Entity class and PK class. |
Hmm, that's odd. I'll look into this, but probably won't be able to finish this today |
I pushed something that should do it, but I wasn't able to do any further tests yet. Would be nice if you could let me know so I can take a deeper look tomorrow. |
Thanks for the immediate fix. findAll(1,10) works, but it is fetching more records than expected. It seems offset needs to be set to the query. |
Sorry for the issues, this one was an oversight. We mainly tested the entity view parts and apparently didn't notice that the entity related stuff was partly non-functional. I pushed the fix to the PR. When you are done testing/evaluating, I will do another release. |
@sharadborhade can you confirm it works as expected now? I'd like to do a release this week with all those fixes. |
Yeah you are right, I forgot to implement |
@beikov, any update on the null precedence issue? |
The PR #721 should fix the issue. I'm about to merge that now. Would be great if you could verify it works properly |
Still facing the same issue. NULLS LAST is appended to the sql query and sql query fails with below issue.
|
Found the issue, I forgot to enable the workaround/optimization. I tested it now and can confirm that tests which failed before, are now running fine. |
…ct of wrong type for count expression
findAll(start, max) method of the Repository fails with
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
for eclipselink embedded composite primary key. It works with hibernate 5.0.12.Final.I am referring deltaspike-data-rest example with tomcat web server and CDI injection.
Expected behavior
findAll(start,max) should return the
List<CompositeView>
Actual behavior
Steps to reproduce
Environment
Version: 1.3.1/1.3.0
JPA-Provider: Eclipselink 2.6.4, Deltaspike 1.8.1
DBMS: DB2 11 for z/OS, Driver: IBM Data Server Driver for JDBC and SQLJ Version: 4.21.29
Web Server: Tomcat, CDI
The text was updated successfully, but these errors were encountered: