Search in sources :

Example 1 with PrepareKey

use of org.jdbi.v3.core.argument.internal.NamedArgumentFinderFactory.PrepareKey in project jdbi by jdbi.

the class PreparedBatch method bindNamedArgumentFinder.

@Override
PreparedBatch bindNamedArgumentFinder(NamedArgumentFinderFactory<?> factory, String prefix, Object value, Type type, Supplier<NamedArgumentFinder> backupArgumentFinder) {
    PreparedBinding binding = getBinding();
    PrepareKey key = factory.keyFor(prefix, value);
    preparedFinders.computeIfAbsent(key, pk -> factory.prepareFor(getConfig(), this::buildArgument, prefix, value, type));
    binding.prepareKeys.put(key, value);
    binding.backupArgumentFinders.add(backupArgumentFinder);
    return this;
}
Also used : PrepareKey(org.jdbi.v3.core.argument.internal.NamedArgumentFinderFactory.PrepareKey) PreparedBinding(org.jdbi.v3.core.statement.internal.PreparedBinding)

Aggregations

PrepareKey (org.jdbi.v3.core.argument.internal.NamedArgumentFinderFactory.PrepareKey)1 PreparedBinding (org.jdbi.v3.core.statement.internal.PreparedBinding)1