Hi all;
after many GPT and claude sessions without success I am turning to the community for a little help.
my goal is simple, map a POJO to a jsonb column in posgres using PG15, hibernate 6.4 and jpa.
my stand alone java application is pretty simple: 1 entity, 1 pojo, main class as follows (stripped down code, persistence.xml ommited as there is nothing special there):
PolicyEntity{
....
@JdbcTypeCode(SqlTypes.JSON)
@Column(name = "data", columnDefinition = "jsonb")
private PolicyPOJO data;
...
}
PolicyPOJO{
...
public PolicyPOJO(){}
private String createdBy;
private List<String> rules;
...
}
main{
...
EntityManagerFactory emf = Persistence.createEntityManagerFactory("nms");
...
}
main throws:
“Exception in thread “main” org.hibernate.type.descriptor.java.spi.JdbcTypeRecommendationException: Could not determine recommended JdbcType for Java type ‘jsonbjpa.PolicyPOJO’”
note that I have cycled through many annotations on the data property and also tried hypersistence utils types but all yields the same. i am completely lost here even thouigh the error message seems straight forward.
is pojo mapping working with my versions? docuemntation shows a Map only example.
am I doing something wrong here?
note that i project is not a maven/gradle one, its a bring your own jars… maybe a jar is missing?
list of jars in the classpath below…
any help would be great (TBH, i cant get String to work also. i might be missing something)
10x