@Override public JPAEntityType getEntity(final EdmType edmType) throws ODataJPAModelException { final IntermediateSchema schema = schemaListInternalKey.get(edmType.getNamespace()); if (schema != null) return schema.getEntityType(edmType.getName()); return null; }
@Override public BuilderImpl setType(final EdmType type) { EdmPrimitiveTypeKind primitiveTypeKind = null; if (type != null) { if (type.getKind() != EdmTypeKind.PRIMITIVE) { throw new IllegalArgumentException(String.format("Provided type %s is not primitive", type)); } primitiveTypeKind = EdmPrimitiveTypeKind.valueOf(type.getName()); } return setType(primitiveTypeKind); }
@Override public BuilderImpl setType(final EdmType type) { EdmPrimitiveTypeKind primitiveTypeKind = null; if (type != null) { if (type.getKind() != EdmTypeKind.PRIMITIVE) { throw new IllegalArgumentException(String.format("Provided type %s is not primitive", type)); } primitiveTypeKind = EdmPrimitiveTypeKind.valueOf(type.getName()); } return setType(primitiveTypeKind); }
@Override public boolean compatibleTo(final EdmType targetType) { EdmStructuredType sourceType = this; if (targetType == null) { throw new EdmException("Target type must not be null"); } while (!sourceType.getName().equals(targetType.getName()) || !sourceType.getNamespace().equals(targetType.getNamespace())) { sourceType = sourceType.getBaseType(); if (sourceType == null) { return false; } } return true; }
private static List<Column> resolveKeyPredicatesToColumnsUpdate(EdmEntityType entityType, List<UriParameter> keyPredicates){ List<Column> columns = new ArrayList<Column>(); for(UriParameter uriPred:keyPredicates){ Column col=formNewColumnObject(uriPred.getName().replace("_", "."),null,getValueOfProperty(uriPred),true); col.setColumnDataType(entityType.getProperty(uriPred.getName()).getType().getName()); columns.add(col); } return columns; }
@Override public boolean compatibleTo(final EdmType targetType) { EdmStructuredType sourceType = this; if (targetType == null) { throw new EdmException("Target type must not be null"); } while (!sourceType.getName().equals(targetType.getName()) || !sourceType.getNamespace().equals(targetType.getNamespace())) { sourceType = sourceType.getBaseType(); if (sourceType == null) { return false; } } return true; }
@Override public Object visitLiteral(Literal literal) throws ExpressionVisitException, ODataApplicationException { validateDate(literal.getText(), literal.getType()); if(literal.getType()!=null&&literal.getType().getName().equals("Guid")) { /* * We want to convert uuids in a case insensitive manner, to do that we convert to lower case * 1) the actual value to which comparison has to be done * 2) The value persisted in DB. (By calling LCASE function of HANA.This is done in the visitMember method) */ return ("'"+literal.getText()+"'").toLowerCase(); } return literal.getText(); }
col.setColumnDataType(entityType.getProperty(columnName).getType().getName()); columns.add(col); allProperties.remove(col.getName());
throw new UriParserSemanticException("Type filters are not chainable.", UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE, previousTypeFilter.getName(), type.getName()); throw new UriParserSemanticException("Type filters are not chainable.", UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE, previousTypeFilter.getName(), type.getName()); throw new UriParserSemanticException("Type filters are not chainable.", UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE, previousTypeFilter.getName(), type.getName());
throw new UriParserSemanticException("Type filters are not chainable.", UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE, previousTypeFilter.getName(), type.getName()); throw new UriParserSemanticException("Type filters are not chainable.", UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE, previousTypeFilter.getName(), type.getName()); throw new UriParserSemanticException("Type filters are not chainable.", UriParserSemanticException.MessageKeys.TYPE_FILTER_NOT_CHAINABLE, previousTypeFilter.getName(), type.getName());
writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_TYPE, edmProperty.isPrimitive() ? "#Collection(" + edmProperty.getType().getName() + ")" : collectionType(edmProperty.getType())); writePrimitiveCollection((EdmPrimitiveType) edmProperty.getType(), property,
writer.writeAttribute(METADATA, NS_METADATA, Constants.ATTR_TYPE, edmProperty.isPrimitive() ? "#Collection(" + edmProperty.getType().getName() + ")" : collectionType(edmProperty.getType())); writePrimitiveCollection((EdmPrimitiveType) edmProperty.getType(), property,