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; }
public void normalizeComplexKey(final ComplexType complexType, final List<PropertyRef> propertyRefList) { for (Property property : complexType.getProperties()) { try { SimpleProperty simpleProperty = (SimpleProperty) property; Facets facets = (Facets) simpleProperty.getFacets(); if (facets == null) { simpleProperty.setFacets(new Facets().setNullable(false)); } else { facets.setNullable(false); } PropertyRef propertyRef = new PropertyRef(); propertyRef.setName(simpleProperty.getName()); propertyRefList.add(propertyRef); } catch (ClassCastException e) { ComplexProperty complexProperty = (ComplexProperty) property; normalizeComplexKey(complexTypeView.searchEdmComplexType(complexProperty.getType()), propertyRefList); } } } }
public void normalizeComplexKey(final ComplexType complexType, final List<PropertyRef> propertyRefList) { for (Property property : complexType.getProperties()) { try { SimpleProperty simpleProperty = (SimpleProperty) property; Facets facets = (Facets) simpleProperty.getFacets(); if (facets == null) { simpleProperty.setFacets(new Facets().setNullable(false)); } else { facets.setNullable(false); } PropertyRef propertyRef = new PropertyRef(); propertyRef.setName(simpleProperty.getName()); propertyRefList.add(propertyRef); } catch (ClassCastException e) { ComplexProperty complexProperty = (ComplexProperty) property; normalizeComplexKey(complexTypeView.searchEdmComplexType(complexProperty.getType()), propertyRefList); } } } }
@Override public void build() throws ODataJPAModelException { List<PropertyRef> propertyRefList = null; if (key == null) { key = new Key(); } if (key.getKeys() == null) { propertyRefList = new ArrayList<PropertyRef>(); key.setKeys(propertyRefList); } else { propertyRefList = key.getKeys(); } if (isBuildModeComplexType) { ComplexType complexType = complexTypeView.searchEdmComplexType(propertyView.getJPAAttribute().getJavaType().getName()); normalizeComplexKey(complexType, propertyRefList); } else { PropertyRef propertyRef = new PropertyRef(); propertyRef.setName(propertyView.getEdmSimpleProperty().getName()); Facets facets = (Facets) propertyView.getEdmSimpleProperty().getFacets(); if (facets == null) { propertyView.getEdmSimpleProperty().setFacets(new Facets().setNullable(false)); } else { facets.setNullable(false); } propertyRefList.add(propertyRef); } }
@Override public void build() throws ODataJPAModelException { List<PropertyRef> propertyRefList = null; if (key == null) { key = new Key(); } if (key.getKeys() == null) { propertyRefList = new ArrayList<PropertyRef>(); key.setKeys(propertyRefList); } else { propertyRefList = key.getKeys(); } if (isBuildModeComplexType) { ComplexType complexType = complexTypeView.searchEdmComplexType(propertyView.getJPAAttribute().getJavaType().getName()); normalizeComplexKey(complexType, propertyRefList); } else { PropertyRef propertyRef = new PropertyRef(); propertyRef.setName(propertyView.getEdmSimpleProperty().getName()); Facets facets = (Facets) propertyView.getEdmSimpleProperty().getFacets(); if (facets == null) { propertyView.getEdmSimpleProperty().setFacets(new Facets().setNullable(false)); } else { facets.setNullable(false); } propertyRefList.add(propertyRef); } }
EdmSimpleTypeKind edmTypeKind = edmProperty.getType(); Facets facets = new Facets(); edmProperty.setFacets(facets);
EdmSimpleTypeKind edmTypeKind = edmProperty.getType(); Facets facets = new Facets(); edmProperty.setFacets(facets);
newSimpleProperty.setCustomizableFeedMappings(oldSimpleProperty.getCustomizableFeedMappings()); newSimpleProperty.setDocumentation(oldSimpleProperty.getDocumentation()); newSimpleProperty.setFacets(oldSimpleProperty.getFacets()); newSimpleProperty.setMimeType(oldSimpleProperty.getMimeType()); newSimpleProperty.setName(oldSimpleProperty.getName());
newSimpleProperty.setCustomizableFeedMappings(oldSimpleProperty.getCustomizableFeedMappings()); newSimpleProperty.setDocumentation(oldSimpleProperty.getDocumentation()); newSimpleProperty.setFacets(oldSimpleProperty.getFacets()); newSimpleProperty.setMimeType(oldSimpleProperty.getMimeType()); newSimpleProperty.setName(oldSimpleProperty.getName());