@Override public RecordListenerProvider[] recordListenerProviders() { return delegate.recordListenerProviders(); }
private /* non-final */ List<R> records(Collection<P> objects, boolean forUpdate) { List<R> result = new ArrayList<R>(objects.size()); Field<?>[] pk = pk(); DSLContext ctx; // [#7731] Create a Record -> POJO mapping to allow for reusing the below // derived Configuration for improved reflection caching. IdentityHashMap<R, Object> mapping = null; // [#2536] Upon store(), insert(), update(), delete(), returned values in the record // are copied back to the relevant POJO using the RecordListener SPI if (!FALSE.equals(configuration.settings().isReturnRecordToPojo())) { mapping = new IdentityHashMap<R, Object>(); ctx = using(configuration.derive(providers(configuration.recordListenerProviders(), mapping))); } else { ctx = using(configuration); } for (P object : objects) { R record = ctx.newRecord(table, object); if (mapping != null) mapping.put(record, object); if (forUpdate && pk != null) for (Field<?> field : pk) record.changed(field, false); Tools.resetChangedOnNotNull(record); result.add(record); } return result; }
/** * Create a new "derived" configuration object from a pre-existing one. * <p> * This copies all properties from a pre-existing configuration into a new, * derived one. * * @param configuration The pre-existing configuration. */ DefaultConfiguration(Configuration configuration) { this( configuration.connectionProvider(), configuration.recordMapperProvider(), configuration.recordListenerProviders(), configuration.executeListenerProviders(), configuration.visitListenerProviders(), configuration.dialect(), configuration.settings(), configuration.data() ); }
providers = configuration.recordListenerProviders();
providers = configuration.recordListenerProviders();
/** * Create a new "derived" configuration object from a pre-existing one. * <p> * This copies all properties from a pre-existing configuration into a new, * derived one. * * @param configuration The pre-existing configuration. */ DefaultConfiguration(Configuration configuration) { this( configuration.connectionProvider(), configuration.metaProvider(), configuration.executorProvider(), configuration.transactionProvider(), configuration.recordMapperProvider(), configuration.recordUnmapperProvider(), configuration.recordListenerProviders(), configuration.executeListenerProviders(), configuration.visitListenerProviders(), configuration.transactionListenerProviders(), configuration.diagnosticsListenerProviders(), configuration.converterProvider(), configuration.clock(), configuration.dialect(), configuration.settings(), configuration.data() ); }