This is probably very common issue with Myeclipse for Spring 2014 generated code modification. I had generated set of Scaffolding CRUD simple application. for normal list and view and edit, it is fine. but when I went to next step to put some logic between the generated code, seems not really working well.
I am trying build a contract class have some information from customer and some from storage unit and some from code table. I have a HQL statement as:
select concat(s.unit_title,s.unit_id), concat(l.price_week,’/week’) from storageUnits s inner join ListPrice l on s.unit_title=l.unit_title where s.unit_status=’Available’
in my createQuery statement to return a set of available unit list to generate a drop down list let customer to pick. I did the function in service layer and implement it in serviceImpl class, and then inject it to Controller class. when I trigger it from UI, the error message pop up shows as:
Request processing failed; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: storageUnits is not mapped [select concat(s.unit_title,s.unit_id), concat(l.price_week,’/week’) from storageUnits s inner join ListPrice l where s.unit_title=l.unit_title and s.unit_status=’Available’]
seam hibernate is looking for a hibernate.nbm.xml for execute such HQL? I tried to generate some map config from reverse engineering, seem it is not same with eclipse.
Any better way to execute SQL instead of HQL in myeclips spring MVC?