• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JPA CrietrialQuery to create dynamic list from selected values

 
Jay Tai
Ranch Hand
Posts: 221
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using JSF 2.2 and the EclipseLink JPA API in Netbeans 8. I want to create a page which gives the user options to select some rates from a list of specific clients. The error I'm getting is:




So I'm confused about why the get("fk_hour_companyid") would need to be converted to an Integer in the first since this variable is already declared as an int in the HourRate domain class. Why does this need to be converted to an Integer and why is it unable to be converted to an Integer.

Please let me know if I need to provide and further information and thank you in advance for any help.
[/code]


I'm using the following generic DAO class:


The jsf page which prompts the client selection:




The managed bean:



The stack trace:

 
Jay Tai
Ranch Hand
Posts: 221
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved if anyone's interested. Solution is basically to pass the integer as an argument in the list method in the generic dao class and to rewrite the method without declaring the integer as a parameter variable:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic