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

Hibernate Core Reference Manual学习札记——Chapter 4. Persistent Classes

2013-01-21 
Hibernate Core Reference Manual学习笔记——Chapter 4. Persistent Classes?Example 4.3. Disabling proxi

Hibernate Core Reference Manual学习笔记——Chapter 4. Persistent Classes

?
Example 4.3. Disabling proxies in annotations

?
Example 4.5. Proxying an interface in annotations

public class Cat {    ...    public boolean equals(Object other) {        if (this == other) return true;        if ( !(other instanceof Cat) ) return false;        final Cat cat = (Cat) other;        if ( !cat.getLitterId().equals( getLitterId() ) ) return false;        if ( !cat.getMother().equals( getMother() ) ) return false;        return true;    }    public int hashCode() {        int result;        result = getMother().hashCode();        result = 29 * result + getLitterId();        return result;    }}

?
business key不一定非要是数据库的主键。不可变或者唯一键都可以作为business key。

4.4. Dynamic models
Note
The following features are currently considered experimental and may change in the near future.
4.5. Tuplizers
4.6. EntityNameResolvers(以后看)

?

热点排行