com.kenshoo.pl.data.DeleteRecordCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persistence-layer Show documentation
Show all versions of persistence-layer Show documentation
A Java persistence layer based on JOOQ for high performance and business flow support.
package com.kenshoo.pl.data;
import com.kenshoo.jooq.DataTable;
import org.jooq.Field;
import org.jooq.Record;
import org.jooq.TableField;
public class DeleteRecordCommand extends AbstractRecordCommand {
private final DatabaseId id;
public DeleteRecordCommand(DataTable table, DatabaseId id) {
super(table);
this.id = id;
}
/**
* Convenience constructor for tables with integer ID
*/
public DeleteRecordCommand(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 DeleteRecordCommand(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;
}
@Override
public void set(Field field, T value) {
throw new UnsupportedOperationException("Setting a field is not supported for a delete command");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy