• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

interface mapping in hibernate

 
nishi bajaj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. Can someone please help me with this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic