protected boolean embedChildrenInSimple(EntityDescriptor<?> ed) { switch (ed.getEntityKind()) { case DATA: return true; case SIMPLE: case COMPOSITE: default: return false; } }
protected boolean embedChildrenInComposite(EntityDescriptor<?> ed) { switch (ed.getEntityKind()) { case SIMPLE: for (FeatureDescriptor ced : ed.getEntityFeatureDescriptors()) if (!embedChildrenInSimple(ced.getEntityDescriptor())) return false; case DATA: return true; case COMPOSITE: default: return false; } }
public boolean embedChildren(EntityDescriptor<?> ed) { switch (ed.getEntityKind()) { case SIMPLE: for (FeatureDescriptor ced : ed.getEntityFeatureDescriptors()) if (!embedChildrenInSimple(ced.getEntityDescriptor())) return false; return true; case COMPOSITE: EntityDescriptor<?> ced = ed.getEntityDescriptor(0); return !ced.isPolymorphic() && embedChildrenInComposite(ced); case DATA: return true; default: return false; } }