问题
In oracle I have a DOC_ID column
RAW(16) for my UUID/GUID
in hibernate I mapped it this way
@ID
@GeneratedValue(Generator= "uuid")
@GenericGenerator(name="uuid", strategy="uuid2")
@Type(type="uuid-char")
@Column(name="DOC_ID", unique= true)
private UUID id;
during insertion, it keeps complaining ORA-01465: invalid hex number.
May I know what is that issue?
回答1:
A char representation of a UUID is 36 chars, whereas the binary representation is 16 bytes. Try with
@Type(type="uuid-binary")
instead of
@Type(type="uuid-char")
来源:https://stackoverflow.com/questions/17985893/invalid-hex-number-while-inserting-uuid