Results 1 to 2 of 2
  1. #1
    stsivaraj is offline Member
    Join Date
    Nov 2010
    Posts
    15
    Rep Power
    0

    Default Problem to access CompositeUserType class properties in hql

    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

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,250
    Rep Power
    19

    Default Re: Problem to access CompositeUserType class properties in hql

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 0
    Last Post: 01-16-2012, 07:33 AM
  2. Reload .properties class
    By chinna in forum New To Java
    Replies: 6
    Last Post: 07-14-2011, 08:31 AM
  3. Replies: 0
    Last Post: 04-04-2010, 10:06 AM
  4. Replies: 0
    Last Post: 01-22-2010, 12:01 PM
  5. Unable to access velocity.properties file from jar file
    By mjwoodford in forum New To Java
    Replies: 0
    Last Post: 10-09-2009, 01:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •