class JpaEmbeddedVisitor extends NestedVisitor {
@Override
Object createObject(ProjectPath path) {
JpaEmbedded jpaEmbedded = (JpaEmbedded) path.getObject();
ObjEntity entity = (ObjEntity) targetPath.getObject();
EmbeddedAttribute embedded = new EmbeddedAttribute(jpaEmbedded.getName());
embedded.setType(jpaEmbedded.getPropertyDescriptor().getType().getName());
for (JpaAttributeOverride override : jpaEmbedded.getAttributeOverrides()) {
embedded.addAttributeOverride(override.getName(), override
.getColumn()
.getName());
}
entity.addAttribute(embedded);
// for each embedded attribute, add all Embeddable attributes to DbEntity,
// honoring @Column settings
JpaEmbeddable jpaEmbeddable = path
.firstInstanceOf(JpaEntityMap.class)
.embeddableForClass(jpaEmbedded.getPropertyDescriptor().getType());
for (JpaBasic jpaBasic : jpaEmbeddable.getAttributes().getBasicAttributes()) {
JpaColumn column = jpaBasic.getColumn();
String tableName = column.getTable() != null ? column.getTable() : entity