* @param role object to build the criteria
* @return the Criteria
*/
public static Criteria buildCriteria(Role role)
{
Criteria criteria = new Criteria();
if (!((BaseObject) role).isNew())
{
criteria.add(ROLE_ID, ((BaseObject) role).getPrimaryKey());
}
criteria.add(NAME, role.getName());
// causing the removal and updating of roles to
// crap out because of the generated SQL.
//criteria.add(OBJECTDATA, role.getAttributes());
return criteria;
}