I am trying to pass a class to a postgresql stored function as a user defined type but I get a failure:

PSQLException: Can't infer the SQL type to use for an instance of com.hwcs.veri.shared.dto.MyClass. Use setObject() with an explicit Types value to specify the type to

In trying to implement a solution using Eclipselink functionality using the ObjectRelationalDataTypeDescriptor to define the info I get an error when I try to get the ServerSession from the JpaHelper.getServerSession( entityManagerFactory ). The entity manager which is autowired is a org.springframework.orm.jpa.LocalEntityManagerFact oryBean and is not recognized since this generates an error IllegalArgumentException: jpa_helper_invalid_entity_manager_factoryclass.

Is there any defined way to execute such a call to postgresql using spring?

Thanks