Postgres array data type with Olingo V4 JPA and Hibernate

85 Views Asked by At

I have an entity which I am trying to map to a postgres array data type Here is how the entity is set up

@Entity
@Table(name = "ide")

@TypeDef(
        name = "list-array",
        typeClass = ListArrayType.class
)
public class Substance{

@Type(type = "list-array")
@Column(name = "RN", columnDefinition = "text[]")
private List<String> rn;

When I try to access this through the Odata service that I have written and running I get the following error:

"error": {
"code": null,
"message": "com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException: Type 'java.util.List' of attribute 'rn' is not supported. Mapping not possible. If 'java.util.List' is an enumeration, check if related package is provided."
}

This works with the normal implementation of JPA but not with the SAP JPA library which I am using. Has anyone experienced something like this before or know of a way to resolve this?

I tried implementing the data type in the same way with the olingo library as the normal JPA library but I got an error stating that the data type is not supported

I tried different data types such as String[], List, Set but got the same error result for all

0

There are 0 best solutions below