001/*
002 * This file is generated by jOOQ.
003 */
004package com.echothree.model.jooq.server.tables.order;
005
006
007import com.echothree.model.data.accounting.common.pk.CurrencyPK;
008import com.echothree.model.data.cancellationpolicy.common.pk.CancellationPolicyPK;
009import com.echothree.model.data.order.common.pk.OrderDetailPK;
010import com.echothree.model.data.order.common.pk.OrderPK;
011import com.echothree.model.data.order.common.pk.OrderPriorityPK;
012import com.echothree.model.data.order.common.pk.OrderTypePK;
013import com.echothree.model.data.returnpolicy.common.pk.ReturnPolicyPK;
014import com.echothree.model.data.shipment.common.pk.FreeOnBoardPK;
015import com.echothree.model.data.term.common.pk.TermPK;
016import com.echothree.model.jooq.server.KeyRegistry;
017import com.echothree.model.jooq.server.tables.accounting.Currencies.CurrenciesPath;
018import com.echothree.model.jooq.server.tables.cancellationpolicy.CancellationPolicies.CancellationPoliciesPath;
019import com.echothree.model.jooq.server.tables.order.OrderPriorities.OrderPrioritiesPath;
020import com.echothree.model.jooq.server.tables.order.OrderTypes.OrderTypesPath;
021import com.echothree.model.jooq.server.tables.order.Orders.OrdersPath;
022import com.echothree.model.jooq.server.tables.returnpolicy.ReturnPolicies.ReturnPoliciesPath;
023import com.echothree.model.jooq.server.tables.shipment.FreeOnBoards.FreeOnBoardsPath;
024import com.echothree.model.jooq.server.tables.term.Terms.TermsPath;
025
026import java.util.Arrays;
027import java.util.Collection;
028import java.util.List;
029
030import org.jooq.Condition;
031import org.jooq.Converter;
032import org.jooq.Field;
033import org.jooq.ForeignKey;
034import org.jooq.InverseForeignKey;
035import org.jooq.Name;
036import org.jooq.Path;
037import org.jooq.PlainSQL;
038import org.jooq.QueryPart;
039import org.jooq.Record;
040import org.jooq.SQL;
041import org.jooq.Stringly;
042import org.jooq.Table;
043import org.jooq.TableField;
044import org.jooq.TableLike;
045import org.jooq.TableOptions;
046import org.jooq.UniqueKey;
047import org.jooq.impl.DSL;
048import org.jooq.impl.Internal;
049import org.jooq.impl.SQLDataType;
050import org.jooq.impl.TableImpl;
051
052
053/**
054 * This class is generated by jOOQ.
055 */
056@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" })
057public class OrderDetails extends TableImpl<com.echothree.model.jooq.server.records.order.OrderDetails> {
058
059    private static final long serialVersionUID = 1L;
060
061    /**
062     * The reference instance of <code>orderdetails</code>
063     */
064    public static final OrderDetails OrderDetails = new OrderDetails();
065
066    /**
067     * The class holding records for this type
068     */
069    @Override
070    public Class<com.echothree.model.jooq.server.records.order.OrderDetails> getRecordType() {
071        return com.echothree.model.jooq.server.records.order.OrderDetails.class;
072    }
073
074    /**
075     * The column <code>orderdetails.orddt_orderdetailid</code>.
076     */
077    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, OrderDetailPK> ORDER_DETAIL = createField(DSL.name("orddt_orderdetailid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, OrderDetailPK.class, id -> new com.echothree.model.data.order.common.pk.OrderDetailPK(id), primaryKey -> primaryKey.getEntityId()));
078
079    /**
080     * The column <code>orderdetails.orddt_ord_orderid</code>.
081     */
082    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, OrderPK> ORDER = createField(DSL.name("orddt_ord_orderid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, OrderPK.class, id -> new com.echothree.model.data.order.common.pk.OrderPK(id), primaryKey -> primaryKey.getEntityId()));
083
084    /**
085     * The column <code>orderdetails.orddt_ordtyp_ordertypeid</code>.
086     */
087    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, OrderTypePK> ORDER_TYPE = createField(DSL.name("orddt_ordtyp_ordertypeid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, OrderTypePK.class, id -> new com.echothree.model.data.order.common.pk.OrderTypePK(id), primaryKey -> primaryKey.getEntityId()));
088
089    /**
090     * The column <code>orderdetails.orddt_ordername</code>.
091     */
092    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, String> ORDER_NAME = createField(DSL.name("orddt_ordername"), SQLDataType.VARCHAR(40).nullable(false), this, "");
093
094    /**
095     * The column <code>orderdetails.orddt_ordpr_orderpriorityid</code>.
096     */
097    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, OrderPriorityPK> ORDER_PRIORITY = createField(DSL.name("orddt_ordpr_orderpriorityid"), SQLDataType.BIGINT, this, "", Converter.ofNullable(Long.class, OrderPriorityPK.class, id -> new com.echothree.model.data.order.common.pk.OrderPriorityPK(id), primaryKey -> primaryKey.getEntityId()));
098
099    /**
100     * The column <code>orderdetails.orddt_cur_currencyid</code>.
101     */
102    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, CurrencyPK> CURRENCY = createField(DSL.name("orddt_cur_currencyid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, CurrencyPK.class, id -> new com.echothree.model.data.accounting.common.pk.CurrencyPK(id), primaryKey -> primaryKey.getEntityId()));
103
104    /**
105     * The column <code>orderdetails.orddt_holduntilcomplete</code>.
106     */
107    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, Boolean> HOLD_UNTIL_COMPLETE = createField(DSL.name("orddt_holduntilcomplete"), SQLDataType.BIT, this, "");
108
109    /**
110     * The column <code>orderdetails.orddt_allowbackorders</code>.
111     */
112    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, Boolean> ALLOW_BACKORDERS = createField(DSL.name("orddt_allowbackorders"), SQLDataType.BIT, this, "");
113
114    /**
115     * The column <code>orderdetails.orddt_allowsubstitutions</code>.
116     */
117    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, Boolean> ALLOW_SUBSTITUTIONS = createField(DSL.name("orddt_allowsubstitutions"), SQLDataType.BIT, this, "");
118
119    /**
120     * The column <code>orderdetails.orddt_allowcombiningshipments</code>.
121     */
122    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, Boolean> ALLOW_COMBINING_SHIPMENTS = createField(DSL.name("orddt_allowcombiningshipments"), SQLDataType.BIT, this, "");
123
124    /**
125     * The column <code>orderdetails.orddt_trm_termid</code>.
126     */
127    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, TermPK> TERM = createField(DSL.name("orddt_trm_termid"), SQLDataType.BIGINT, this, "", Converter.ofNullable(Long.class, TermPK.class, id -> new com.echothree.model.data.term.common.pk.TermPK(id), primaryKey -> primaryKey.getEntityId()));
128
129    /**
130     * The column <code>orderdetails.orddt_fob_freeonboardid</code>.
131     */
132    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, FreeOnBoardPK> FREE_ON_BOARD = createField(DSL.name("orddt_fob_freeonboardid"), SQLDataType.BIGINT, this, "", Converter.ofNullable(Long.class, FreeOnBoardPK.class, id -> new com.echothree.model.data.shipment.common.pk.FreeOnBoardPK(id), primaryKey -> primaryKey.getEntityId()));
133
134    /**
135     * The column <code>orderdetails.orddt_reference</code>.
136     */
137    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, String> REFERENCE = createField(DSL.name("orddt_reference"), SQLDataType.VARCHAR(40), this, "");
138
139    /**
140     * The column <code>orderdetails.orddt_description</code>.
141     */
142    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, String> DESCRIPTION = createField(DSL.name("orddt_description"), SQLDataType.VARCHAR(132), this, "");
143
144    /**
145     * The column <code>orderdetails.orddt_cnclplcy_cancellationpolicyid</code>.
146     */
147    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, CancellationPolicyPK> CANCELLATION_POLICY = createField(DSL.name("orddt_cnclplcy_cancellationpolicyid"), SQLDataType.BIGINT, this, "", Converter.ofNullable(Long.class, CancellationPolicyPK.class, id -> new com.echothree.model.data.cancellationpolicy.common.pk.CancellationPolicyPK(id), primaryKey -> primaryKey.getEntityId()));
148
149    /**
150     * The column <code>orderdetails.orddt_rtnplcy_returnpolicyid</code>.
151     */
152    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, ReturnPolicyPK> RETURN_POLICY = createField(DSL.name("orddt_rtnplcy_returnpolicyid"), SQLDataType.BIGINT, this, "", Converter.ofNullable(Long.class, ReturnPolicyPK.class, id -> new com.echothree.model.data.returnpolicy.common.pk.ReturnPolicyPK(id), primaryKey -> primaryKey.getEntityId()));
153
154    /**
155     * The column <code>orderdetails.orddt_taxable</code>.
156     */
157    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, Boolean> TAXABLE = createField(DSL.name("orddt_taxable"), SQLDataType.BIT, this, "");
158
159    /**
160     * The column <code>orderdetails.orddt_fromtime</code>.
161     */
162    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, Long> FROM_TIME = createField(DSL.name("orddt_fromtime"), SQLDataType.BIGINT.nullable(false), this, "");
163
164    /**
165     * The column <code>orderdetails.orddt_thrutime</code>.
166     */
167    public final TableField<com.echothree.model.jooq.server.records.order.OrderDetails, Long> THRU_TIME = createField(DSL.name("orddt_thrutime"), SQLDataType.BIGINT.nullable(false), this, "");
168
169    private OrderDetails(Name alias, Table<com.echothree.model.jooq.server.records.order.OrderDetails> aliased) {
170        this(alias, aliased, (Field<?>[]) null, null);
171    }
172
173    private OrderDetails(Name alias, Table<com.echothree.model.jooq.server.records.order.OrderDetails> aliased, Field<?>[] parameters, Condition where) {
174        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
175    }
176
177    /**
178     * Create an aliased <code>orderdetails</code> table reference
179     */
180    public OrderDetails(String alias) {
181        this(DSL.name(alias), OrderDetails);
182    }
183
184    /**
185     * Create an aliased <code>orderdetails</code> table reference
186     */
187    public OrderDetails(Name alias) {
188        this(alias, OrderDetails);
189    }
190
191    /**
192     * Create a <code>orderdetails</code> table reference
193     */
194    public OrderDetails() {
195        this(DSL.name("orderdetails"), null);
196    }
197
198    public <O extends Record> OrderDetails(Table<O> path, ForeignKey<O, com.echothree.model.jooq.server.records.order.OrderDetails> childPath, InverseForeignKey<O, com.echothree.model.jooq.server.records.order.OrderDetails> parentPath) {
199        super(path, childPath, parentPath, OrderDetails);
200    }
201
202    /**
203     * A subtype implementing {@link Path} for simplified path-based joins.
204     */
205    public static class OrderDetailsPath extends OrderDetails implements Path<com.echothree.model.jooq.server.records.order.OrderDetails> {
206
207        private static final long serialVersionUID = 1L;
208        public <O extends Record> OrderDetailsPath(Table<O> path, ForeignKey<O, com.echothree.model.jooq.server.records.order.OrderDetails> childPath, InverseForeignKey<O, com.echothree.model.jooq.server.records.order.OrderDetails> parentPath) {
209            super(path, childPath, parentPath);
210        }
211        private OrderDetailsPath(Name alias, Table<com.echothree.model.jooq.server.records.order.OrderDetails> aliased) {
212            super(alias, aliased);
213        }
214
215        @Override
216        public OrderDetailsPath as(String alias) {
217            return new OrderDetailsPath(DSL.name(alias), this);
218        }
219
220        @Override
221        public OrderDetailsPath as(Name alias) {
222            return new OrderDetailsPath(alias, this);
223        }
224
225        @Override
226        public OrderDetailsPath as(Table<?> alias) {
227            return new OrderDetailsPath(alias.getQualifiedName(), this);
228        }
229    }
230
231    @Override
232    public UniqueKey<com.echothree.model.jooq.server.records.order.OrderDetails> getPrimaryKey() {
233        return KeyRegistry.ORDER_DETAILS_PK;
234    }
235
236    @Override
237    public List<UniqueKey<com.echothree.model.jooq.server.records.order.OrderDetails>> getUniqueKeys() {
238        return Arrays.asList(KeyRegistry.ORDER_DETAILS_ORDER_AND_THRU_TIME_UK, KeyRegistry.ORDER_DETAILS_ORDER_TYPE_AND_ORDER_NAME_AND_THRU_TIME_UK);
239    }
240
241    @Override
242    public List<ForeignKey<com.echothree.model.jooq.server.records.order.OrderDetails, ?>> getReferences() {
243        return Arrays.asList(KeyRegistry.ORDER_DETAILS_CANCELLATION_POLICY_FK, KeyRegistry.ORDER_DETAILS_CURRENCY_FK, KeyRegistry.ORDER_DETAILS_FREE_ON_BOARD_FK, KeyRegistry.ORDER_DETAILS_ORDER_FK, KeyRegistry.ORDER_DETAILS_ORDER_PRIORITY_FK, KeyRegistry.ORDER_DETAILS_ORDER_TYPE_FK, KeyRegistry.ORDER_DETAILS_RETURN_POLICY_FK, KeyRegistry.ORDER_DETAILS_TERM_FK);
244    }
245
246    private transient CancellationPoliciesPath _orddt_cnclplcy_cancellationpolicyid_fk;
247
248    /**
249     * Get the implicit join path to the <code>cancellationpolicies</code>
250     * table.
251     */
252    public CancellationPoliciesPath orddt_cnclplcy_cancellationpolicyid_fk() {
253        if (_orddt_cnclplcy_cancellationpolicyid_fk == null)
254            _orddt_cnclplcy_cancellationpolicyid_fk = new CancellationPoliciesPath(this, KeyRegistry.ORDER_DETAILS_CANCELLATION_POLICY_FK, null);
255
256        return _orddt_cnclplcy_cancellationpolicyid_fk;
257    }
258
259    private transient CurrenciesPath _orddt_cur_currencyid_fk;
260
261    /**
262     * Get the implicit join path to the <code>currencies</code> table.
263     */
264    public CurrenciesPath orddt_cur_currencyid_fk() {
265        if (_orddt_cur_currencyid_fk == null)
266            _orddt_cur_currencyid_fk = new CurrenciesPath(this, KeyRegistry.ORDER_DETAILS_CURRENCY_FK, null);
267
268        return _orddt_cur_currencyid_fk;
269    }
270
271    private transient FreeOnBoardsPath _orddt_fob_freeonboardid_fk;
272
273    /**
274     * Get the implicit join path to the <code>freeonboards</code> table.
275     */
276    public FreeOnBoardsPath orddt_fob_freeonboardid_fk() {
277        if (_orddt_fob_freeonboardid_fk == null)
278            _orddt_fob_freeonboardid_fk = new FreeOnBoardsPath(this, KeyRegistry.ORDER_DETAILS_FREE_ON_BOARD_FK, null);
279
280        return _orddt_fob_freeonboardid_fk;
281    }
282
283    private transient OrdersPath _orddt_ord_orderid_fk;
284
285    /**
286     * Get the implicit join path to the <code>orders</code> table.
287     */
288    public OrdersPath orddt_ord_orderid_fk() {
289        if (_orddt_ord_orderid_fk == null)
290            _orddt_ord_orderid_fk = new OrdersPath(this, KeyRegistry.ORDER_DETAILS_ORDER_FK, null);
291
292        return _orddt_ord_orderid_fk;
293    }
294
295    private transient OrderPrioritiesPath _orddt_ordpr_orderpriorityid_fk;
296
297    /**
298     * Get the implicit join path to the <code>orderpriorities</code> table.
299     */
300    public OrderPrioritiesPath orddt_ordpr_orderpriorityid_fk() {
301        if (_orddt_ordpr_orderpriorityid_fk == null)
302            _orddt_ordpr_orderpriorityid_fk = new OrderPrioritiesPath(this, KeyRegistry.ORDER_DETAILS_ORDER_PRIORITY_FK, null);
303
304        return _orddt_ordpr_orderpriorityid_fk;
305    }
306
307    private transient OrderTypesPath _orddt_ordtyp_ordertypeid_fk;
308
309    /**
310     * Get the implicit join path to the <code>ordertypes</code> table.
311     */
312    public OrderTypesPath orddt_ordtyp_ordertypeid_fk() {
313        if (_orddt_ordtyp_ordertypeid_fk == null)
314            _orddt_ordtyp_ordertypeid_fk = new OrderTypesPath(this, KeyRegistry.ORDER_DETAILS_ORDER_TYPE_FK, null);
315
316        return _orddt_ordtyp_ordertypeid_fk;
317    }
318
319    private transient ReturnPoliciesPath _orddt_rtnplcy_returnpolicyid_fk;
320
321    /**
322     * Get the implicit join path to the <code>returnpolicies</code> table.
323     */
324    public ReturnPoliciesPath orddt_rtnplcy_returnpolicyid_fk() {
325        if (_orddt_rtnplcy_returnpolicyid_fk == null)
326            _orddt_rtnplcy_returnpolicyid_fk = new ReturnPoliciesPath(this, KeyRegistry.ORDER_DETAILS_RETURN_POLICY_FK, null);
327
328        return _orddt_rtnplcy_returnpolicyid_fk;
329    }
330
331    private transient TermsPath _orddt_trm_termid_fk;
332
333    /**
334     * Get the implicit join path to the <code>terms</code> table.
335     */
336    public TermsPath orddt_trm_termid_fk() {
337        if (_orddt_trm_termid_fk == null)
338            _orddt_trm_termid_fk = new TermsPath(this, KeyRegistry.ORDER_DETAILS_TERM_FK, null);
339
340        return _orddt_trm_termid_fk;
341    }
342
343    @Override
344    public OrderDetails as(String alias) {
345        return new OrderDetails(DSL.name(alias), this);
346    }
347
348    @Override
349    public OrderDetails as(Name alias) {
350        return new OrderDetails(alias, this);
351    }
352
353    @Override
354    public OrderDetails as(Table<?> alias) {
355        return new OrderDetails(alias.getQualifiedName(), this);
356    }
357
358    /**
359     * Rename this table
360     */
361    @Override
362    public OrderDetails rename(String name) {
363        return new OrderDetails(DSL.name(name), null);
364    }
365
366    /**
367     * Rename this table
368     */
369    @Override
370    public OrderDetails rename(Name name) {
371        return new OrderDetails(name, null);
372    }
373
374    /**
375     * Rename this table
376     */
377    @Override
378    public OrderDetails rename(Table<?> name) {
379        return new OrderDetails(name.getQualifiedName(), null);
380    }
381
382    /**
383     * Create an inline derived table from this table
384     */
385    @Override
386    public OrderDetails where(Condition condition) {
387        return new OrderDetails(getQualifiedName(), aliased() ? this : null, null, Internal.condition(this, condition));
388    }
389
390    /**
391     * Create an inline derived table from this table
392     */
393    @Override
394    public OrderDetails where(Collection<? extends Condition> conditions) {
395        return where(DSL.and(conditions));
396    }
397
398    /**
399     * Create an inline derived table from this table
400     */
401    @Override
402    public OrderDetails where(Condition... conditions) {
403        return where(DSL.and(conditions));
404    }
405
406    /**
407     * Create an inline derived table from this table
408     */
409    @Override
410    public OrderDetails where(Field<Boolean> condition) {
411        return where(DSL.condition(condition));
412    }
413
414    /**
415     * Create an inline derived table from this table
416     */
417    @Override
418    @PlainSQL
419    public OrderDetails where(SQL condition) {
420        return where(DSL.condition(condition));
421    }
422
423    /**
424     * Create an inline derived table from this table
425     */
426    @Override
427    @PlainSQL
428    public OrderDetails where(@Stringly.SQL String condition) {
429        return where(DSL.condition(condition));
430    }
431
432    /**
433     * Create an inline derived table from this table
434     */
435    @Override
436    @PlainSQL
437    public OrderDetails where(@Stringly.SQL String condition, Object... binds) {
438        return where(DSL.condition(condition, binds));
439    }
440
441    /**
442     * Create an inline derived table from this table
443     */
444    @Override
445    @PlainSQL
446    public OrderDetails where(@Stringly.SQL String condition, QueryPart... parts) {
447        return where(DSL.condition(condition, parts));
448    }
449
450    /**
451     * Create an inline derived table from this table
452     */
453    @Override
454    public OrderDetails whereExists(TableLike<?> select) {
455        return where(DSL.exists(select));
456    }
457
458    /**
459     * Create an inline derived table from this table
460     */
461    @Override
462    public OrderDetails whereNotExists(TableLike<?> select) {
463        return where(DSL.notExists(select));
464    }
465}