google Analytics

Friday, July 23, 2010

Hibernate Named Query Example

hibernate-mapping
query name="smc.Product.findProductTypeByName">from Producttype type where type.name=? order by type.name ASCSELECT t.value FROM TEXT t, POSTPAIDOPTIONGROUP g where t.textualdescription=g.name AND t.language = 0 AND t.media = 0 AND t.client = 0 AND t.touchpoint = 0 AND t.role = 0 order by t.value ASC sql-query


--Code Snippet
Query queryObject = null;
queryObject = getDBSession().getNamedQuery("Product.findProductTypeByName");
queryObject.setParameter(0, name);
List productTypeList = queryObject.list();




--code Sbippet
List groupName=getDBSession(userdto).getNamedQuery("Product.getGroupName").list();

No comments:

Post a Comment