Hibernate version:3.2
The case is pretty trivial but i cant solve it with annotations.
I have a base class that handles the id :
Code:
public abstract BaseEntity
{
private Long id;
public Long getId() { return id;}
...
}
A subclass ClassA defined like this :
Code:
public ClassA extends BaseEntity
{
private String name1;
public String getName1() { return name1;}
...
}
and a subclass ClassB :
Code:
public ClassB extends BaseEntity
{
private String name2;
public String getName2() { return name2;}
...
}
Each subclass has a different strategy to generate id : "sequence" for ClassA and "assigned" for classB
I tried many examples, but it failed, how could I add annotations to model that ?
Any help appreciated!