private String getFromEntityName(final EdmNavigationProperty navigationProperty) throws EdmException { String fromRole = navigationProperty.getFromRole(); EdmEntityType fromEntityType = navigationProperty.getRelationship().getEnd(fromRole).getEntityType(); EdmMapping mapping = fromEntityType.getMapping(); String entityName = null; if (mapping != null) { entityName = mapping.getInternalName(); } else { entityName = fromEntityType.getName(); } return entityName; }
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; }
@Override public ElementType getElementType(String elementName) { try { if(entityType.getProperty(elementName).getType().getKind().equals(EdmTypeKind.COMPLEX)) return ElementType.STRUCTURED_TYPE; } catch (EdmException e) { return null; } return ElementType.SIMPLE_TYPE; }
public static String getUUIDkeyPropertyName(EdmEntitySet entSet) throws EdmException { String refKeyName = null; EdmEntityType entType = entSet.getEntityType(); for(EdmProperty refs:entType.getKeyProperties()) { if(refs.getType().getName().equalsIgnoreCase("Guid")) { refKeyName = refs.getName(); break; } } return refKeyName; }
private EdmEntityType getTargetEntityTypeFromNavigationProperty(EdmEntityType entityType, String navigationProperty) throws EdmException { EdmNavigationProperty navProp = (EdmNavigationProperty) entityType.getProperty(navigationProperty); String toRole = navProp.getToRole(); return (EdmEntityType) navProp.getRelationship().getEnd(toRole).getEntityType(); }
private Object convertArgument(final EdmLiteral edmLiteral, final EdmFacets facets, final Class<?> targetType) throws EdmSimpleTypeException { Object value = null; if (edmLiteral != null) { EdmSimpleType edmType = edmLiteral.getType(); value = edmType.valueOfString(edmLiteral.getLiteral(), EdmLiteralKind.DEFAULT, facets, targetType); } return value; }
private String getRelationShipName(final EdmNavigationProperty navigationProperty) throws EdmException { EdmMapping mapping = navigationProperty.getMapping(); String relationShipName = null; if (mapping != null) { relationShipName = mapping.getInternalName(); } else { relationShipName = navigationProperty.getName(); } return relationShipName; }
/** * Returns the {@link FullQualifiedName} for this SimpleTypeKind. * @return {@link FullQualifiedName} */ public FullQualifiedName getFullQualifiedName() { return new FullQualifiedName(EdmSimpleType.EDM_NAMESPACE, toString()); }
private String getFromEntityName(final EdmNavigationProperty navigationProperty) throws EdmException { String fromRole = navigationProperty.getFromRole(); EdmEntityType fromEntityType = navigationProperty.getRelationship().getEnd(fromRole).getEntityType(); EdmMapping mapping = fromEntityType.getMapping(); String entityName = null; if (mapping != null) { entityName = mapping.getInternalName(); } else { entityName = fromEntityType.getName(); } return entityName; }
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 EdmEntityType getTargetEntityType(Edm edm, EdmEntitySet srcEtySet ,EdmNavigationProperty navigationProp) throws EdmException { if(navigationProp == null) return null ; else { //Look for Target Entity Type based on Navigation Property String toRole = navigationProp.getToRole() ; return navigationProp.getRelationship().getEnd(toRole).getEntityType(); } } private EdmEntitySet getTargetEntitySet(Edm edm, EdmEntitySet srcEtySet, EdmNavigationProperty navigationProp) throws EdmException, ODataException{
private Object convertArgument(final EdmLiteral edmLiteral, final EdmFacets facets, final Class<?> targetType) throws EdmSimpleTypeException { Object value = null; if (edmLiteral != null) { EdmSimpleType edmType = edmLiteral.getType(); value = edmType.valueOfString(edmLiteral.getLiteral(), EdmLiteralKind.DEFAULT, facets, targetType); } return value; }
private String getRelationShipName(final EdmNavigationProperty navigationProperty) throws EdmException { EdmMapping mapping = navigationProperty.getMapping(); String relationShipName = null; if (mapping != null) { relationShipName = mapping.getInternalName(); } else { relationShipName = navigationProperty.getName(); } return relationShipName; }
/** * Returns the {@link FullQualifiedName} for this SimpleTypeKind. * @return {@link FullQualifiedName} */ public FullQualifiedName getFullQualifiedName() { return new FullQualifiedName(EdmSimpleType.EDM_NAMESPACE, toString()); }
private String getFromEntityName(final EdmNavigationProperty navigationProperty) throws EdmException { String fromRole = navigationProperty.getFromRole(); EdmEntityType toEntityType = navigationProperty.getRelationship().getEnd(fromRole).getEntityType(); EdmMapping mapping = toEntityType.getMapping(); String entityName = null; if (mapping != null) { entityName = mapping.getInternalName(); } else { entityName = toEntityType.getName(); } return entityName; }
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 String getRelationShipName(final EdmNavigationProperty navigationProperty) throws EdmException { EdmMapping mapping = navigationProperty.getMapping(); String relationShipName = null; if (mapping != null) { relationShipName = mapping.getInternalName(); } else { relationShipName = navigationProperty.getName(); } return relationShipName; }
/** * Returns the {@link FullQualifiedName} for this SimpleTypeKind. * @return {@link FullQualifiedName} */ public FullQualifiedName getFullQualifiedName() { return new FullQualifiedName(EdmSimpleType.EDM_NAMESPACE, toString()); }
private String getFromEntityName(final EdmNavigationProperty navigationProperty) throws EdmException { String fromRole = navigationProperty.getFromRole(); EdmEntityType toEntityType = navigationProperty.getRelationship().getEnd(fromRole).getEntityType(); EdmMapping mapping = toEntityType.getMapping(); String entityName = null; if (mapping != null) { entityName = mapping.getInternalName(); } else { entityName = toEntityType.getName(); } return entityName; }
private String getRelationShipName(final EdmNavigationProperty navigationProperty) throws EdmException { EdmMapping mapping = navigationProperty.getMapping(); String relationShipName = null; if (mapping != null) { relationShipName = mapping.getInternalName(); } else { relationShipName = navigationProperty.getName(); } return relationShipName; }