psynix wrote:
Hi,
Not really Hibernate related I guess, but what are the advantages/disadvantages of using uuid.hex over a sequence as an hibernate id?
TIA,
John
Hi John,
"uuid.hex" uses an algorithm to generate identifiers of type string, unique within a network (the IP address is used). The UUID is encoded as a string of hexadecimal digits of length 32.
where as, if you have a sequence created in your database is being used as the key-value for a class-property, you use sequence.
Both are unique. In certain cases requirements are such like you /have/ to use sequence, use generator class="sequence", if you just want to generate a unique number and you don't have any constraint to use sequence, use "uuid.hex".
Raj