I'm not seeing anything for sys_guid() though there is something very similar called org.hibernate.id.GUIDGenerator that says it's for SQL Server but it uses a call (unless this is really old)
Code:
...from GUIDGenerator...
final String sql = session.getFactory().getDialect().getSelectGUIDString();
...from Oracle9iDialect...
public String getSelectGUIDString() {
"select rawtohex(sys_guid()) from dual";
}
which is available from Oracle9iDialect and hence Oracle10gDialect. I'd think the xml of using this would be:
Code:
<id name="id" type="long" column="ADDRESS_ID">
<generator class="org.hibernate.id.GUIDGenerator"/>
</id>
Code:
@Id
@GeneratedValue(generator="name-of-genericgen")
@GenericGenerator(name="name-of-genericgen", strategy = "guid")
...or maybe...
@GenericGenerator(name="name-of-genericgen", strategy = "org.hibernate.id.GUIDGenerator")
@Column(name = "ADDRESSES_ID", unique = true, nullable = false, length = 32)
Another alternative would be org.hibernate.id.UUIDHexGenerator...I'm really not sure why GUIDGenerator doesn't explicitly support Oracle though. Try it out...I'm not positive about this.