xdoclet在hibernate中的典型应用1
2007-06-08 15:18
183 查看
对表的声明
/**
* @hibernate.class table="author"
*/
一对一
/**
* @hibernate.one-to-one cascade="all" constrained="true"
*/
public Person getPerson() {
return person;
}
多对一、一对多
/**
* @hibernate.set lazy="true" inverse="true" cascade="all"
* @hibernate.collection-key column="authorid"
* @hibernate.collection-one-to-many class="com.cq.Publication"
*/
public Set getPublications() {
return publications;
}
/**
* @hibernate.many-to-one column="authorid"
*/
public Author getAuthor() {
return author;
}
多对多
/**
* @hibernate.set lazy="true" table="author_work"
* @hibernate.collection-key column="author_id"
* @hibernate.collection-many-to-many column="work_id" class="com.rq.Work"
*/
public Set getWorks() {
return works;
}
/**
* @hibernate.set lazy="true" table="author_work"
* @hibernate.collection-key column="work_id"
* @hibernate.collection-many-to-many column="author_id" class="com.rq.Author"
*/
public Set getAuthors() {
return authors;
}
/**
* @hibernate.class table="author"
*/
一对一
/**
* @hibernate.one-to-one cascade="all" constrained="true"
*/
public Person getPerson() {
return person;
}
多对一、一对多
/**
* @hibernate.set lazy="true" inverse="true" cascade="all"
* @hibernate.collection-key column="authorid"
* @hibernate.collection-one-to-many class="com.cq.Publication"
*/
public Set getPublications() {
return publications;
}
/**
* @hibernate.many-to-one column="authorid"
*/
public Author getAuthor() {
return author;
}
多对多
/**
* @hibernate.set lazy="true" table="author_work"
* @hibernate.collection-key column="author_id"
* @hibernate.collection-many-to-many column="work_id" class="com.rq.Work"
*/
public Set getWorks() {
return works;
}
/**
* @hibernate.set lazy="true" table="author_work"
* @hibernate.collection-key column="work_id"
* @hibernate.collection-many-to-many column="author_id" class="com.rq.Author"
*/
public Set getAuthors() {
return authors;
}
相关文章推荐
- 在应用hibernate框架操作数据库时,是先建表还是先建类?
- PHP中WEB典型应用技术
- ZooKeeper典型应用场景一览
- spring springmvc hibernate(ssh)项目整合开发---邮件通信的应用
- 对Hibernate缓存策略的理解和应用
- 【在线应用】篇五:城市典型用地信息遥感提取系统,实时监控家园变化
- Spring与Hibernate整合的HibernateDaoSupport应用中的“内存泄露”问题(学习心得)
- 34.JAVA编程思想——JAVA IO 流典型应用
- xdoclet对hibernate的lazy设置
- ZooKeeper典型应用场景一览
- 【知识共享】SSIS的典型应用
- 3.6 典型应用集成技术
- Hive典型应用场景之行列转换
- SQL Server中公用表表达式 CTE 递归的生成帮助数据,以及递归的典型应用
- 第21章 典型业务案例应用
- 【公益】Google技术用户组Android 4.0典型应用案例讲座
- Java高手真经. 应用框架卷:Java Web核心框架:Struts 1+Struts 2+Spring+Hibernate+iBATIS (china-pub 首发)
- mybatis和hibernate的本质区别和应用场景简介
- 运营效果分析的典型应用
- Struts2+Hibernate整合应用开发步骤