Hibernate Core Reference Manual学习笔记——Chapter 4. Persistent Classes
?
Example 4.3. Disabling proxies in annotations
?
Example 4.5. Proxying an interface in annotationspublic 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(以后看)?