I'm new at hibernate so this question might be very trivial :)
I don't know how to make the lookup table transparent in my code; I mean if I have a lookup table Status (married, single,...), and there is person table which has an Integer field for status
Person (ID, Name,...,status(foriegn key))
how can in my Person class have status as string instead of an object (of status class) whithout loosing any of the functionalities , like sorting
e.g
class Person {
private int ID;
private String Name;
private String status; // instead of private Status status;
// instead of private int statusID;
}
can any one help?
is there a best practice for this?
Thanks
Hany
|