Package fi.evident.dalesbred

Examples of fi.evident.dalesbred.UnexpectedResultException


    public Map<K, V> process(@NotNull ResultSet resultSet) throws SQLException {
        Map<K,V> result = new LinkedHashMap<K,V>();

        NamedTypeList types = ResultSetUtils.getTypes(resultSet.getMetaData());
        if (types.size() != 2)
            throw new UnexpectedResultException("Expected ResultSet with 2 columns, but got " + types.size() + " columns.");

        TypeConversion<Object, K> keyConversion = getConversion(types.getType(0), keyType);
        TypeConversion<Object, V> valueConversion = getConversion(types.getType(1), valueType);

        while (resultSet.next()) {
View Full Code Here


            T value = ctor.instantiate(instantiatorArguments);
            if (value != null || allowNulls)
                result.add(value);
            else
                throw new UnexpectedResultException("Expected " + cl.getName() + ", but got null");
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of fi.evident.dalesbred.UnexpectedResultException

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.