Package org.apache.openjpa.jdbc.meta

Examples of org.apache.openjpa.jdbc.meta.ValueHandler


        Row row, Column[] cols, ColumnIO io, boolean nullNone)
        throws SQLException {
        if (!canSetAny(row, io, cols))
            return;

        ValueHandler handler = vm.getHandler();
        val = handler.toDataStoreValue(vm, val, store);
        if (val == null) {
            for (int i = 0; i < cols.length; i++)
                if (canSet(row, io, i, true))
                    set(row, cols[i], null, handler, nullNone);
        } else if (cols.length == 1) {
View Full Code Here


     * Convert the given object to its datastore value(s). Relation ids are
     * converted to their final values immediately.
     */
    public static Object toDataStoreValue(ValueMapping vm, Object val,
        Column[] cols, JDBCStore store) {
        ValueHandler handler = vm.getHandler();
        val = handler.toDataStoreValue(vm, val, store);
        if (val == null) {
            if (cols.length > 1)
                return new Object[cols.length];
            return null;
        }
View Full Code Here

            Class<? extends ValueHandler> handler) {

        FieldMapping fmd = getFieldMapping(pcClass, field);
        FieldStrategy actualStrategy = ((FieldMapping) fmd).getStrategy();
        assertEquals(strategy, actualStrategy.getClass());
        ValueHandler actualHandler = fmd.getHandler();
        if (handler == null) {
            if (actualHandler != null) {
                printMapping(fmd);
                fail("Expected no value handler for " + pcClass.getName() + "." + field +
                        " but found " + actualHandler);
            }
        } else {
            if (actualHandler == null) {
                printMapping(fmd);
                fail("Expected a value handler for " + pcClass.getName() + "." + field + " but found null");
            }
            if (!handler.getClass().equals(actualHandler.getClass())) {
                printMapping(fmd);
                assertEquals(handler, fmd.getHandler().getClass());
            }
        }
    }
View Full Code Here

        Row row, Column[] cols, ColumnIO io, boolean nullNone)
        throws SQLException {
        if (!canSetAny(row, io, cols))
            return false;

        ValueHandler handler = vm.getHandler();
        val = handler.toDataStoreValue(vm, val, store);
        boolean isSet = false;
        if (val == null) {
            for (int i = 0; i < cols.length; i++)
                if (canSet(row, io, i, true)) {
                    isSet = true;
View Full Code Here

     * Convert the given object to its datastore value(s). Relation ids are
     * converted to their final values immediately.
     */
    public static Object toDataStoreValue(ValueMapping vm, Object val,
        Column[] cols, JDBCStore store) {
        ValueHandler handler = vm.getHandler();
        val = handler.toDataStoreValue(vm, val, store);
        if (val == null) {
            if (cols.length > 1)
                return new Object[cols.length];
            return null;
        }
View Full Code Here

        Row row, Column[] cols, ColumnIO io, boolean nullNone)
        throws SQLException {
        if (!canSetAny(row, io, cols))
            return false;

        ValueHandler handler = vm.getHandler();
        val = handler.toDataStoreValue(vm, val, store);
        boolean isSet = false;
        if (val == null) {
            for (int i = 0; i < cols.length; i++)
                if (canSet(row, io, i, true)) {
                    isSet = true;
View Full Code Here

     * Convert the given object to its datastore value(s). Relation ids are
     * converted to their final values immediately.
     */
    public static Object toDataStoreValue(ValueMapping vm, Object val,
        Column[] cols, JDBCStore store) {
        ValueHandler handler = vm.getHandler();
        val = handler.toDataStoreValue(vm, val, store);
        if (val == null) {
            if (cols.length > 1)
                return new Object[cols.length];
            return null;
        }
View Full Code Here

        Row row, Column[] cols, ColumnIO io, boolean nullNone)
        throws SQLException {
        if (!canSetAny(row, io, cols))
            return false;

        ValueHandler handler = vm.getHandler();
        val = handler.toDataStoreValue(vm, val, store);
        boolean isSet = false;
        if (val == null) {
            for (int i = 0; i < cols.length; i++)
                if (canSet(row, io, i, true)) {
                    isSet = true;
View Full Code Here

     * Convert the given object to its datastore value(s). Relation ids are
     * converted to their final values immediately.
     */
    public static Object toDataStoreValue(ValueMapping vm, Object val,
        Column[] cols, JDBCStore store) {
        ValueHandler handler = vm.getHandler();
        val = handler.toDataStoreValue(vm, val, store);
        if (val == null) {
            if (cols.length > 1)
                return new Object[cols.length];
            return null;
        }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.meta.ValueHandler

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.