final List<?> result = query.list();
if (result.size() > 0)
return null;
final Permission permission = new Permission(permissionName);
final Serializable entityId = session.save(permission);
return (Permission) session.get(Permission.class, entityId);
}