Project to demonstrate Hibernate schema auto generation where the custom PostgreSQL type INET
is used
-
A PostgreSQL database is required to run this project. The connection data can be eddited in
src/main/resources/application.yaml
.The existing connection data is for a database running on
localhost:5432
calledpostgres
with same username and password. -
JDK 8 to run the app
$ java -jar target/wrong-type-0.0.1-SNAPSHOT.jar
The app only generates the schema and exits.
Instead of correctly guessing the type for column inet_address
to be INET
, Hibernate decides that it has type UUID
when running the DDL.
As pointed out in this SO answer, the INET
valued property needs to be additionally
annotated with
@Column(columnDefinition = "inet")