001/*
002 * This file is generated by jOOQ.
003 */
004package com.echothree.model.jooq.server.tables.warehouse;
005
006
007import com.echothree.model.data.party.common.pk.PartyPK;
008import com.echothree.model.data.warehouse.common.pk.WarehousePK;
009import com.echothree.model.data.warehouse.common.pk.WarehouseTypePK;
010import com.echothree.model.jooq.server.KeyRegistry;
011import com.echothree.model.jooq.server.tables.party.Parties.PartiesPath;
012import com.echothree.model.jooq.server.tables.warehouse.WarehouseTypes.WarehouseTypesPath;
013
014import java.util.Arrays;
015import java.util.Collection;
016import java.util.List;
017
018import org.jooq.Condition;
019import org.jooq.Converter;
020import org.jooq.Field;
021import org.jooq.ForeignKey;
022import org.jooq.Name;
023import org.jooq.PlainSQL;
024import org.jooq.QueryPart;
025import org.jooq.SQL;
026import org.jooq.Stringly;
027import org.jooq.Table;
028import org.jooq.TableField;
029import org.jooq.TableLike;
030import org.jooq.TableOptions;
031import org.jooq.UniqueKey;
032import org.jooq.impl.DSL;
033import org.jooq.impl.Internal;
034import org.jooq.impl.SQLDataType;
035import org.jooq.impl.TableImpl;
036
037
038/**
039 * This class is generated by jOOQ.
040 */
041@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" })
042public class Warehouses extends TableImpl<com.echothree.model.jooq.server.records.warehouse.Warehouses> {
043
044    private static final long serialVersionUID = 1L;
045
046    /**
047     * The reference instance of <code>warehouses</code>
048     */
049    public static final Warehouses Warehouses = new Warehouses();
050
051    /**
052     * The class holding records for this type
053     */
054    @Override
055    public Class<com.echothree.model.jooq.server.records.warehouse.Warehouses> getRecordType() {
056        return com.echothree.model.jooq.server.records.warehouse.Warehouses.class;
057    }
058
059    /**
060     * The column <code>warehouses.whse_warehouseid</code>.
061     */
062    public final TableField<com.echothree.model.jooq.server.records.warehouse.Warehouses, WarehousePK> WAREHOUSE = createField(DSL.name("whse_warehouseid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, WarehousePK.class, id -> new com.echothree.model.data.warehouse.common.pk.WarehousePK(id), primaryKey -> primaryKey.getEntityId()));
063
064    /**
065     * The column <code>warehouses.whse_par_partyid</code>.
066     */
067    public final TableField<com.echothree.model.jooq.server.records.warehouse.Warehouses, PartyPK> PARTY = createField(DSL.name("whse_par_partyid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, PartyPK.class, id -> new com.echothree.model.data.party.common.pk.PartyPK(id), primaryKey -> primaryKey.getEntityId()));
068
069    /**
070     * The column <code>warehouses.whse_warehousename</code>.
071     */
072    public final TableField<com.echothree.model.jooq.server.records.warehouse.Warehouses, String> WAREHOUSE_NAME = createField(DSL.name("whse_warehousename"), SQLDataType.VARCHAR(40).nullable(false), this, "");
073
074    /**
075     * The column <code>warehouses.whse_whsetyp_warehousetypeid</code>.
076     */
077    public final TableField<com.echothree.model.jooq.server.records.warehouse.Warehouses, WarehouseTypePK> WAREHOUSE_TYPE = createField(DSL.name("whse_whsetyp_warehousetypeid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, WarehouseTypePK.class, id -> new com.echothree.model.data.warehouse.common.pk.WarehouseTypePK(id), primaryKey -> primaryKey.getEntityId()));
078
079    /**
080     * The column <code>warehouses.whse_isdefault</code>.
081     */
082    public final TableField<com.echothree.model.jooq.server.records.warehouse.Warehouses, Boolean> IS_DEFAULT = createField(DSL.name("whse_isdefault"), SQLDataType.BIT.nullable(false), this, "");
083
084    /**
085     * The column <code>warehouses.whse_sortorder</code>.
086     */
087    public final TableField<com.echothree.model.jooq.server.records.warehouse.Warehouses, Integer> SORT_ORDER = createField(DSL.name("whse_sortorder"), SQLDataType.INTEGER.nullable(false), this, "");
088
089    /**
090     * The column <code>warehouses.whse_fromtime</code>.
091     */
092    public final TableField<com.echothree.model.jooq.server.records.warehouse.Warehouses, Long> FROM_TIME = createField(DSL.name("whse_fromtime"), SQLDataType.BIGINT.nullable(false), this, "");
093
094    /**
095     * The column <code>warehouses.whse_thrutime</code>.
096     */
097    public final TableField<com.echothree.model.jooq.server.records.warehouse.Warehouses, Long> THRU_TIME = createField(DSL.name("whse_thrutime"), SQLDataType.BIGINT.nullable(false), this, "");
098
099    private Warehouses(Name alias, Table<com.echothree.model.jooq.server.records.warehouse.Warehouses> aliased) {
100        this(alias, aliased, (Field<?>[]) null, null);
101    }
102
103    private Warehouses(Name alias, Table<com.echothree.model.jooq.server.records.warehouse.Warehouses> aliased, Field<?>[] parameters, Condition where) {
104        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
105    }
106
107    /**
108     * Create an aliased <code>warehouses</code> table reference
109     */
110    public Warehouses(String alias) {
111        this(DSL.name(alias), Warehouses);
112    }
113
114    /**
115     * Create an aliased <code>warehouses</code> table reference
116     */
117    public Warehouses(Name alias) {
118        this(alias, Warehouses);
119    }
120
121    /**
122     * Create a <code>warehouses</code> table reference
123     */
124    public Warehouses() {
125        this(DSL.name("warehouses"), null);
126    }
127
128    @Override
129    public UniqueKey<com.echothree.model.jooq.server.records.warehouse.Warehouses> getPrimaryKey() {
130        return KeyRegistry.WAREHOUSES_PK;
131    }
132
133    @Override
134    public List<UniqueKey<com.echothree.model.jooq.server.records.warehouse.Warehouses>> getUniqueKeys() {
135        return Arrays.asList(KeyRegistry.WAREHOUSES_PARTY_AND_THRU_TIME_UK, KeyRegistry.WAREHOUSES_WAREHOUSE_NAME_AND_THRU_TIME_UK);
136    }
137
138    @Override
139    public List<ForeignKey<com.echothree.model.jooq.server.records.warehouse.Warehouses, ?>> getReferences() {
140        return Arrays.asList(KeyRegistry.WAREHOUSES_PARTY_FK, KeyRegistry.WAREHOUSES_WAREHOUSE_TYPE_FK);
141    }
142
143    private transient PartiesPath _whse_par_partyid_fk;
144
145    /**
146     * Get the implicit join path to the <code>parties</code> table.
147     */
148    public PartiesPath whse_par_partyid_fk() {
149        if (_whse_par_partyid_fk == null)
150            _whse_par_partyid_fk = new PartiesPath(this, KeyRegistry.WAREHOUSES_PARTY_FK, null);
151
152        return _whse_par_partyid_fk;
153    }
154
155    private transient WarehouseTypesPath _whse_whsetyp_warehousetypeid_fk;
156
157    /**
158     * Get the implicit join path to the <code>warehousetypes</code> table.
159     */
160    public WarehouseTypesPath whse_whsetyp_warehousetypeid_fk() {
161        if (_whse_whsetyp_warehousetypeid_fk == null)
162            _whse_whsetyp_warehousetypeid_fk = new WarehouseTypesPath(this, KeyRegistry.WAREHOUSES_WAREHOUSE_TYPE_FK, null);
163
164        return _whse_whsetyp_warehousetypeid_fk;
165    }
166
167    @Override
168    public Warehouses as(String alias) {
169        return new Warehouses(DSL.name(alias), this);
170    }
171
172    @Override
173    public Warehouses as(Name alias) {
174        return new Warehouses(alias, this);
175    }
176
177    @Override
178    public Warehouses as(Table<?> alias) {
179        return new Warehouses(alias.getQualifiedName(), this);
180    }
181
182    /**
183     * Rename this table
184     */
185    @Override
186    public Warehouses rename(String name) {
187        return new Warehouses(DSL.name(name), null);
188    }
189
190    /**
191     * Rename this table
192     */
193    @Override
194    public Warehouses rename(Name name) {
195        return new Warehouses(name, null);
196    }
197
198    /**
199     * Rename this table
200     */
201    @Override
202    public Warehouses rename(Table<?> name) {
203        return new Warehouses(name.getQualifiedName(), null);
204    }
205
206    /**
207     * Create an inline derived table from this table
208     */
209    @Override
210    public Warehouses where(Condition condition) {
211        return new Warehouses(getQualifiedName(), aliased() ? this : null, null, Internal.condition(this, condition));
212    }
213
214    /**
215     * Create an inline derived table from this table
216     */
217    @Override
218    public Warehouses where(Collection<? extends Condition> conditions) {
219        return where(DSL.and(conditions));
220    }
221
222    /**
223     * Create an inline derived table from this table
224     */
225    @Override
226    public Warehouses where(Condition... conditions) {
227        return where(DSL.and(conditions));
228    }
229
230    /**
231     * Create an inline derived table from this table
232     */
233    @Override
234    public Warehouses where(Field<Boolean> condition) {
235        return where(DSL.condition(condition));
236    }
237
238    /**
239     * Create an inline derived table from this table
240     */
241    @Override
242    @PlainSQL
243    public Warehouses where(SQL condition) {
244        return where(DSL.condition(condition));
245    }
246
247    /**
248     * Create an inline derived table from this table
249     */
250    @Override
251    @PlainSQL
252    public Warehouses where(@Stringly.SQL String condition) {
253        return where(DSL.condition(condition));
254    }
255
256    /**
257     * Create an inline derived table from this table
258     */
259    @Override
260    @PlainSQL
261    public Warehouses where(@Stringly.SQL String condition, Object... binds) {
262        return where(DSL.condition(condition, binds));
263    }
264
265    /**
266     * Create an inline derived table from this table
267     */
268    @Override
269    @PlainSQL
270    public Warehouses where(@Stringly.SQL String condition, QueryPart... parts) {
271        return where(DSL.condition(condition, parts));
272    }
273
274    /**
275     * Create an inline derived table from this table
276     */
277    @Override
278    public Warehouses whereExists(TableLike<?> select) {
279        return where(DSL.exists(select));
280    }
281
282    /**
283     * Create an inline derived table from this table
284     */
285    @Override
286    public Warehouses whereNotExists(TableLike<?> select) {
287        return where(DSL.notExists(select));
288    }
289}