Apache Olinge OData服务:EdmSimpleTypeException [英] Apache Olinge OData service: EdmSimpleTypeException

查看:99
本文介绍了Apache Olinge OData服务:EdmSimpleTypeException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过OData访问它们时,我的某些实体中出现EdmSimpleTypeExceptions.我正在使用Apache Olingo来做到这一点.问题是我不能实现除整数和字符串以外的任何类型.如果我使用double,则我会得到EdmSimpleTypeException,尽管double是一个EdmSimpleType.我还尝试了所有其他以EdmSimpleType声明的类型.

I am getting EdmSimpleTypeExceptions in some of my entities when i try to access them via OData. I am using Apache Olingo for doing that. The problem is that I can't implement any types other than integer and String. If I use a double I get the EdmSimpleTypeException, although double is an EdmSimpleType. I also tried all of the other types which are stated as an EdmSimpleType.

为什么会发生这种情况?在Olinge中有任何已知的bug或类似的东西吗?

Is there any explanation why this happens? Any known bug in Olinge or someting like that?

推荐答案

EdmSimpleTypeException 在多种情况下引发,主要是针对与 entityType 不匹配的非法类型值元数据.

EdmSimpleTypeException is thrown in multiple cases, mostly for illegal type values which do not match with the entityType metadata.

例如在 entityType 中,一个属性被定义为 non nullable ,并且将一个null值传递给该属性.

Ex. In entityType a property is defined as non nullable and a null value is passed into it.

您可以检查EdmSimpleTypeExceptions的文档这里.

You can check documentation for EdmSimpleTypeExceptions here.

在您的特殊情况下,将 EdmSimpleType 设置为 Double 的情况最有可能发生,但是您要尝试针对它设置的值不是以下之一 Double,Float,BigDecimal,Byte,Short,Integer,Long 和Olingo类型在转换时会引发错误.

Here in your particular case what most likely is happening that you are setting EdmSimpleType as Double but the value you are trying to put against it is not one of the following types Double, Float, BigDecimal, Byte, Short, Integer, Long and Olingo is throwing an error while converting it.

您可以检查OData类型和Java类型之间的映射的完整列表

You can check the complete list of mapping between the OData type and Java types here

这篇关于Apache Olinge OData服务:EdmSimpleTypeException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆