<map name="sub_tea" table="t_cla_sub_sub">
<key column="cla_id" not-null="true"/>
<map-key type="object" column="sub_id"/>
<element type="object" column="tea_id" not-null="false"/>
</map>Classes cl = (Classes)session.load(Classes.class, 3);
Map cst = new HashMap();
Subject sub = (Subject)session.load(Subject.class, 2);
Teacher tea = (Teacher)session.load(Teacher.class, 1);
// cst.put(1, 1);
// cst.put(2, 2);
// cst.put(3, 3);
// cst.put(4, 4);
cst.put(sub, tea);
cl.setSub_tea(cst);

session.save(cl);org.hibernate.MappingException: 
collection element mapping has wrong number of columns: sen.com.model.Classes.sub_tea type: object当把type=int 基本类型,往map添加些基本类型的又没问题?
难道只能做基本类型的映射?