Example usage for org.hibernate StatelessSession insert

List of usage examples for org.hibernate StatelessSession insert

Introduction

In this page you can find the example usage for org.hibernate StatelessSession insert.

Prototype

Serializable insert(Object entity);

Source Link

Document

Insert a row.

Usage

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();
}