@Override
public boolean onStartNode(ProjectPath path) {
JpaColumn column = (JpaColumn) path.getObject();
JpaAttribute parent = path.firstInstanceOf(JpaAttribute.class);
if (column.getName() == null) {
column.setName(parent.getName());
}
if (column.getTable() == null) {
JpaEntity entity = path.firstInstanceOf(JpaEntity.class);
// parent can be a mapped superclass
if (entity != null) {
column.setTable(entity.lookupTable().getName());
}
}
if (parent.getPropertyDescriptor().isStringType()) {
if (column.getLength() <= 0) {
column.setLength(JpaColumn.DEFAULT_LENGTH);
}
}
else {