Skip to content

Commit

Permalink
#403 Add date/time handling to HibernateDomainExporter
Browse files Browse the repository at this point in the history
  • Loading branch information
timowest committed May 10, 2013
1 parent 34f09f9 commit 831fa07
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -365,6 +365,20 @@ private void handleProperty(EntityType entityType, Class<?> cl, org.hibernate.ma
// ignore
}
Type propertyType = getType(cl, clazz, p.getName());
switch (propertyType.getCategory()) {
case DATE:
case TIME:
case DATETIME:
String type = p.getType().getName();
if ("time".equals(type)) {
propertyType = propertyType.as(TypeCategory.TIME);
} else if ("date".equals(type)) {
propertyType = propertyType.as(TypeCategory.DATE);
} else if ("timestamp".equals(type)) {
propertyType = propertyType.as(TypeCategory.DATETIME);
}
}

if (p.isComposite()) {
EntityType embeddedType = createEmbeddableType(propertyType);
Iterator<?> properties = ((Component)p.getValue()).getPropertyIterator();
Expand Down

0 comments on commit 831fa07

Please sign in to comment.