Package com.quickorm.dao

Examples of com.quickorm.dao.DataAccessException


        EntityMetaData entityMetaData = getEntityMetaData(entityClass);
        //得到SQL语句与参数
        SqlAndArgumentsData sqlAndArgumentsData = entityMetaData.getInsertSqlAndArgumentData(t, dialect);
        int rowCount = this.executeUpdate(sqlAndArgumentsData.getSql(), sqlAndArgumentsData.getArgumentList(), null);
        if (rowCount <= 0) {
            throw new DataAccessException("更改的数据行数为0!");
        }
    }
View Full Code Here


        SqlAndArgumentsData sqlAndArgumentsData = entityMetaData.getBatchInsertSqlAndArgumentData(tList, dialect);
        int[] rowCountArray = this.executeBatchUpdate(sqlAndArgumentsData.getSql(), sqlAndArgumentsData.getArgumentListList());
        for (int i = 0; i <= rowCountArray.length - 1; i++) {
            int rowCount = rowCountArray[i];
            if (rowCount <= 0) {
                throw new DataAccessException(String.format("第%s行更改的数据行数为0!", i));
            }
        }
    }
View Full Code Here

        argumentList.add(entityMetaData.getPrimaryKeyValue(t));

        String sql = sb.toString();
        int rowCount = this.executeUpdate(sql, argumentList, null);
        if (rowCount <= 0) {
            throw new DataAccessException("更改的数据行数为0!");
        }
    }
View Full Code Here

        List<Object> argumentList = new LinkedList<Object>();
        argumentList.add(id);

        int rowCount = this.executeUpdate(sql, argumentList, null);
        if (rowCount <= 0) {
            throw new DataAccessException("更改的数据行数为0!");
        }
    }
View Full Code Here

        return null;
    }

    //处理异常
    private void HandleException(Throwable ex, String sql) {
        DataAccessException dae = new DataAccessException();
        dae.initCause(ex);
        dae.setSql(sql);
        throw dae;
    }
View Full Code Here

TOP

Related Classes of com.quickorm.dao.DataAccessException

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.