This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Problem with Hibernate scalar queries with constructor expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem with Hibernate scalar queries with constructor expression" Watch "Problem with Hibernate scalar queries with constructor expression" New topic
Author

Problem with Hibernate scalar queries with constructor expression

Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

I am trying the query with JPA ( Hibernate 4.1.4)



If the constructor expression is removed, the query work file and return Object[],
With the constructor expression, gives the following error at the time of loading the application to the container. Both the c.name and c.phone are String type and the CustomerProfile have constructor for the agruments.



any hints to rectify the problem ?

Thanks



Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

The problem is with package name



The prefix is 'in' instead of 'com'. While parsing the query the 'in' is treated as reserved world. As the 'in'(India) prefix is required, is there is any way to escape the package name in queries.

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem with Hibernate scalar queries with constructor expression