private static boolean hasConcurrencyControl(final EdmEntityType entityType) throws EdmException { boolean concurrency = false; for (final String propertyName : entityType.getPropertyNames()) { final EdmFacets facets = ((EdmProperty) entityType.getProperty(propertyName)).getFacets(); if (facets != null && facets.getConcurrencyMode() != null && facets.getConcurrencyMode() == EdmConcurrencyMode.Fixed) { concurrency = true; break; } } return concurrency; }
private static boolean hasConcurrencyControl(final EdmEntityType entityType) throws EdmException { boolean concurrency = false; for (final String propertyName : entityType.getPropertyNames()) { final EdmFacets facets = ((EdmProperty) entityType.getProperty(propertyName)).getFacets(); if (facets != null && facets.getConcurrencyMode() != null && facets.getConcurrencyMode() == EdmConcurrencyMode.Fixed) { concurrency = true; break; } } return concurrency; }
private static boolean hasConcurrencyControl(final EdmEntityType entityType) throws EdmException { boolean concurrency = false; for (final String propertyName : entityType.getPropertyNames()) { final EdmFacets facets = ((EdmProperty) entityType.getProperty(propertyName)).getFacets(); if (facets != null && facets.getConcurrencyMode() != null && facets.getConcurrencyMode() == EdmConcurrencyMode.Fixed) { concurrency = true; break; } } return concurrency; }
private void checkETagRelevant(final EdmProperty edmProperty) throws EntityProviderException { try { if (edmProperty.getFacets() != null && edmProperty.getFacets().getConcurrencyMode() == EdmConcurrencyMode.Fixed) { etagPropertyNames.add(edmProperty.getName()); } } catch (EdmException e) { throw new EntityProviderException(EntityProviderException.COMMON, e); } }
private void checkETagRelevant(final EdmProperty edmProperty) throws EntityProviderException { try { if (edmProperty.getFacets() != null && edmProperty.getFacets().getConcurrencyMode() == EdmConcurrencyMode.Fixed) { etagPropertyNames.add(edmProperty.getName()); } } catch (EdmException e) { throw new EntityProviderException(EntityProviderException.COMMON, e); } }
private void checkETagRelevant(final EdmProperty edmProperty) throws EntityProviderException { try { if (edmProperty.getFacets() != null && edmProperty.getFacets().getConcurrencyMode() == EdmConcurrencyMode.Fixed) { etagPropertyNames.add(edmProperty.getName()); } } catch (EdmException e) { throw new EntityProviderException(EntityProviderException.COMMON, e); } }
xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_PROPERTY_COLLATION, facets.getCollation()); if (facets.getConcurrencyMode() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_PROPERTY_CONCURRENCY_MODE, facets.getConcurrencyMode() .toString());
xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_PROPERTY_COLLATION, facets.getCollation()); if (facets.getConcurrencyMode() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_PROPERTY_CONCURRENCY_MODE, facets.getConcurrencyMode() .toString());
xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_PROPERTY_COLLATION, facets.getCollation()); if (facets.getConcurrencyMode() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_PROPERTY_CONCURRENCY_MODE, facets.getConcurrencyMode() .toString());
private String getEtagPropertyName(UriInfo uriInfo) throws EdmException { String etagPropName = ""; EdmEntityType originEntityType = uriInfo.getTargetEntitySet().getEntityType(); List<String> propertyNames = originEntityType.getPropertyNames(); for (String name : propertyNames) { EdmTyped edmTyped = originEntityType.getProperty(name); EdmTypeKind typeKind = edmTyped.getType().getKind(); if (EdmTypeKind.SIMPLE.equals(typeKind)) { EdmProperty edmProperty = (EdmProperty) edmTyped; EdmFacets facet = edmProperty.getFacets(); if(null != facet && null != facet.getConcurrencyMode() && facet.getConcurrencyMode() == EdmConcurrencyMode.Fixed ) { etagPropName = getTechnicalName(edmTyped);; break; } } } return etagPropName; } private String getTechnicalName(Object edmMappable)
private <T> String constructETag(final EdmEntitySet entitySet, final T data) throws ODataException { final EdmEntityType entityType = entitySet.getEntityType(); String eTag = null; for (final String propertyName : entityType.getPropertyNames()) { final EdmProperty property = (EdmProperty) entityType.getProperty(propertyName); if (property.getFacets() != null && property.getFacets().getConcurrencyMode() == EdmConcurrencyMode.Fixed) { final EdmSimpleType type = (EdmSimpleType) property.getType(); final String component = type.valueToString(valueAccess.getPropertyValue(data, property), EdmLiteralKind.DEFAULT, property.getFacets()); eTag = eTag == null ? component : eTag + Edm.DELIMITER + component; } } return eTag == null ? null : "W/\"" + eTag + "\""; }
private <T> String constructETag(final EdmEntitySet entitySet, final T data) throws ODataException { final EdmEntityType entityType = entitySet.getEntityType(); String eTag = null; for (final String propertyName : entityType.getPropertyNames()) { final EdmProperty property = (EdmProperty) entityType.getProperty(propertyName); if (property.getFacets() != null && property.getFacets().getConcurrencyMode() == EdmConcurrencyMode.Fixed) { final EdmSimpleType type = (EdmSimpleType) property.getType(); final String component = type.valueToString(valueAccess.getPropertyValue(data, property), EdmLiteralKind.DEFAULT, property.getFacets()); eTag = eTag == null ? component : eTag + Edm.DELIMITER + component; } } return eTag == null ? null : "W/\"" + eTag + "\""; }
private <T> String constructETag(final EdmEntitySet entitySet, final T data) throws ODataException { final EdmEntityType entityType = entitySet.getEntityType(); String eTag = null; for (final String propertyName : entityType.getPropertyNames()) { final EdmProperty property = (EdmProperty) entityType.getProperty(propertyName); if (property.getFacets() != null && property.getFacets().getConcurrencyMode() == EdmConcurrencyMode.Fixed) { final EdmSimpleType type = (EdmSimpleType) property.getType(); final String component = type.valueToString(valueAccess.getPropertyValue(data, property), EdmLiteralKind.DEFAULT, property.getFacets()); eTag = eTag == null ? component : eTag + Edm.DELIMITER + component; } } return eTag == null ? null : "W/\"" + eTag + "\""; }