Package net.canarymod.database.exceptions

Examples of net.canarymod.database.exceptions.DatabaseAccessException


    public final void load(HashMap<String, Object> dataSet) throws DatabaseAccessException {
        try {
            applyDataSet(dataSet);
        }
        catch (IllegalAccessException e) {
            throw new DatabaseAccessException(e.getMessage());
        }
        catch (IllegalArgumentException e) {
            throw new DatabaseAccessException(e.getMessage());
        }
        if (dataSet.size() > 0) {
            hasData = true;
        }
        isLoaded = true;
View Full Code Here


            if (col == null) {
                continue;
            }
            if (!dataSet.containsKey(col.columnName())) {
                isInconsistent = true;
                throw new DatabaseAccessException("Cannot apply data to " + getClass().getSimpleName() + ". Column name mismatches! (" + col.columnName() + " does not exist) - " + dataSet.keySet().toString());
            }
            field.set(this, dataSet.get(col.columnName()));
            columnFields++;
        }
        // If the columnFields is not the size of the dataSet,
        // There is either excess data or data that has not been put in the AccessObject.
        // This causes inconsistency and therefore must throw an exception
        if (columnFields != dataSet.size()) {
            isInconsistent = true;
            throw new DatabaseAccessException("Supplied Data set cannot be applied to this DataAccess(" + getClass().getSimpleName() + "). Column count mismatches!");
        }
    }
View Full Code Here

TOP

Related Classes of net.canarymod.database.exceptions.DatabaseAccessException

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.