public List findLicenseBuyedBy(final long buyerId) {
return findLicenseBuyedBy(buyerId, null);
}
public List findLicenseInGroup(final long grpId) {
HibernateTemplate t = new HibernateTemplate(getSessionFactory());
return (List)t.execute(
new HibernateCallback() {
public Object doInHibernate(Session s) throws HibernateException, SQLException {
return s.createCriteria(License.class)
.add(Expression.eq("group.id", new Long(grpId)))
.add(Expression.eq("enabled", Boolean.TRUE))