@Override public List<String> getKeyPropertyNames() throws EdmException { if (edmKeyPropertyNames == null) { if (edmBaseType != null) { return ((EdmEntityType) edmBaseType).getKeyPropertyNames(); } edmKeyPropertyNames = new ArrayList<String>(); if (entityType.getKey() != null) { for (final PropertyRef keyProperty : entityType.getKey().getKeys()) { edmKeyPropertyNames.add(keyProperty.getName()); } } else { // Entity Type does not define a key throw new EdmException(EdmException.COMMON); } } return edmKeyPropertyNames; }
@Override public List<String> getKeyPropertyNames() throws EdmException { if (edmKeyPropertyNames == null) { if (edmBaseType != null) { return ((EdmEntityType) edmBaseType).getKeyPropertyNames(); } edmKeyPropertyNames = new ArrayList<String>(); if (entityType.getKey() != null) { for (final PropertyRef keyProperty : entityType.getKey().getKeys()) { edmKeyPropertyNames.add(keyProperty.getName()); } } else { // Entity Type does not define a key throw new EdmException(EdmException.COMMON); } } return edmKeyPropertyNames; }
@Override public List<String> getKeyPropertyNames() throws EdmException { if (edmKeyPropertyNames == null) { if (edmBaseType != null) { return ((EdmEntityType) edmBaseType).getKeyPropertyNames(); } edmKeyPropertyNames = new ArrayList<String>(); if (entityType.getKey() != null) { for (final PropertyRef keyProperty : entityType.getKey().getKeys()) { edmKeyPropertyNames.add(keyProperty.getName()); } } else { // Entity Type does not define a key throw new EdmException(EdmException.COMMON); } } return edmKeyPropertyNames; }
@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); } }
Collection<PropertyRef> propertyRefs = entityType.getKey().getKeys(); for (PropertyRef propertyRef : propertyRefs) { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_PROPERTY_REF);
Collection<PropertyRef> propertyRefs = entityType.getKey().getKeys(); for (PropertyRef propertyRef : propertyRefs) { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_PROPERTY_REF);
Collection<PropertyRef> propertyRefs = entityType.getKey().getKeys(); for (PropertyRef propertyRef : propertyRefs) { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_PROPERTY_REF);