Hi, Can I create an alias for the root entity for criteria and use it query. I am trying to achieve like following query:
select distinct(rp.roleId) from rolepermission rp, rolepermission rp1 where rp.roleId=? and (rp.permissionId=rp1.permissionId and rp.moduleId = rp1.moduleId);
session.createCriteria(RolePermissionsEntity.class,"rp").createAlias("RolePermissionsEntity","rp1").add(Restrictions.neProperty("rp1.resourceId","rp.resourceId")).add(Restrictions.neProperty("rp1.permissionId","rp.permissionId")).add(Restrictions.eq("rp1.roleId",200));
|