class JpaSecondaryTableVisitor extends NestedVisitor {
@Override
Object createObject(ProjectPath path) {
JpaSecondaryTable jpaTable = (JpaSecondaryTable) path.getObject();
ObjEntity parentCayenneEntity = (ObjEntity) targetPath.getObject();
DbEntity secondaryEntity = parentCayenneEntity.getDataMap().getDbEntity(
jpaTable.getName());
if (secondaryEntity == null) {
secondaryEntity = new DbEntity(jpaTable.getName());
parentCayenneEntity.getDataMap().addDbEntity(secondaryEntity);
}
secondaryEntity.setCatalog(jpaTable.getCatalog());
secondaryEntity.setSchema(jpaTable.getSchema());
// defer primary./secondary relationship creation till after parent entity's
// children are fully parsed...
return secondaryEntity;