JPA and FHIRBase error

92 views
Skip to first unread message

Subhrajyoti Moitra

unread,
Feb 20, 2016, 9:27:31 AM2/20/16
to FHIRbase
Hello,

I am trying to use JPA/JDBC to call the fhir functions from Java code.
I keep getting the below error:
javax.persistence.PersistenceException: org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111

Does any one know how to make this work using JDBC?

The java code is

String q0 = "SET plv8.start_proc = 'plv8_init';";
String q = "SELECT fhir_read_resource('{\"resourceType\": \"Patient\", \"id\": \"smith\"}');";
entityManager.createNativeQuery(q0).executeUpdate();
Object singleResult = entityManager.createNativeQuery(q).getSingleResult();

The error is throw from the last line in the above snippet.

I have also tried other ways,

StoredProcedureQuery stprocquery = entityManager.createStoredProcedureQuery("fhir_read_resource");
stprocquery.registerStoredProcedureParameter(1, Object.class, ParameterMode.IN);
stprocquery.registerStoredProcedureParameter(1, Object.class, ParameterMode.OUT);
stprocquery.execute();

This too does not work, not sure how to map JSON types of postgresql to JDBC type.
The error i get in this code snippet is:

[0m [0m19:46:38,666 INFO  [stdout] (default task-1) Hibernate: {call fhir_read_resource(?,?,?,?)}
[0m [33m19:46:38,667 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-1) SQL Error: 0, SQLState: null

Please help, since my app is in java I have to get this work with JDBC. Any pointers would be very helpful.

Thanks,
Subhro.
Reply all
Reply to author
Forward
0 new messages