use of org.datanucleus.store.types.containers.ContainerAdapter in project datanucleus-rdbms by datanucleus.
the class SingleCollectionMapping method setObject.
@Override
public void setObject(ExecutionContext ec, PreparedStatement ps, int[] pos, Object container) {
Object value = null;
if (container != null) {
ElementContainerHandler containerHandler = ec.getTypeManager().getContainerHandler(mmd.getType());
ContainerAdapter containerAdapter = containerHandler.getAdapter(container);
Iterator iterator = containerAdapter.iterator();
value = iterator.hasNext() ? iterator.next() : null;
}
wrappedMapping.setObject(ec, ps, pos, value);
}
Aggregations