Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

Archive for September, 2011

How to use sequence in ID tag of hbm.xml???

Posted by Pankil Patel on September 26, 2011

How to use sequence in ID tag of hbm.xml???

<id name=“id” type=“java.lang.Long” column=“ID”>

<generatorclass=“sequence”><paramname=“sequence”>XYZ_TAG_STAFF_SEQ</param></generator>

</id>

Posted in Hibernate | Leave a Comment »

How to call store procedure or package in Hibernate???

Posted by Pankil Patel on September 26, 2011

How to call store procedure or package in Hibernate???

Please find attachment for the solution: StoreProcCallWithHibernate

Posted in Hibernate | Leave a Comment »

How to use Entity Name, specified in hbm.xml in DetachedCriteria???

Posted by Pankil Patel on September 26, 2011

 How to use Entity Name, specified in hbm.xml in DetachedCriteria???

OR

How to use OR Restriction in Criteria Query???

DetachedCriteria criteria = DetachedCriteria.forEntityName(“staff_phase2″);

Criterion crit1 = Restrictions.ilike(“lastName”, searchText.trim(), MatchMode.START);

 Criterion crit2 = Restrictions.ilike(“firstName”,searchText.trim(), MatchMode.START);

Criterion staffSearchCriterion = Restrictions.or(crit1, crit2); 

criteria.add(staffSearchCriterion);

Please find hbm.xml file used for this post, for your refrence: entity-name

Posted in Hibernate | Leave a Comment »

Parent Child Join With Criteria & DetachedCriteria using HibernateCallback

Posted by Pankil Patel on September 26, 2011

How to join parent table to child table using Criteria Query???

Please find attachment for solution:

ParentChildWithCriteriaJoin

 

Posted in Hibernate | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.