Hello,
I've read the documentation about inheritance, but it's still dark for me. For instance, I'd like to write the Hibernate mapping files of the 3 following classes :
Code:
public abstract class CodeNom {
protected String code;
protected String libelle;
public String getCode(){ return code;}
public String getLibelle(){return libelle;}
public void setCode(code){ this.code = code;}
public void setLibelle(code){this.libelle = libelle;}
public CodeNom(){
}
}
public TypeCommande extends CodeNom{
public TypeCommande() {
super();
}
}
public TypeFacture extends CodeNom{
public TypeFacture() {
super();
}
}
I want to store each concrete class (TypeCommande and TypeFacture) in a single table of the database (TYPECDE and TYPEFAC). The attribute code is my primary key.
As the CodeNom class is abstract, I don't need to store it in the database.
Can someone tell me what is the mapping file of this example ?
Thanks a lot