java - JPQl having error in query -


query query=entitymanager.createquery("select e studentqualification e e.student=:id"); @id     @generatedvalue(strategy=generationtype.identity)     @column(name="id")     private integer id;     @manytoone     @joincolumn(name="student_id")     private student student;     @manytoone     @joincolumn(name="qualification_type")     private qualificationtype qualificationtype;     @column(name="obtain_marks")     private integer obtainmarks;     @column(name="total_marks")     private integer totalmarks;     @column(name="institute")     private string institute;     @column(name="year_of_completion") 

error on query excution: parameter value [1] did not match expected type [com.autosoft.fortune.model.student (n/a)] query above , after class attribute should do

i doing this"query.setparameter("id", studentid);" in next line of code

see sql :

 select e studentqualification e e.student=:id"                                             ^^^^^^^^^ 

e.student of type student private student student; , not simple integer.

so supply student object id populated query instead of id.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -