• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem to access CompositeUserType class properties in hql

 
stshiva raaj
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
Code,
-------
Pojo
====
public class UserEvent implements CompositeUserType {

}
hbm:
=====
<hibernate-mapping>
<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>
<property name="userEventForm" type="com.eventstream.hbm.UserEvent">
<column name="EVENT_DATA" />
</property>
</class>
</hibernate-mapping>

DAO
=====
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");
logger.info("" + eventQry.list());
Exception:
=========
org.hibernate.QueryException: could not resolve property: userEventForm.who of: com.eventstream.hbm.ViewUserEvents


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic