Every JPA-Provider (at least hibernate, eclipselink and openjpa) gives the possibility to create the ddl-schema on the basis of the jpa entity classes. But every database management system has his own data types.
So how do the jpa-providers decide which sql datatype will be chosen. (I think it will be provider specific). Is there a Mapping like String->varchar(xx), boolean->tinyint
and so on. But then this mapping has to be exist for every database, right? Can anyone put me in the right direction please? I searched in the hibernate source-code but I did not find the right code snippets.
Thanks!
then this mapping has to be exist for every database, right?
You are right. The same is specified in the Dialect which is being used in DB connections.
For whatever I have searched this information is encapsulated inside the dialect driver for the DB which you use and the same must contain the mapping of java types -> db types
.
Here you can see mapping in Constructor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With