Search in sources :

Example 1 with RecordContext

use of org.jooq.RecordContext in project jOOQ by jOOQ.

the class DAOImpl method providers.

private RecordListenerProvider[] providers(final RecordListenerProvider[] providers, final Object object) {
    RecordListenerProvider[] result = Arrays.copyOf(providers, providers.length + 1);
    result[providers.length] = new DefaultRecordListenerProvider(new DefaultRecordListener() {

        private final void end(RecordContext ctx) {
            Record record = ctx.record();
            // TODO: [#2536] Use mapper()
            if (record != null)
                record.into(object);
        }

        @Override
        public final void storeEnd(RecordContext ctx) {
            end(ctx);
        }

        @Override
        public final void insertEnd(RecordContext ctx) {
            end(ctx);
        }

        @Override
        public final void updateEnd(RecordContext ctx) {
            end(ctx);
        }

        @Override
        public final void deleteEnd(RecordContext ctx) {
            end(ctx);
        }
    });
    return result;
}
Also used : RecordContext(org.jooq.RecordContext) RecordListenerProvider(org.jooq.RecordListenerProvider) UpdatableRecord(org.jooq.UpdatableRecord) Record(org.jooq.Record)

Aggregations

Record (org.jooq.Record)1 RecordContext (org.jooq.RecordContext)1 RecordListenerProvider (org.jooq.RecordListenerProvider)1 UpdatableRecord (org.jooq.UpdatableRecord)1