I need to define/override the default hibernate mapping to solve the problem of the java.util.UUID default mapping.
I've been looking at several comments related to this topic: Here Postgresql UUID supported by Hibernate? and Postgres + Hibernate + Java UUID and Persisting UUID in PostgreSQL using JPA and and Hibernate documentation.
However the easier solution of annotate; something like @Type(type="pg-uuid"), does not works for me since i need to run with different databases (e.g. H2)
So what i need is to "register org.hibernate.type.PostgresUUIDType as the default Hibernate type mapping for all attributes exposed as java.util.UUID" as has been said in several of the comments.
Sadly after checking the documentation i still don't get exactly how to do it.
Could you, please, explain or point me to a more detailed information about how to override the default type mapping in Hibernate 4.2?
Thanks, and regards,