private Property readComplexProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { ComplexProperty property = new ComplexProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(fqName); return property; }
public EdmComplexPropertyImplProv(final EdmImplProv edm, final ComplexProperty property) throws EdmException { super(edm, property.getType(), property); this.property = property; }
private Property createComplexProperty(EdmProperty ep, final Field field) { ComplexProperty cp = new ComplexProperty(); // settings from property String entityName = ANNOTATION_HELPER.getPropertyName(field); cp.setName(entityName); // settings from related complex entity FullQualifiedName fqn = ANNOTATION_HELPER.extractComplexTypeFqn(field.getType()); cp.setType(fqn); cp.setFacets(createFacets(ep.facets(), field.getAnnotation(EdmConcurrencyControl.class))); return cp; }
private Property clone(Property property) { if (property == null) { return null; } Property newAbstractProperty; if (property instanceof ComplexProperty) { ComplexProperty newProperty = new ComplexProperty(); newProperty.setType(((ComplexProperty) property).getType()); newAbstractProperty = newProperty; } else { SimpleProperty newProperty = new SimpleProperty(); newProperty.setType(((SimpleProperty) property).getType()); newAbstractProperty = newProperty; } newAbstractProperty.setAnnotationAttributes(property .getAnnotationAttributes()); newAbstractProperty.setAnnotationElements(property .getAnnotationElements()); newAbstractProperty.setCustomizableFeedMappings(property .getCustomizableFeedMappings()); newAbstractProperty.setDocumentation(property.getDocumentation()); newAbstractProperty.setFacets(property.getFacets()); newAbstractProperty.setMapping(property.getMapping()); newAbstractProperty.setMimeType(property.getMimeType()); newAbstractProperty.setName(property.getName()); return newAbstractProperty; }
private void includeComplexType(Schema targetSchema, IServiceInfo service, ComplexType sourceType) throws ODataException { List<ComplexType> types = targetSchema.getComplexTypes(); if (types != null) { for (ComplexType type : types) { if (type.getName().equals(sourceType.getName())) { throw new ODataException("complex type " + sourceType.getName() + " already defined"); } } } else { types = new ArrayList<ComplexType>(); } ComplexType newType = clone(sourceType); if (newType.getProperties() != null) { for (Property property : newType.getProperties()) { if (property instanceof ComplexProperty) { ((ComplexProperty) property).setType(new FullQualifiedName( targetSchema.getNamespace(), ((ComplexProperty) property).getType().getName())); } } } types.add(newType); targetSchema.setComplexTypes(types); }
public static void build(final JPAEdmComplexPropertyView complexView, final String parentComplexTypeName, final boolean skipDefaultNaming) { ComplexProperty complexProperty = complexView.getEdmComplexProperty(); JPAEdmMappingModelAccess mappingModelAccess = complexView.getJPAEdmMappingModelAccess(); JPAEdmPropertyView propertyView = ((JPAEdmPropertyView) complexView); String jpaAttributeName = propertyView.getJPAAttribute().getName(); String propertyName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { propertyName = mappingModelAccess.mapJPAEmbeddableTypeAttribute(parentComplexTypeName, jpaAttributeName); } if (skipDefaultNaming == false && propertyName == null) { propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1); } else if (propertyName == null) { propertyName = jpaAttributeName; } JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(jpaAttributeName); mapping.setJPAType(propertyView.getJPAAttribute().getJavaType()); complexProperty.setMapping((Mapping) mapping); complexProperty.setName(propertyName); }
} catch (ClassCastException e) { ComplexProperty complexProperty = (ComplexProperty) property; String name = embeddablePropertyName + "." + complexProperty.getMapping().getInternalName(); expandEdmComplexType(searchComplexTypeByName(complexProperty.getName()), expandedList, name);
complexTypeView.expandEdmComplexType(complexType, properties, currentAttribute.getName()); } else { currentComplexProperty = new ComplexProperty(); if (isBuildModeComplexType) { JPAEdmNameBuilder.build((JPAEdmComplexPropertyView) JPAEdmProperty.this, .setType(new FullQualifiedName(schemaView.getEdmSchema().getNamespace(), complexType.getName())); if (!complexTypeView.isReferencedInKey(currentComplexProperty.getType().getName())) { complexTypeView.setReferencedInKey(currentComplexProperty.getType().getName());
public static void build(final JPAEdmComplexPropertyView complexView, final String parentComplexTypeName, final boolean skipDefaultNaming) { ComplexProperty complexProperty = complexView.getEdmComplexProperty(); JPAEdmMappingModelAccess mappingModelAccess = complexView.getJPAEdmMappingModelAccess(); JPAEdmPropertyView propertyView = ((JPAEdmPropertyView) complexView); String jpaAttributeName = propertyView.getJPAAttribute().getName(); String propertyName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { propertyName = mappingModelAccess.mapJPAEmbeddableTypeAttribute(parentComplexTypeName, jpaAttributeName); } if (skipDefaultNaming == false && propertyName == null) { propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1); } else if (propertyName == null) { propertyName = jpaAttributeName; } JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(jpaAttributeName); mapping.setJPAType(propertyView.getJPAAttribute().getJavaType()); complexProperty.setMapping((Mapping) mapping); complexProperty.setName(propertyName); }
} catch (ClassCastException e) { ComplexProperty complexProperty = (ComplexProperty) property; String name = embeddablePropertyName + "." + complexProperty.getMapping().getInternalName(); expandEdmComplexType(searchComplexTypeByName(complexProperty.getName()), expandedList, name);
private Property readComplexProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { ComplexProperty property = new ComplexProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(fqName); return property; }
complexTypeView.expandEdmComplexType(complexType, properties, currentAttribute.getName()); } else { currentComplexProperty = new ComplexProperty(); if (isBuildModeComplexType) { JPAEdmNameBuilder.build((JPAEdmComplexPropertyView) JPAEdmProperty.this, .setType(new FullQualifiedName(schemaView.getEdmSchema().getNamespace(), complexType.getName())); if (!complexTypeView.isReferencedInKey(currentComplexProperty.getType().getName())) { complexTypeView.setReferencedInKey(currentComplexProperty.getType().getName());
public EdmComplexPropertyImplProv(final EdmImplProv edm, final ComplexProperty property) throws EdmException { super(edm, property.getType(), property); this.property = property; }
public static void build(final JPAEdmComplexPropertyView complexView, final JPAEdmPropertyView propertyView, final boolean skipDefaultNaming) { ComplexProperty complexProperty = complexView.getEdmComplexProperty(); String jpaAttributeName = propertyView.getJPAAttribute().getName(); String jpaEntityTypeName = propertyView.getJPAEdmEntityTypeView().getJPAEntityType().getName(); JPAEdmMappingModelAccess mappingModelAccess = complexView.getJPAEdmMappingModelAccess(); String propertyName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { propertyName = mappingModelAccess.mapJPAAttribute(jpaEntityTypeName, jpaAttributeName); } if (skipDefaultNaming == false && propertyName == null) { propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1); } else if (propertyName == null) { propertyName = jpaAttributeName; } // change for navigation property issue JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(jpaAttributeName); mapping.setJPAType(propertyView.getJPAAttribute().getJavaType()); complexProperty.setMapping((Mapping) mapping); complexProperty.setName(propertyName); }
private Property readComplexProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { ComplexProperty property = new ComplexProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(fqName); return property; }
public EdmComplexPropertyImplProv(final EdmImplProv edm, final ComplexProperty property) throws EdmException { super(edm, property.getType(), property); this.property = property; }
public static void build(final JPAEdmComplexPropertyView complexView, final JPAEdmPropertyView propertyView, final boolean skipDefaultNaming) { ComplexProperty complexProperty = complexView.getEdmComplexProperty(); String jpaAttributeName = propertyView.getJPAAttribute().getName(); String jpaEntityTypeName = propertyView.getJPAEdmEntityTypeView().getJPAEntityType().getName(); JPAEdmMappingModelAccess mappingModelAccess = complexView.getJPAEdmMappingModelAccess(); String propertyName = null; if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) { propertyName = mappingModelAccess.mapJPAAttribute(jpaEntityTypeName, jpaAttributeName); } if (skipDefaultNaming == false && propertyName == null) { propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1); } else if (propertyName == null) { propertyName = jpaAttributeName; } // change for navigation property issue JPAEdmMapping mapping = new JPAEdmMappingImpl(); ((Mapping) mapping).setInternalName(jpaAttributeName); mapping.setJPAType(propertyView.getJPAAttribute().getJavaType()); complexProperty.setMapping((Mapping) mapping); complexProperty.setName(propertyName); }
private Property createComplexProperty(final Field field) { ComplexProperty cp = new ComplexProperty(); // settings from property String entityName = ANNOTATION_HELPER.getPropertyName(field); cp.setName(entityName); // settings from related complex entity FullQualifiedName fqn = ANNOTATION_HELPER.extractComplexTypeFqn(field.getType()); cp.setType(fqn); return cp; }