当数据库中的列是 TEXT 或 BLOB 类型时,Apache Olinge OData 服务抛出 EdmSimpleTypeException
Apache Olinge OData service throws EdmSimpleTypeException when the column in database is of type TEXT or BLOB
我在eclipse中使用JPA做了一个实体。我的MySQL中的table的定义是这样的:
CREATE TABLE `users` (
`id` int(255) NOT NULL,
`name` varchar(255) NOT NULL,
`photo_content` text CHARACTER SET ascii DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
我用 JPA 生成的等效实体是这样的:
import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;
/**
* The persistent class for the users database table.
*
*/
@Entity
@Table(name="users")
@NamedQuery(name="User.findAll", query="SELECT u FROM User u")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(unique=true, nullable=false)
private int id;
@Column(nullable=false, length=255)
private String name;
@Lob
@Column(name="photo_content")
private String photoContent;
//bi-directional many-to-one association to Answer
@OneToMany(mappedBy="user")
private Set<Answer> answers;
//bi-directional many-to-one association to Survey
@OneToMany(mappedBy="user")
private Set<Survey> surveys;
public User() {
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getPhotoContent() {
return this.photoContent;
}
public void setPhotoContent(String photoContent) {
this.photoContent = photoContent;
}
public Set<Answer> getAnswers() {
return this.answers;
}
public void setAnswers(Set<Answer> answers) {
this.answers = answers;
}
public Answer addAnswer(Answer answer) {
getAnswers().add(answer);
answer.setUser(this);
return answer;
}
public Answer removeAnswer(Answer answer) {
getAnswers().remove(answer);
answer.setUser(null);
return answer;
}
public Set<Survey> getSurveys() {
return this.surveys;
}
public void setSurveys(Set<Survey> surveys) {
this.surveys = surveys;
}
public Survey addSurvey(Survey survey) {
getSurveys().add(survey);
survey.setUser(this);
return survey;
}
public Survey removeSurvey(Survey survey) {
getSurveys().remove(survey);
survey.setUser(null);
return survey;
}
}
一旦 photo_content
列具有如下值:
data:image/png;base64,iVBORw0KGgoAAAANSUhEU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尝试通过 OData 服务读取 Users
我将看到以下异常:
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en">Missing message for key 'org.apache.olingo.odata2.api.edm.EdmSimpleTypeException.PROPERTY_VALUE_FACETS_NOT_MATCHED'!</message>
</error>
我该如何解决?我发现另一个 post here 在答案中,它声称这个错误是因为数据类型转换但是当它是长字符串时我们没有任何类型转换!
只需要强制olingo
去掉属性的长度即可。根据上面对用户实体的定义,它将在元数据中以 maxLength=255
结束。因此,当我们想将 LongText 或 Blob 或 Clob 与 olingo-jpa 一起使用时,我们必须为 属性 提供负大小,然后它将假定 属性!
的大小不受限制
@Lob
@Column(name="photo_content", length=-1)
private String photoContent;
我在eclipse中使用JPA做了一个实体。我的MySQL中的table的定义是这样的:
CREATE TABLE `users` (
`id` int(255) NOT NULL,
`name` varchar(255) NOT NULL,
`photo_content` text CHARACTER SET ascii DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
我用 JPA 生成的等效实体是这样的:
import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;
/**
* The persistent class for the users database table.
*
*/
@Entity
@Table(name="users")
@NamedQuery(name="User.findAll", query="SELECT u FROM User u")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(unique=true, nullable=false)
private int id;
@Column(nullable=false, length=255)
private String name;
@Lob
@Column(name="photo_content")
private String photoContent;
//bi-directional many-to-one association to Answer
@OneToMany(mappedBy="user")
private Set<Answer> answers;
//bi-directional many-to-one association to Survey
@OneToMany(mappedBy="user")
private Set<Survey> surveys;
public User() {
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getPhotoContent() {
return this.photoContent;
}
public void setPhotoContent(String photoContent) {
this.photoContent = photoContent;
}
public Set<Answer> getAnswers() {
return this.answers;
}
public void setAnswers(Set<Answer> answers) {
this.answers = answers;
}
public Answer addAnswer(Answer answer) {
getAnswers().add(answer);
answer.setUser(this);
return answer;
}
public Answer removeAnswer(Answer answer) {
getAnswers().remove(answer);
answer.setUser(null);
return answer;
}
public Set<Survey> getSurveys() {
return this.surveys;
}
public void setSurveys(Set<Survey> surveys) {
this.surveys = surveys;
}
public Survey addSurvey(Survey survey) {
getSurveys().add(survey);
survey.setUser(this);
return survey;
}
public Survey removeSurvey(Survey survey) {
getSurveys().remove(survey);
survey.setUser(null);
return survey;
}
}
一旦 photo_content
列具有如下值:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAopElEQVR42u2deXxU5b3/33NmyWQhhAQSSIIxAwIiKKCCUqgUURGdunSzYqttbW9v7/XW3uu1tW6tSzftta297e8Wf+7WrVXrWGy9Vm21WBFRQVYhkJhAyELWmcx+7h/nAFkns8+cme/79eIFLzKZ85zPeb6f86zfx3TetRciGJdwpauwqITpwAlAJVCh/zny7ylAGWAHSoACwAYUDvuqAcAP+IB+wAt0A+1AJ9AFtOr/bgMaPf3sVdqcA/IUjItFJDBMkM8B5gLzgOOB44CZeqAng8JBphDVdxaVACWuNmAP0ATsBz4Atnv62SnmIAYgxIjd4ZoALAQWA6cCJwOzsvhZVep/lg4zhyAlrj3Ae8A7wEbgXW+Ds0+ecvZgki5AhpnqqrIXcRawHFiG9obPVWMOorUQ3gBe93r4K63OQ1IJxADyBr05vxJYBZyL1qzPZ7YDLwEve/p5RboNYgA5h1LtqrXZcQIXAp9g5ACcoDEAvAq84PfiCh9wNoskYgCGxFzrqrPa+AxwCXAmYBJVYkIF3gSeDfh5OtTsbBRJxACyPegnWW1cBlwhQZ8SM3g04OeJULOzSyQRA8iWoDdZbXwC+CpwKdocu5A6/MAzwLqAn1dDzU5VJBEDSD/a6P2XgKuBGSJIRtgL3Of18IDMJogBpAW7w7UQ+A/gc8g6imwhCDwJ/NTb4HxX5BADSCp6M38NcB2wQhTJ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xt3OBUcreF4Ac2AxuAN6qms+FIf/6oHoIYQD4TrnQVtrdwGtrxZ4vQUpnNwXhjCCpa/vytR4J+Sg2blDbngDxlMQAhdlM4UTeDWcBMYLr+74oMF68T2A18BOzR/711Sg07JNjFAIT0mEMdUI92bPpU/e8KoBCYBkwGCoCJ+q+Vc6xFoQIB4Ejfu1f/Px/QARwEBvRAb0Mbh28D9k2poVGC3Nj8H1wwenSbpdbLAAAAEnRFWHRFWElGOk9yaWVudGF0aW9uADGEWOzvAAAAAElFTkSuQmCC
我尝试通过 OData 服务读取 Users
我将看到以下异常:
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en">Missing message for key 'org.apache.olingo.odata2.api.edm.EdmSimpleTypeException.PROPERTY_VALUE_FACETS_NOT_MATCHED'!</message>
</error>
我该如何解决?我发现另一个 post here 在答案中,它声称这个错误是因为数据类型转换但是当它是长字符串时我们没有任何类型转换!
只需要强制olingo
去掉属性的长度即可。根据上面对用户实体的定义,它将在元数据中以 maxLength=255
结束。因此,当我们想将 LongText 或 Blob 或 Clob 与 olingo-jpa 一起使用时,我们必须为 属性 提供负大小,然后它将假定 属性!
@Lob
@Column(name="photo_content", length=-1)
private String photoContent;