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

com.kenshoo.jooq.TuplesTempTable 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.jooq;

import org.jooq.DataType;
import org.jooq.Record;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.impl.AbstractKeys;
import org.jooq.impl.TableImpl;

import java.util.ArrayList;
import java.util.Collection;

public class TuplesTempTable extends TableImpl {

    public final Collection> fields = new ArrayList<>();

    public TuplesTempTable() {
        super("tmp_ids");
    }

    public  TableField addField(String name, DataType dataType) {
        TableField field = super.createField(name, dataType);
        fields.add(field);
        return field;
    }

    @Override
    public UniqueKey getPrimaryKey() {
        return new PrimaryKey().getPK();
    }

    private class PrimaryKey extends AbstractKeys {
        @SuppressWarnings("unchecked")
        UniqueKey getPK() {
            return createUniqueKey(TuplesTempTable.this, fields.toArray(new TableField[fields.size()]));
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy