一对多和多对一双向关联
一个组有多个用户 一个用户只能属于一个组 在用户表里面有组的外键
?
Annotation配置:
?
?
?
package com.zchen.hibernate;import org.hibernate.cfg.AnnotationConfiguration;import org.hibernate.tool.hbm2ddl.SchemaExport;import org.junit.Test;public class Snippet {@Testpublic void testSchemaExport(){new SchemaExport(new AnnotationConfiguration().configure()).create(true, true);}}?