I have a class hierarchy:
abstract DomainObject {
...
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="SEQ")
@SequenceGenerator(name="SEQ",sequenceName="SEQ_DB_NAME")
@Column(name = "id", updatable = false, nullable = false)
private Long id;
...
}
BaseClass extends DomainObject {
...
// Fill in blank here where this class's @Id will use a unique sequence generator
// bonus points for any sort of automatic assignment of generator names that might
//prevent me from having to instrument all my domain objects uniquely
...
}
notes:
- I do not specifically need a base class generator, so if it behooves me to remove it no problem.
- This is an oracle 9i db if that is applicable
- Hibernate 3.4 JPA
- Spring 2.5 is available as well
Thanks