Posts Tagged ‘hibernate’

The only way I could figure out to get the distinct list using Hibernate Criteria is by using ResultTransformer function. eg. List result = session.createCriteria(Order.class)         .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)         ——-         .list(); The con is it fetches all the objects and then filters it. (very time consuming) The only way to circumvent this problem is to write query using […]

Apr 3rd, 2008 | Filed under hibernate, java

If you use Hibernate in a managed environment (with JBoss or some other AS that Hibernate supoorts). Add this line to session-factory section: <property name=”hibernate.current_session_context_class” >jta </property> If you use Hibernate in a non-managed environment (standalone application with JDBC). Add this line: <property name=”hibernate.current_session_context_class” >thread </property>

Mar 12th, 2006 | Filed under hibernate, java