.firstInstanceOf(JpaAbstractEntity.class);
// process temporal type defaults
if (jpaBasic.getTemporal() == null && jpaBasic.getEnumerated() == null) {
JpaClassDescriptor descriptor = entity.getClassDescriptor();
JpaPropertyDescriptor property = descriptor.getProperty(jpaBasic
.getName());
// sanity check
if (property == null) {
throw new IllegalStateException("No class property found for name: "
+ jpaBasic.getName());
}
if (java.sql.Date.class.isAssignableFrom(property.getType())) {
jpaBasic.setTemporal(TemporalType.DATE);
}
else if (Time.class.isAssignableFrom(property.getType())) {
jpaBasic.setTemporal(TemporalType.TIME);
}
else if (Timestamp.class.isAssignableFrom(property.getType())) {
jpaBasic.setTemporal(TemporalType.TIMESTAMP);
}
else if (Date.class.isAssignableFrom(property.getType())) {
jpaBasic.setTemporal(TemporalType.TIMESTAMP);
}
else if (property.getType().isEnum()) {
jpaBasic.setEnumerated(EnumType.ORDINAL);
}
}
return true;