List of usage examples for org.hibernate StatelessSession insert
Serializable insert(Object entity);
From source file:vault.queryrouter.models.dao.JobQueueDAO.java
License:Apache License
public static Integer addQueryToJobQueue(StatelessSession session, String sql, TenantUpdateJobStatus status, String queryId, String connectionId, int tenantMppdbId) { TenantUpdateJob log = new TenantUpdateJob(sql, status.toString(), queryId, connectionId, TenantUpdateJobType.queryrouter, tenantMppdbId); return (Integer) session.insert(log); }
From source file:vault.queryrouter.models.dao.QueryDAO.java
License:Apache License
public static String addQueryLog(StatelessSession session, String queryId, String queryBody, Timestamp startTime, Timestamp endTime, String commandType, int userId, int tenantMppdbId, String queryStatus, String mppdbId, String connectionId) { Query log = new Query(queryId, queryBody, startTime, endTime, commandType, userId, tenantMppdbId, queryStatus, mppdbId, connectionId); return (String) session.insert(log); }
From source file:vn.edu.vnu.uet.fit.model.GenericModel.java
public void create(T entity) throws JDBCException, Exception { StatelessSession session = HibernateUtil.getSessionFactory().openStatelessSession(); Transaction trans = session.getTransaction(); try {//from www .ja v a2 s . com trans.begin(); session.insert(entity); //session.save(entity); trans.commit(); } catch (JDBCException ex) { trans.rollback(); throw ex; } catch (Exception ex) { trans.rollback(); throw ex; } session.close(); }