public EntityType buildEntityType() { EntityType entityType = new EntityType(); if (baseEntityType != null) { entityType.setBaseType(baseEntityType); } if (!keyProperties.isEmpty()) { entityType.setKey(new Key().setKeys(keyProperties)); } if (!navProperties.isEmpty()) { entityType.setNavigationProperties(navProperties); } return entityType.setName(name) .setAbstract(isAbstract) .setHasStream(isMediaResource) .setProperties(properties) .setMapping(new Mapping().setMediaResourceMimeTypeKey(mediaResourceMimeTypeKey) .setMediaResourceSourceKey(mediaResourceSourceKey)); }
public EntityType buildEntityType() { EntityType entityType = new EntityType(); if (baseEntityType != null) { entityType.setBaseType(baseEntityType); } if (!keyProperties.isEmpty()) { entityType.setKey(new Key().setKeys(keyProperties)); } if (!navProperties.isEmpty()) { entityType.setNavigationProperties(navProperties); } return entityType.setName(name) .setAbstract(isAbstract) .setHasStream(isMediaResource) .setProperties(properties) .setMapping(new Mapping().setMediaResourceMimeTypeKey(mediaResourceMimeTypeKey) .setMediaResourceSourceKey(mediaResourceSourceKey)); }
public static void build(final JPAEdmEntityTypeView view) { EntityType edmEntityType = view.getEdmEntityType(); String jpaEntityName = view.getJPAEntityType().getName(); JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess(); String edmEntityTypeName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { edmEntityTypeName = mappingModelAccess.mapJPAEntityType(jpaEntityName); } JPAEdmMapping mapping = new JPAEdmMappingImpl(); mapping.setJPAType(view.getJPAEntityType().getJavaType()); if (edmEntityTypeName == null) { edmEntityTypeName = jpaEntityName; } // Setting the mapping object edmEntityType.setMapping(((Mapping) mapping).setInternalName(jpaEntityName)); edmEntityType.setName(edmEntityTypeName); }
public static void build(final JPAEdmEntityTypeView view) { EntityType edmEntityType = view.getEdmEntityType(); String jpaEntityName = view.getJPAEntityType().getName(); JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess(); String edmEntityTypeName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { edmEntityTypeName = mappingModelAccess.mapJPAEntityType(jpaEntityName); } JPAEdmMapping mapping = new JPAEdmMappingImpl(); mapping.setJPAType(view.getJPAEntityType().getJavaType()); if (edmEntityTypeName == null) { edmEntityTypeName = jpaEntityName; } // Setting the mapping object edmEntityType.setMapping(((Mapping) mapping).setInternalName(jpaEntityName)); edmEntityType.setName(edmEntityTypeName); }
private EntityType clone(EntityType type) { if (type == null) { return null; } EntityType newType = new EntityType(); newType.setAbstract(type.isAbstract()); newType.setAnnotationAttributes(type.getAnnotationAttributes()); newType.setAnnotationElements(type.getAnnotationElements()); newType.setBaseType(type.getBaseType()); newType.setCustomizableFeedMappings(type.getCustomizableFeedMappings()); newType.setDocumentation(type.getDocumentation()); newType.setHasStream(type.isHasStream()); newType.setKey(type.getKey()); newType.setMapping(type.getMapping()); newType.setName(type.getName()); newType.setNavigationProperties(cloneNavigationProperties(type .getNavigationProperties())); newType.setProperties(cloneProperties(type.getProperties())); return newType; }