Package org.springframework.orm.ibatis

Examples of org.springframework.orm.ibatis.SqlMapClientCallback


        try {
            if (isPartitioningBehaviorEnabled()) {
                SortedMap<String, DataSource> dsMap = lookupDataSourcesByRouter(statementName,
                        parameterObject);
                if (!MapUtils.isEmpty(dsMap)) {
                    SqlMapClientCallback callback = null;
                    if (skipResults == null || maxResults == null) {
                        callback = new SqlMapClientCallback() {
                            public Object doInSqlMapClient(SqlMapExecutor executor)
                                    throws SQLException {
                                return executor.queryForList(statementName, parameterObject);
                            }
                        };
                    } else {
                        callback = new SqlMapClientCallback() {
                            public Object doInSqlMapClient(SqlMapExecutor executor)
                                    throws SQLException {
                                return executor.queryForList(statementName, parameterObject,
                                        skipResults, maxResults);
                            }
View Full Code Here


        try {
            if (isPartitioningBehaviorEnabled()) {
                SortedMap<String, DataSource> dsMap = lookupDataSourcesByRouter(statementName,
                        parameterObject);
                if (!MapUtils.isEmpty(dsMap)) {
                    SqlMapClientCallback callback = null;
                    if (valueProperty != null) {
                        callback = new SqlMapClientCallback() {
                            public Object doInSqlMapClient(SqlMapExecutor executor)
                                    throws SQLException {
                                return executor.queryForMap(statementName, parameterObject,
                                        keyProperty, valueProperty);
                            }
                        };
                    } else {
                        callback = new SqlMapClientCallback() {
                            public Object doInSqlMapClient(SqlMapExecutor executor)
                                    throws SQLException {
                                return executor.queryForMap(statementName, parameterObject,
                                        keyProperty);
                            }
View Full Code Here

        try {
            if (isPartitioningBehaviorEnabled()) {
                SortedMap<String, DataSource> dsMap = lookupDataSourcesByRouter(statementName,
                        parameterObject);
                if (!MapUtils.isEmpty(dsMap)) {
                    SqlMapClientCallback callback = null;
                    if (resultObject == null) {
                        callback = new SqlMapClientCallback() {
                            public Object doInSqlMapClient(SqlMapExecutor executor)
                                    throws SQLException {
                                return executor.queryForObject(statementName, parameterObject);
                            }
                        };
                    } else {
                        callback = new SqlMapClientCallback() {
                            public Object doInSqlMapClient(SqlMapExecutor executor)
                                    throws SQLException {
                                return executor.queryForObject(statementName, parameterObject,
                                        resultObject);
                            }
View Full Code Here

        try {
            if (isPartitioningBehaviorEnabled()) {
                SortedMap<String, DataSource> dsMap = lookupDataSourcesByRouter(statementName,
                        parameterObject);
                if (!MapUtils.isEmpty(dsMap)) {
                    SqlMapClientCallback callback = null;
                    if (parameterObject == null) {
                        callback = new SqlMapClientCallback() {

                            public Object doInSqlMapClient(SqlMapExecutor executor)
                                    throws SQLException {
                                executor.queryWithRowHandler(statementName, rowHandler);
                                return null;
                            }
                        };
                    } else {
                        callback = new SqlMapClientCallback() {

                            public Object doInSqlMapClient(SqlMapExecutor executor)
                                    throws SQLException {
                                executor.queryWithRowHandler(statementName, parameterObject,
                                        rowHandler);
View Full Code Here

            if (isPartitioningBehaviorEnabled()) {
                SortedMap<String, DataSource> dsMap = lookupDataSourcesByRouter(statementName,
                        parameterObject);
                if (!MapUtils.isEmpty(dsMap)) {

                    SqlMapClientCallback action = new SqlMapClientCallback() {
                        public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
                            return executor.update(statementName, parameterObject);
                        }
                    };
View Full Code Here

        List<Future<Object>> futures = new ArrayList<Future<Object>>();
        try {

            for (RequestDepository rdepo : requestsDepo) {
                ConcurrentRequest request = rdepo.getOriginalRequest();
                final SqlMapClientCallback action = request.getAction();
                final Connection connection = rdepo.getConnectionToUse();

                futures.add(request.getExecutor().submit(new Callable<Object>() {
                    public Object call() throws Exception {
                        try {
View Full Code Here

     * )} don't support partitioning behaviors, we can unit test them together
     * and use one of them as their representation.
     */
    public void testExecutePrefixMethodsOnCobarSqlMapClientTemplate() {

        getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
            public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
                Follower f = new Follower("fname");
                return executor.insert("com.alibaba.cobar.client.entities.Follower.create", f);
            }
        });
View Full Code Here

TOP

Related Classes of org.springframework.orm.ibatis.SqlMapClientCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.