public SqlMapClientImplWrapper(SqlMapClientImpl raw) { super(raw.getDelegate()); this.raw = raw; }
public void setLocal(String id, SqlMapExecutor executor) { IbatisStatementInfo stmtInfo = statementInfoMap.get(id); if (stmtInfo != null) { JdbcSqlStat.setContextSqlName(stmtInfo.getId()); JdbcSqlStat.setContextSqlFile(stmtInfo.getResource()); return; } Object statement = null; if (executor instanceof SqlMapSessionImpl) { statement = ((SqlMapSessionImpl) executor).getMappedStatement(id); } if (executor instanceof SqlMapClientImpl) { statement = ((SqlMapClientImpl) executor).getMappedStatement(id); } if (statement == null) { return; } String stmtId = IbatisUtils.getId(statement); String stmtResource = IbatisUtils.getResource(statement); stmtInfo = new IbatisStatementInfo(stmtId, stmtResource); statementInfoMap.putIfAbsent(id, stmtInfo); JdbcSqlStat.setContextSqlName(stmtId); JdbcSqlStat.setContextSqlFile(stmtResource); }
public SqlMapSession openSession(Connection conn) { SqlMapSession session = raw.openSession(conn); IbatisUtils.setClientImpl(session, this); return new SqlMapSessionWrapper(raw, session); }
public void endTransaction() throws SQLException { try { getLocalSqlMapSession().endTransaction(); } finally { getLocalSqlMapSession().close(); } }
/** * Loads a result lazily * * @param client - the client creating the object * @param statementName - the name of the statement to be used * @param parameterObject - the parameters for the statement * @param targetType - the target type of the result * @return the loaded result * @throws SQLException */ public static Object loadResult(SqlMapClientImpl client, String statementName, Object parameterObject, Class targetType) throws SQLException { Object value = null; if (client.isLazyLoadingEnabled()) { if (client.isEnhancementEnabled()) { EnhancedLazyResultLoader lazy = new EnhancedLazyResultLoader(client, statementName, parameterObject, targetType); value = lazy.loadResult(); } else { LazyResultLoader lazy = new LazyResultLoader(client, statementName, parameterObject, targetType); value = lazy.loadResult(); } } else { value = getResult(client, statementName, parameterObject, targetType); } return value; }
/** * TODO Deprecated * * @return Current connection * @throws SQLException * @deprecated */ public Connection getUserConnection() throws SQLException { return getCurrentConnection(); }
private void setupResultObjectFactory(StatementScope statementScope) { SqlMapClientImpl client = (SqlMapClientImpl) statementScope.getSession().getSqlMapClient(); ResultObjectFactoryUtil.setResultObjectFactory(client.getResultObjectFactory()); ResultObjectFactoryUtil.setStatementId(statementScope.getStatement().getId()); } }
public SqlMapConfiguration() { errorContext = new ErrorContext(); delegate = new SqlMapExecutorDelegate(); typeHandlerFactory = delegate.getTypeHandlerFactory(); client = new SqlMapClientImpl(delegate); registerDefaultTypeAliases(); }
public SqlExecutor getSqlExecutor() { return sqlMapClient.getSqlExecutor(); }
/** * @deprecated All paginated list features have been deprecated */ public PaginatedList queryForPaginatedList(String id, int pageSize) throws SQLException { return getLocalSqlMapSession().queryForPaginatedList(id, pageSize); }
/** * Loads a result lazily * * @param client - the client creating the object * @param statementName - the name of the statement to be used * @param parameterObject - the parameters for the statement * @param targetType - the target type of the result * @return the loaded result * @throws SQLException */ public static Object loadResult(SqlMapClientImpl client, String statementName, Object parameterObject, Class targetType) throws SQLException { Object value = null; if (client.isLazyLoadingEnabled()) { if (client.isEnhancementEnabled()) { EnhancedLazyResultLoader lazy = new EnhancedLazyResultLoader(client, statementName, parameterObject, targetType); value = lazy.loadResult(); } else { LazyResultLoader lazy = new LazyResultLoader(client, statementName, parameterObject, targetType); value = lazy.loadResult(); } } else { value = getResult(client, statementName, parameterObject, targetType); } return value; }
/** * TODO Deprecated * * @return Current connection * @throws SQLException * @deprecated */ public Connection getUserConnection() throws SQLException { return getCurrentConnection(); }
private void setupResultObjectFactory(StatementScope statementScope) { SqlMapClientImpl client = (SqlMapClientImpl) statementScope.getSession().getSqlMapClient(); ResultObjectFactoryUtil.setResultObjectFactory(client.getResultObjectFactory()); ResultObjectFactoryUtil.setStatementId(statementScope.getStatement().getId()); } }
public SqlMapConfiguration() { errorContext = new ErrorContext(); delegate = new SqlMapExecutorDelegate(); typeHandlerFactory = delegate.getTypeHandlerFactory(); client = new SqlMapClientImpl(delegate); registerDefaultTypeAliases(); }
public SqlExecutor getSqlExecutor() { return sqlMapClient.getSqlExecutor(); }
public SqlMapClientImplWrapper(SqlMapClientImpl raw) { super(raw.getDelegate()); this.raw = raw; }
/** * @deprecated All paginated list features have been deprecated */ public PaginatedList queryForPaginatedList(String id, Object paramObject, int pageSize) throws SQLException { return getLocalSqlMapSession().queryForPaginatedList(id, paramObject, pageSize); }
public void setLocal(String id, SqlMapExecutor executor) { IbatisStatementInfo stmtInfo = statementInfoMap.get(id); if (stmtInfo != null) { JdbcSqlStat.setContextSqlName(stmtInfo.getId()); JdbcSqlStat.setContextSqlFile(stmtInfo.getResource()); return; } Object statement = null; if (executor instanceof SqlMapSessionImpl) { statement = ((SqlMapSessionImpl) executor).getMappedStatement(id); } if (executor instanceof SqlMapClientImpl) { statement = ((SqlMapClientImpl) executor).getMappedStatement(id); } if (statement == null) { return; } String stmtId = IbatisUtils.getId(statement); String stmtResource = IbatisUtils.getResource(statement); stmtInfo = new IbatisStatementInfo(stmtId, stmtResource); statementInfoMap.putIfAbsent(id, stmtInfo); JdbcSqlStat.setContextSqlName(stmtId); JdbcSqlStat.setContextSqlFile(stmtResource); }
public SqlMapSession openSession(Connection conn) { SqlMapSession session = raw.openSession(conn); IbatisUtils.setClientImpl(session, this); return new SqlMapSessionWrapper(raw, session); }
public void setForceMultipleResultSetSupport(boolean forceMultipleResultSetSupport) { client.getDelegate().setForceMultipleResultSetSupport(forceMultipleResultSetSupport); }