Code example for Session

Methods: merge

0
		c.add(Restrictions.idEq(id));
		return (T)c.uniqueResult();
	} 
	@SuppressWarnings("unchecked") 
	protected <T> T save(T entity) {
		return (T)session.merge(entity);
	} 
	protected <T> void remove(T entity) {
		session.delete(entity);
	} 
	protected void flush() { 
		flush(true); 
	} 
	protected void flush(boolean commit) {
		session.flush();
		if (commit)
			tx.commit();
	} 
	protected void flushOnly() { 
		session.flush();