@Override public String toString() { try { return edmType.getNamespace()+ Edm.DELIMITER + edmType.getName(); } catch (EdmException e) { //NOPMD - suppressed return null; //NOSONAR } } }
public void castStringToGuidWithCompelxProperty(List<String> coloumnNames, List<Map<String, Object>> resultEntitySet , EdmStructuralType entityType){ for(int i=0; i<resultEntitySet.size(); i++ ){ for(String columnName : coloumnNames){ Object data = resultEntitySet.get(i).get(columnName) ; if(data != null && data instanceof String ){ resultEntitySet.get(i).put(columnName, UUID.fromString((String) data)); }else if(data != null && data instanceof Map ){ try { //Handle Complex type String complexTypeName = entityType.getProperty(columnName).getType().getName(); Map<String, Object> complexData = (Map<String, Object>)data; castStringToGuidWithCompelxProperty( complexPropWithUUID.get(complexTypeName) , Arrays.asList(complexData) , (EdmStructuralType) entityType.getProperty(columnName).getType() ); } catch (EdmException e) { } } } } }
/** * Returns full qualified name of a type of a given PropertyInfo. * @return Full qualified name */ private String getFqnTypeName(final EntityComplexPropertyInfo propertyInfo) throws EdmException { return propertyInfo.getType().getNamespace() + Edm.DELIMITER + propertyInfo.getType().getName(); }
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 static String getType(final CommonExpression expression) { try { final EdmType type = expression.getEdmType(); return type == null ? null : type.getNamespace() + Edm.DELIMITER + type.getName(); } catch (final EdmException e) { return "EdmException occurred: " + e.getMessage(); } } }
/** * Returns full qualified name of a type of a given PropertyInfo. * @return Full qualified name */ private String getFqnTypeName(final EntityComplexPropertyInfo propertyInfo) throws EdmException { return propertyInfo.getType().getNamespace() + Edm.DELIMITER + propertyInfo.getType().getName(); }
/** * Returns full qualified name of a type of a given PropertyInfo. * @return Full qualified name */ private String getFqnTypeName(final EntityComplexPropertyInfo propertyInfo) throws EdmException { return propertyInfo.getType().getNamespace() + Edm.DELIMITER + propertyInfo.getType().getName(); }
private static String getType(final CommonExpression expression) { try { final EdmType type = expression.getEdmType(); return type == null ? null : type.getNamespace() + Edm.DELIMITER + type.getName(); } catch (final EdmException e) { return "EdmException occurred: " + e.getMessage(); } } }
/** * Returns full qualified name of a type of a given PropertyInfo. * @return Full qualified name */ private String getFqnTypeName(final EntityComplexPropertyInfo propertyInfo) throws EdmException { return propertyInfo.getType().getNamespace() + Edm.DELIMITER + propertyInfo.getType().getName(); }
private static String getType(final CommonExpression expression) { try { final EdmType type = expression.getEdmType(); return type == null ? null : type.getNamespace() + Edm.DELIMITER + type.getName(); } catch (final EdmException e) { return "EdmException occurred: " + e.getMessage(); } } }
protected static void appendPropertyMetadata(final JsonStreamWriter jsonStreamWriter, final EdmType type) throws IOException, EdmException { jsonStreamWriter.name(FormatJson.METADATA) .beginObject() .namedStringValueRaw(FormatJson.TYPE, type.getNamespace() + Edm.DELIMITER + type.getName()) .endObject(); } }
protected static void appendPropertyMetadata(final JsonStreamWriter jsonStreamWriter, final EdmType type) throws IOException, EdmException { jsonStreamWriter.name(FormatJson.METADATA) .beginObject() .namedStringValueRaw(FormatJson.TYPE, type.getNamespace() + Edm.DELIMITER + type.getName()) .endObject(); } }
protected static void appendPropertyMetadata(final JsonStreamWriter jsonStreamWriter, final EdmType type) throws IOException, EdmException { jsonStreamWriter.name(FormatJson.METADATA) .beginObject() .namedStringValueRaw(FormatJson.TYPE, type.getNamespace() + Edm.DELIMITER + type.getName()) .endObject(); } }
protected static void appendPropertyMetadata(final JsonStreamWriter jsonStreamWriter, final EdmType type) throws IOException, EdmException { jsonStreamWriter.name(FormatJson.METADATA) .beginObject() .namedStringValueRaw(FormatJson.TYPE, type.getNamespace() + Edm.DELIMITER + type.getName()) .endObject(); } }
public static ExpressionParserException createINVALID_TYPES_FOR_BINARY_OPERATOR(final BinaryOperator op, final EdmType left, final EdmType right, final Token token, final String expression) { MessageReference msgRef = ExpressionParserException.INVALID_TYPES_FOR_BINARY_OPERATOR.create(); msgRef.addContent(op.toUriLiteral()); try { msgRef.addContent(left.getNamespace() + "." + left.getName()); } catch (EdmException e) { msgRef.addContent(""); } try { msgRef.addContent(right.getNamespace() + "." + right.getName()); } catch (EdmException e) { msgRef.addContent(""); } msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); return new ExpressionParserException(msgRef); }
public static ExpressionParserException createINVALID_TYPES_FOR_BINARY_OPERATOR(final BinaryOperator op, final EdmType left, final EdmType right, final Token token, final String expression) { MessageReference msgRef = ExpressionParserException.INVALID_TYPES_FOR_BINARY_OPERATOR.create(); msgRef.addContent(op.toUriLiteral()); try { msgRef.addContent(left.getNamespace() + "." + left.getName()); } catch (EdmException e) { msgRef.addContent(""); } try { msgRef.addContent(right.getNamespace() + "." + right.getName()); } catch (EdmException e) { msgRef.addContent(""); } msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); return new ExpressionParserException(msgRef); }
public static ExpressionParserException createINVALID_TYPES_FOR_BINARY_OPERATOR(final BinaryOperator op, final EdmType left, final EdmType right, final Token token, final String expression) { MessageReference msgRef = ExpressionParserException.INVALID_TYPES_FOR_BINARY_OPERATOR.create(); msgRef.addContent(op.toUriLiteral()); try { msgRef.addContent(left.getNamespace() + "." + left.getName()); } catch (EdmException e) { msgRef.addContent(""); } try { msgRef.addContent(right.getNamespace() + "." + right.getName()); } catch (EdmException e) { msgRef.addContent(""); } msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); return new ExpressionParserException(msgRef); }
public static ExpressionParserException createLEFT_SIDE_NOT_STRUCTURAL_TYPE(final EdmType parentType, final PropertyExpressionImpl property, final Token token, final String expression) throws ExpressionParserInternalError { MessageReference msgRef = ExpressionParserException.LEFT_SIDE_NOT_STRUCTURAL_TYPE.create(); try { msgRef.addContent(property.getUriLiteral()); msgRef.addContent(parentType.getNamespace() + "." + parentType.getName()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); } catch (EdmException e) { throw ExpressionParserInternalError.createERROR_ACCESSING_EDM(e); } return new ExpressionParserException(msgRef); }
public static ExpressionParserException createLEFT_SIDE_NOT_STRUCTURAL_TYPE(final EdmType parentType, final PropertyExpressionImpl property, final Token token, final String expression) throws ExpressionParserInternalError { MessageReference msgRef = ExpressionParserException.LEFT_SIDE_NOT_STRUCTURAL_TYPE.create(); try { msgRef.addContent(property.getUriLiteral()); msgRef.addContent(parentType.getNamespace() + "." + parentType.getName()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); } catch (EdmException e) { throw ExpressionParserInternalError.createERROR_ACCESSING_EDM(e); } return new ExpressionParserException(msgRef); }
public static ExpressionParserException createLEFT_SIDE_NOT_STRUCTURAL_TYPE(final EdmType parentType, final PropertyExpressionImpl property, final Token token, final String expression) throws ExpressionParserInternalError { MessageReference msgRef = ExpressionParserException.LEFT_SIDE_NOT_STRUCTURAL_TYPE.create(); try { msgRef.addContent(property.getUriLiteral()); msgRef.addContent(parentType.getNamespace() + "." + parentType.getName()); msgRef.addContent(token.getPosition() + 1); msgRef.addContent(expression); } catch (EdmException e) { throw ExpressionParserInternalError.createERROR_ACCESSING_EDM(e); } return new ExpressionParserException(msgRef); }