• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Query Error

 
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a query I defined in a mapping file:

<query name="com.abc.db.member.membersById">
<![CDATA[
from com.abc.db.member.MemberDTO as member
where upper(member.id) = upper(:id)
]]>
</query>

I got following exception when I try to create SessionFactory

org.hibernate.HibernateException: Errors in named queries: com.abc.db.member.membersById
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:289)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)


If I change the alias �member� in the query to a different name, e.g. member0 or mbr, everything works fine. Have anyone had a similar experience before? Is this a bug? Is �member� a reserved name?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic