Hello to all, I have begun to see Hibernate and I am with a situation that I cannot solve.
Let us suppose that I have a User class
Code:
public class User {
private Integer userID;
private String username;
private String password;
private Description userType;
private Description userStatus;
... constructor and access methods...
}
and the Description class
Code:
public class Description {
private Integer ID;
private String description;
... constructor and access methods...
}
For the attributes userType and userStatus would have to define a relation many-to-one to Description.
The problem is that depending that attribute, acceding Description class would have to mapear it to different tables, if the attribute is userType Description would have to mapear to TabUserType and if the attribute is userStatus would have to mapear to TabUserStatus.
They are possible to be made this type of mappings in Hibernate?
I am mistaken in the form in which I am trying to design my classes? Would have to make a subclass specific each attribute to be able to mapear to different tables?
Thanks beforehand for its time.