
de.zalando.sprocwrapper.proxy.MapStoredProcedureParameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zalando-sprocwrapper Show documentation
Show all versions of zalando-sprocwrapper Show documentation
Library to make PostgreSQL stored procedures available through simple Java "*SProcService" interfaces
including automatic object serialization and deserialization (using typemapper and
convention-over-configuration). Supports sharding, advisory locking, statement timeouts and PostgreSQL types
such as enums and hstore.
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);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy