首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

一对多跟多对一双向关联

2012-08-26 
一对多和多对一双向关联一个组有多个用户 一个用户只能属于一个组 在用户表里面有组的外键?Annotation配置

一对多和多对一双向关联

一个组有多个用户 一个用户只能属于一个组 在用户表里面有组的外键

?

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);}}

?

热点排行