I'm not too strong with annotations, and have very little experience with them in Hibernate although they are used extensively in my current project. I have a situation where I need to change the Id Generator in a subclass.
All our persistent classes extend PersistentClass which has an id property defined thusly:
Code:
@EmbeddableSuperclass(access = AccessType.FIELD)
public abstract class PersistentObject implements Serializable
{
@Id(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(name = "oid", length=32)
private String oid;
I now have a subclass (Interrogation) that requires that the oid be constructed from various bits of data. How can I specify that a custom Id Generator is to be used for this class? Will the custom generator have access to the object for which it is generating and Id?