boolean isEntity(Class<?> entity) {
return entity.isAnnotationPresent(Entity.class);
}
boolean hasPrimaryKey(Class<?> entity) {
final AnnotatedPropertyCriteria hasId = new AnnotatedPropertyCriteria(Id.class);
PropertyQuery<Serializable> query = PropertyQueries.<Serializable> createQuery(entity).addCriteria(hasId);
return query.getFirstResult() != null;
}