I'm using Hibernate 5.0 + Postgres 9.4
My entities use UUID
s as indentifier.
The project also uses hibernate-spatial
.
The id
property is annotated simply as
@Id
@GeneratedValue
private UUID id;
After persisting any entity (not only the ones with geometrical data), I get the following error:
column "id" is of type geometry but expression is of type uuid
Looks like there is some conflict in types mapping to me; though I'm not an expert of Hibernate types mapping.
Is there anyone who can help me overcome this issue?
Check out this answer and the original discussion thread
Specifying columnDefinition = "uuid"
solved exactly the same issue for me.
@Entity
public class MyEntity {
@Id
@GeneratedValue
@Column( columnDefinition = "uuid", updatable = false )
public UUID getId() {
return id;
}
}
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