All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kenshoo.pl.data.UpdateRecordCommand Maven / Gradle / Ivy

Go to download

A Java persistence layer based on JOOQ for high performance and business flow support.

There is a newer version: 0.1.121-jooq-3.16.3
Show newest version
package com.kenshoo.pl.data;


import com.kenshoo.jooq.DataTable;
import org.jooq.Record;
import org.jooq.TableField;

public class UpdateRecordCommand extends AbstractRecordCommand {

    private final DatabaseId id;

    public UpdateRecordCommand(DataTable table, DatabaseId id) {
        super(table);
        this.id = id;
    }

    /**
     * Convenience constructor for tables with integer ID
     */
    public UpdateRecordCommand(DataTable table, int id) {
        super(table);
        TableField primaryKeyField = getPrimaryKeyField(table, Integer.class);
        //noinspection unchecked
        this.id = DatabaseId.create((TableField) primaryKeyField, id);
    }

    /**
     * Convenience constructor for tables with bigint ID
     */
    public UpdateRecordCommand(DataTable table, long id) {
        super(table);
        TableField primaryKeyField = getPrimaryKeyField(table, Long.class);
        //noinspection unchecked
        this.id = DatabaseId.create((TableField) primaryKeyField, id);
    }

    public DatabaseId getId() {
        return id;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy