public void flush() { try { if ( ! isTransactionInProgress() ) { throw new TransactionRequiredException( "no transaction is in progress" ); } //adjustFlushMode(); getSession().flush(); } catch (HibernateException he) { throwPersistenceException( he ); } }
public void remove(Object entity) { checkTransactionNeeded(); //adjustFlushMode(); try { getSession().delete( entity ); } catch (MappingException e) { throw new IllegalArgumentException( e.getMessage(), e ); } catch (HibernateException he) { throwPersistenceException( he ); } }
public void begin() { try { rollbackOnly = false; if ( tx != null && tx.isActive() ) { throw new IllegalStateException( "Transaction already active" ); } //entityManager.adjustFlushMode(); tx = getSession().beginTransaction(); } catch (HibernateException he) { entityManager.throwPersistenceException( he ); } }
public Query createQuery(String ejbqlString) { //adjustFlushMode(); try { return new QueryImpl( getSession().createQuery( ejbqlString ), this ); } catch (HibernateException he) { throwPersistenceException( he ); return null; } }
public Query createQuery(String ejbqlString) { //adjustFlushMode(); try { return new QueryImpl( getSession().createQuery( ejbqlString ), this ); } catch (HibernateException he) { throwPersistenceException( he ); return null; } }
public void clear() { //adjustFlushMode(); try { getSession().clear(); } catch (HibernateException he) { throwPersistenceException( he ); } }
public void clear() { //adjustFlushMode(); try { getSession().clear(); } catch (HibernateException he) { throwPersistenceException( he ); } }
public void remove(Object entity) { checkTransactionNeeded(); //adjustFlushMode(); try { getSession().delete( entity ); } catch (MappingException e) { throw new IllegalArgumentException( e.getMessage(), e ); } catch (HibernateException he) { throwPersistenceException( he ); } }
public void flush() { try { if ( ! isTransactionInProgress() ) { throw new TransactionRequiredException( "no transaction is in progress" ); } //adjustFlushMode(); getSession().flush(); } catch (HibernateException he) { throwPersistenceException( he ); } }
public void refresh(Object entity) { checkTransactionNeeded(); //adjustFlushMode(); try { if ( ! getSession().contains( entity ) ) { throw new IllegalArgumentException( "Entity not managed" ); } getSession().refresh( entity ); } catch (MappingException e) { throw new IllegalArgumentException( e.getMessage(), e ); } catch (HibernateException he) { throwPersistenceException( he ); } }
public Query createNamedQuery(String name) { //adjustFlushMode(); try { return new QueryImpl( getSession().getNamedQuery( name ), this ); } catch (HibernateException he) { throwPersistenceException( he ); return null; } }
public Query createNativeQuery(String sqlString, Class resultClass) { //adjustFlushMode(); try { SQLQuery q = getSession().createSQLQuery( sqlString ); q.addEntity( "alias1", resultClass.getName(), LockMode.READ ); return new QueryImpl( q, this ); } catch (HibernateException he) { throwPersistenceException( he ); return null; } }
public Query createNativeQuery(String sqlString) { //adjustFlushMode(); try { SQLQuery q = getSession().createSQLQuery( sqlString ); return new QueryImpl( q, this ); } catch (HibernateException he) { throwPersistenceException( he ); return null; } }
public Query createNativeQuery(String sqlString, Class resultClass) { //adjustFlushMode(); try { SQLQuery q = getSession().createSQLQuery( sqlString ); q.addEntity( "alias1", resultClass.getName(), LockMode.READ ); return new QueryImpl( q, this ); } catch (HibernateException he) { throwPersistenceException( he ); return null; } }
public Query createNativeQuery(String sqlString) { //adjustFlushMode(); try { SQLQuery q = getSession().createSQLQuery( sqlString ); return new QueryImpl( q, this ); } catch (HibernateException he) { throwPersistenceException( he ); return null; } }
public void persist(Object entity) { checkTransactionNeeded(); //adjustFlushMode(); try { getSession().persist( entity ); } catch (MappingException e) { throw new IllegalArgumentException( e.getMessage() ); } catch (HibernateException he) { throwPersistenceException( he ); } }
public void persist(Object entity) { checkTransactionNeeded(); //adjustFlushMode(); try { getSession().persist( entity ); } catch (MappingException e) { throw new IllegalArgumentException( e.getMessage() ); } catch (HibernateException he) { throwPersistenceException( he ); } }
public Query createNativeQuery(String sqlString, String resultSetMapping) { //adjustFlushMode(); try { SQLQuery q = getSession().createSQLQuery( sqlString ); q.setResultSetMapping( resultSetMapping ); return new QueryImpl( q, this ); } catch (HibernateException he) { throwPersistenceException( he ); return null; } }
public void refresh(Object entity) { checkTransactionNeeded(); //adjustFlushMode(); try { if ( ! getSession().contains( entity ) ) { throw new IllegalArgumentException( "Entity not managed" ); } getSession().refresh( entity ); } catch (MappingException e) { throw new IllegalArgumentException( e.getMessage(), e ); } catch (HibernateException he) { throwPersistenceException( he ); } }
public void lock(Object entity, LockModeType lockMode) { try { if ( ! isTransactionInProgress() ) { throw new TransactionRequiredException( "no transaction is in progress" ); } //adjustFlushMode(); if ( !contains( entity ) ) throw new IllegalArgumentException( "entity not in the persistence context" ); getSession().lock( entity, getLockMode( lockMode ) ); } catch (HibernateException he) { throwPersistenceException( he ); } }