注意:set集合中的实体类必须重写equals()与hashCode()方法 。
pom.xml:
resources/hibernate.cfg.xml:
pojo/User.java:
pojo/User.hbm.xml:
pojo/Address.java:
pojo/Address.hbm.xml:
util/HibernateUtil.java:
util/Manager.java:
表结构:
输出sql: