Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem to access CompositeUserType class properties in hql  RSS feed

stshiva raaj
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to apply query for CompositeUserType pojo using hibernate hql. The custom type nothing but xml data. I converted from xml to java bean object.
It is not working when i apply query opposite to CompositeUserType's pojo i am getting error.
public class UserEvent implements CompositeUserType {

<class name="com.eventstream.hbm.ViewUserEvents" table="VIEW_USER_EVENTS" mutable="false">
<property name="eventDate" type="java.sql.Timestamp">
<column name="EVENT_DATE" length="0" />
<property name="userEventForm" type="com.eventstream.hbm.UserEvent">
<column name="EVENT_DATA" />

Note: I am accessing who from the CustomType pojo
Query eventQry = session
.createQuery("select event.userEventForm.who from ViewUserEvents as event where event.eventId=81");"" + eventQry.list());
org.hibernate.QueryException: could not resolve property: userEventForm.who of: com.eventstream.hbm.ViewUserEvents

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!