private Property readSimpleProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { SimpleProperty property = new SimpleProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(EdmSimpleTypeKind.valueOf(fqName.getName())); return property; }
private Property readSimpleProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { SimpleProperty property = new SimpleProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(EdmSimpleTypeKind.valueOf(fqName.getName())); return property; }
private Property readSimpleProperty(final XMLStreamReader reader, final FullQualifiedName fqName) throws XMLStreamException { SimpleProperty property = new SimpleProperty(); property.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME)); property.setType(EdmSimpleTypeKind.valueOf(fqName.getName())); return property; }
private Property createSimpleProperty(final EdmProperty ep, final Field field) { SimpleProperty sp = new SimpleProperty(); String entityName = ANNOTATION_HELPER.getPropertyName(field); sp.setName(entityName); // EdmType type = ep.type(); if (type == EdmType.NULL) { type = getEdmType(field.getType()); } sp.setType(ANNOTATION_HELPER.mapTypeKind(type)); return sp; }
private Property createSimpleProperty(final EdmProperty ep, final Field field) { SimpleProperty sp = new SimpleProperty(); String entityName = ANNOTATION_HELPER.getPropertyName(field); sp.setName(entityName); // EdmType type = ep.type(); if (type == EdmType.NULL) { type = getEdmType(field.getType()); } sp.setType(ANNOTATION_HELPER.mapTypeKind(type)); sp.setFacets(createFacets(ep.facets(), field.getAnnotation(EdmConcurrencyControl.class))); return sp; }
private Property createSimpleProperty(final EdmProperty ep, final Field field) { SimpleProperty sp = new SimpleProperty(); String entityName = ANNOTATION_HELPER.getPropertyName(field); sp.setName(entityName); // EdmType type = ep.type(); if (type == EdmType.NULL) { type = getEdmType(field.getType()); } sp.setType(ANNOTATION_HELPER.mapTypeKind(type)); sp.setFacets(createFacets(ep.facets(), field.getAnnotation(EdmConcurrencyControl.class))); return sp; }
private SimpleProperty buildSimpleProperty(final Attribute<?, ?> jpaAttribute, final SimpleProperty simpleProperty, final JoinColumn joinColumn) throws ODataJPAModelException, ODataJPARuntimeException { boolean isForeignKey = joinColumn != null; JPAEdmNameBuilder.build(JPAEdmProperty.this, isBuildModeComplexType, skipDefaultNaming, isForeignKey); EdmSimpleTypeKind simpleTypeKind = JPATypeConverter .convertToEdmSimpleType(jpaAttribute .getJavaType(), jpaAttribute); simpleProperty.setType(simpleTypeKind); Facets facets = JPAEdmFacets.createAndSet(jpaAttribute, simpleProperty); if(isForeignKey) { facets.setNullable(joinColumn.nullable()); } int total = 0; String name = simpleProperty.getName(); for (Property property: properties) { if (property.getName().equals(name)) { total++; name = simpleProperty.getName() + "_"+ total; } } if (total > 0) { simpleProperty.setName(name); } return simpleProperty; }
view.getEdmSimpleProperty().setName(propertyName);
view.getEdmSimpleProperty().setName(propertyName);
newSimpleProperty.setFacets(oldSimpleProperty.getFacets()); newSimpleProperty.setMimeType(oldSimpleProperty.getMimeType()); newSimpleProperty.setName(oldSimpleProperty.getName()); newSimpleProperty.setType(oldSimpleProperty.getType()); JPAEdmMappingImpl newMapping = new JPAEdmMappingImpl();
newSimpleProperty.setFacets(oldSimpleProperty.getFacets()); newSimpleProperty.setMimeType(oldSimpleProperty.getMimeType()); newSimpleProperty.setName(oldSimpleProperty.getName()); newSimpleProperty.setType(oldSimpleProperty.getType()); JPAEdmMappingImpl newMapping = new JPAEdmMappingImpl();