@Override public <T> T openSession(ISessionExecutor<T> executor) throws Exception { return openSession(getDefaultConnectionHolder(), executor); }
public Entity update(boolean isExcluded, String... fieldFilter) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.update((Entity) this, fieldFilter, isExcluded); } finally { _session.close(); } }
@SuppressWarnings("unchecked") public Entity delete() throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.delete((Entity) this); } finally { _session.close(); } }
public <T> int[] deleteAll(Class<T> t, Object[] ids) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.deleteAll(t, ids); } finally { _session.close(); } }
public <T> List<T> findAll(String sql, IResultSetHandler<T> handler, Object[] params) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.findAll(sql, handler, params); } finally { _session.close(); } }
public <T> T update(T entity, String... fieldFilter) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.update(entity, fieldFilter); } finally { _session.close(); } }
public <T> List<T> updateAll(List<T> entities, String... fieldFilter) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.updateAll(entities, fieldFilter); } finally { _session.close(); } }
public <T> List<T> deleteAll(List<T> entities) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.deleteAll(entities); } finally { _session.close(); } }
public <T> PageResultSet<T> findAll(String sql, IResultSetHandler<T> handler, int pageSize, int page, boolean count, Object[] params) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.findAll(sql, handler, pageSize, page, count, params); } finally { _session.close(); } }
public int executeForUpdate(String sql, Object[] params) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.executeForUpdate(sql, params); } finally { _session.close(); } }
public <T, PK> T load(Class<T> t, PK id, String... fieldFilter) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.find(t, id, fieldFilter); } finally { _session.close(); } }
public <T> T save(T entity) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.insert(entity); } finally { _session.close(); } }
public <T> List<T> saveAll(List<T> entities) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.insertAll(entities); } finally { _session.close(); } }
public <T> T delete(T entity) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return _session.delete(entity); } finally { _session.close(); } }
public <T> PageResultSet<T> findAll(Class<T> t, String cond, Object[] params, int pageSize, int currentPage, boolean allowRecordCount, String... fieldFilter) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.findAll(t, cond, fieldFilter, pageSize, currentPage, allowRecordCount, params); } finally { _session.close(); } }
public int[] executeForUpdateAll(String sql, List<Object[]> params) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.executeForUpdateAll(sql, params); } finally { _session.close(); } }
public <T, PK> boolean delete(Class<T> t, PK pk) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(getDataSourceName()); try { return (_session.delete(t, pk) > 0); } finally { _session.close(); } }
public List<Entity> findAll(String cond, Object[] params, String... fieldFilter) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.findAll(this.getEntityClass(), cond, fieldFilter, params); } finally { _session.close(); } }
public Entity findFirst(String cond, Object[] params, String... fieldFilter) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.findFirst(this.getEntityClass(), cond, fieldFilter, params); } finally { _session.close(); } }
public PageResultSet<Entity> findAll(String cond, Object[] params, int pageSize, int currentPage, boolean allowRecordCount, String... fieldFilter) throws OperatorException, ConnectionException { ISession _session = JDBC.openSession(this.getDataSourceName()); try { return _session.findAll(this.getEntityClass(), cond, fieldFilter, pageSize, currentPage, allowRecordCount, params); } finally { _session.close(); } }