I have a question about UUID generated values.
We are using Hibernate/JPA for our persistence, and Liquibase for DDL.
If we define a table such as:
<changeSet author=".." id="1234-create-books">
<createTable tableName="books">
<column name="id" type="UUID" defaultValueComputed="uuid_generate_v1mc()">
<constraints nullable="false" primaryKey="true" primaryKeyName="pk_books"/>
</column>
...
</createTable>
</changeSet>
But then define the Entity like:
@Entity
public static class Book {
@Id
@GeneratedValue
private UUID id;
...
}
Can I confirm that Hibernate would take precedence, and generate a UUID value using:
The default strategy is a version 4 (random) strategy according to IETF RFC 4122.
As opposed to using the v1 strategy defined with default value computed?
gen_random_uuid()?