I have a Student class like this class Student{ private int id; private String name; private IBranch branch; } and corresponding table in database is Table Student{ ID int, Name VARCHAR, BranchType int } IBranch is an interface and classes CSBranch, ECEBranch, ChemicalBranch implements IBranch Based on branchtype stored as int in database, a branch is created. How to map branchtype from database to branh interface in student object using hibernate configuration file or branch class is to be created by calling some method.
|