Generic Methods
From Hibernate 3.2.0.GA AbstractEntityManagerImpl.java
@SuppressWarnings("unchecked")
public <A> A find(Class<A> entityClass, Object primaryKey) {
...
try {
return (A) getSession().get( entityClass, (Serializable) primaryKey );
}
catch ...
}
@SuppressWarnings("unchecked")
public <A> A merge(A entity) {
...
try {
return (A) getSession().merge( entity );
}
catch ...
}
Comments