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

Popular posts from this blog

Sites, Newsletters, and Blogs

Oracle JDBC ReadTimeout QueryTimeout

Locks held on Oracle for hours after sessions abnormally terminated by node failure