I searched the documentation and other stuff.
With Java 1.5 Annotations this seems to be a non-issue. This strategie fits nicely:
Code:
@Entity(accessType=FIELD)
@Inheritance(strategy=SINGLE_TABLE)
public class File {
@Idprivate String name;
@ManyToOneprivate Folder parent;
...
}
@Entity
@Inheritance(discriminator-value=āFā)
public class Folder extends File {
...
}
@Entity(accessType=FIELD)
@Inheritance(discriminator-value=āDā)
public class Document extends File {
private long size;
Cool. This would solve my problem. But i am stuck with 1.4.x.
Now i am wondering if the same can be specified with hbm.xml?
Probably.