Hibernate many2one映射

Hibernate many2one映射
 1  <? xml version = " 1.0 " ?>
 2  <! DOCTYPE hibernate - mapping PUBLIC 
 3       " -//Hibernate/Hibernate Mapping DTD 3.0//EN "
 4       " http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd " >
 5  < hibernate - mapping  >
 6       < class  name = " com.simplye.hibernate.User "  table = " t_user " >
 7           < id name = " id " >
 8               < generator  class = " native " />
 9           </ id >
10           < property name = " name " />
11          
12           < many - to - one name = " group "  column = " t_group " />
13          
14       </ class >     
15  </ hibernate - mapping >

多段实用外键



 1  <? xml version = " 1.0 " ?>
 2  <! DOCTYPE hibernate - mapping PUBLIC 
 3       " -//Hibernate/Hibernate Mapping DTD 3.0//EN "
 4       " http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd " >
 5  < hibernate - mapping  >
 6       < class  name = " com.simplye.hibernate.Group "  table = " t_group " >
 7           < id name = " id " >
 8               < generator  class = " native " />
 9           </ id >
10           < property name = " name " />
11       </ class >     
12  </ hibernate - mapping >

你可能感兴趣的:(Hibernate many2one映射)