Package de.zalando.sprocwrapper.proxy

Source Code of de.zalando.sprocwrapper.proxy.MapStoredProcedureParameter

package de.zalando.sprocwrapper.proxy;

import java.lang.reflect.Method;

import java.sql.Connection;

import java.util.Map;

import de.zalando.typemapper.postgres.HStore;

public class MapStoredProcedureParameter extends StoredProcedureParameter {

    public MapStoredProcedureParameter(final Class<?> clazz, final Method m, final String typeName, final int sqlType,
            final int javaPosition, final boolean sensitive) {
        super(clazz, m, typeName, sqlType, javaPosition, sensitive);
    }

    @Override
    public Object mapParam(final Object value, final Connection connection) {
        if (value == null) {
            return null;
        }

        return new HStore((Map<?, ?>) value);
    }

}
TOP

Related Classes of de.zalando.sprocwrapper.proxy.MapStoredProcedureParameter

TOP
Copyright © 2018 www.massapi.com. 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.