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

Hibernate:一对一单向主键联系关系

2012-08-30 
Hibernate:一对一单向主键关联一 环境:W7+Eclipse3.6+JDK1.6+MySQL 二 所用Hibernate版本:hibernate-distr

Hibernate:一对一单向主键关联
一 环境:W7+Eclipse3.6+JDK1.6+MySQL
二 所用Hibernate版本:hibernate-distribution-3.6.0
三 具体代码
1 Annotations版本

主导对象



create table A (        id integer not null auto_increment,        name varchar(255),        bId integer unique,        primary key (id))create table B (        id integer not null auto_increment,        name varchar(255),        primary key (id)) alter table A         add index FK418DB1FDB2 (id),         add constraint FK418DB1FDB2         foreign key (id)         references B (id)

热点排行