Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

Archive for November, 2011

How to add where clouse into xml.hbm mapping file

Posted by Pankil Patel on November 13, 2011

For many-to-one:

<many-to-one name=”rankTypeLookupData”
formula=”(SELECT l.LKP_ID FROM EQ_LOOKUP_DATA l WHERE l.DROPDOWN_CODE = ‘BV_STAFF_RANK_TYPE’ AND l.LKP_KEY = INDVL_RANK_TYPE)”
class=”com……LookupData” not-found=”ignore”>
<column name=”INDVL_RANK_TYPE” />
</many-to-one>

For one-to-many:

<set name=”regionList” table=”BV_REGION” cascade=”all” fetch=”join”
outer-join=”true” where=”DEL_IN = ‘N’” inverse=”true”>
<key column=”INDVL_RANK_ID” />
<one-to-many
class=”com……..StaffTeamRankRegion” />
</set>

Posted in Hibernate | Leave a Comment »

Issue with createCriteria result set, class name appended by _$$_javassist_

Posted by Pankil Patel on November 8, 2011

Issue:  _$$_javassist_ is appended after class name, when you are using createCriteria(xyz.class) which have <set> or <bag> (one-to-many) relationship with Object that having <composite-id> instead of <id>.

Resolution: Instead of Using createCriteria(xyz.class), use EntityName for Criteria Query.

Ex: DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(“xyzSearch”);

Impact of Issue:

  1. For java, if you are using any code which have  comparison with class name it will fail in that case.
  2. If you are using any communication by RMI like: Spring BlazeDS for Flex & Java, It will not able to cast the Object in proper format & will give result in generics Object format.

Posted in Hibernate | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.