class VersionVisitor extends BasicVisitor {
@Override
public boolean onStartNode(ProjectPath path) {
JpaVersion jpaBasic = (JpaVersion) path.getObject();
if (jpaBasic.getColumn() == null) {
JpaColumn column = new JpaColumn(AnnotationPrototypes.getColumn());
column.setName(jpaBasic.getName());
jpaBasic.setColumn(column);
}
if (jpaBasic.getTemporal() == null) {
JpaEntity entity = (JpaEntity) path.firstInstanceOf(JpaEntity.class);
JpaClassDescriptor descriptor = entity.getClassDescriptor();
JpaPropertyDescriptor property = descriptor.getProperty(jpaBasic
.getName());
if (Date.class.equals(property.getType())) {
jpaBasic.setTemporal(TemporalType.TIMESTAMP);
}
}
return true;
}