001/*
002 * This file is generated by jOOQ.
003 */
004package com.echothree.model.jooq.server.tables.search;
005
006
007import com.echothree.model.data.index.common.pk.IndexPK;
008import com.echothree.model.data.search.common.pk.CachedSearchPK;
009import com.echothree.model.data.search.common.pk.SearchDefaultOperatorPK;
010import com.echothree.model.data.search.common.pk.SearchSortDirectionPK;
011import com.echothree.model.data.search.common.pk.SearchSortOrderPK;
012import com.echothree.model.jooq.server.KeyRegistry;
013import com.echothree.model.jooq.server.tables.index.Indexes.IndexesPath;
014import com.echothree.model.jooq.server.tables.search.SearchDefaultOperators.SearchDefaultOperatorsPath;
015import com.echothree.model.jooq.server.tables.search.SearchSortDirections.SearchSortDirectionsPath;
016import com.echothree.model.jooq.server.tables.search.SearchSortOrders.SearchSortOrdersPath;
017
018import java.util.Arrays;
019import java.util.Collection;
020import java.util.List;
021
022import org.jooq.Condition;
023import org.jooq.Converter;
024import org.jooq.Field;
025import org.jooq.ForeignKey;
026import org.jooq.InverseForeignKey;
027import org.jooq.Name;
028import org.jooq.Path;
029import org.jooq.PlainSQL;
030import org.jooq.QueryPart;
031import org.jooq.Record;
032import org.jooq.SQL;
033import org.jooq.Stringly;
034import org.jooq.Table;
035import org.jooq.TableField;
036import org.jooq.TableLike;
037import org.jooq.TableOptions;
038import org.jooq.UniqueKey;
039import org.jooq.impl.DSL;
040import org.jooq.impl.Internal;
041import org.jooq.impl.SQLDataType;
042import org.jooq.impl.TableImpl;
043
044
045/**
046 * This class is generated by jOOQ.
047 */
048@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" })
049public class CachedSearches extends TableImpl<com.echothree.model.jooq.server.records.search.CachedSearches> {
050
051    private static final long serialVersionUID = 1L;
052
053    /**
054     * The reference instance of <code>cachedsearches</code>
055     */
056    public static final CachedSearches CachedSearches = new CachedSearches();
057
058    /**
059     * The class holding records for this type
060     */
061    @Override
062    public Class<com.echothree.model.jooq.server.records.search.CachedSearches> getRecordType() {
063        return com.echothree.model.jooq.server.records.search.CachedSearches.class;
064    }
065
066    /**
067     * The column <code>cachedsearches.csrch_cachedsearchid</code>.
068     */
069    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, CachedSearchPK> CACHED_SEARCH = createField(DSL.name("csrch_cachedsearchid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, CachedSearchPK.class, id -> new com.echothree.model.data.search.common.pk.CachedSearchPK(id), primaryKey -> primaryKey.getEntityId()));
070
071    /**
072     * The column <code>cachedsearches.csrch_idx_indexid</code>.
073     */
074    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, IndexPK> INDEX = createField(DSL.name("csrch_idx_indexid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, IndexPK.class, id -> new com.echothree.model.data.index.common.pk.IndexPK(id), primaryKey -> primaryKey.getEntityId()));
075
076    /**
077     * The column <code>cachedsearches.csrch_querysha1hash</code>.
078     */
079    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, String> QUERY_SHA1_HASH = createField(DSL.name("csrch_querysha1hash"), SQLDataType.VARCHAR(28).nullable(false), this, "");
080
081    /**
082     * The column <code>cachedsearches.csrch_query</code>.
083     */
084    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, String> QUERY = createField(DSL.name("csrch_query"), SQLDataType.CLOB.nullable(false), this, "");
085
086    /**
087     * The column <code>cachedsearches.csrch_parsedquerysha1hash</code>.
088     */
089    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, String> PARSED_QUERY_SHA1_HASH = createField(DSL.name("csrch_parsedquerysha1hash"), SQLDataType.VARCHAR(28).nullable(false), this, "");
090
091    /**
092     * The column <code>cachedsearches.csrch_parsedquery</code>.
093     */
094    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, String> PARSED_QUERY = createField(DSL.name("csrch_parsedquery"), SQLDataType.CLOB.nullable(false), this, "");
095
096    /**
097     * The column
098     * <code>cachedsearches.csrch_srchdefop_searchdefaultoperatorid</code>.
099     */
100    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, SearchDefaultOperatorPK> SEARCH_DEFAULT_OPERATOR = createField(DSL.name("csrch_srchdefop_searchdefaultoperatorid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, SearchDefaultOperatorPK.class, id -> new com.echothree.model.data.search.common.pk.SearchDefaultOperatorPK(id), primaryKey -> primaryKey.getEntityId()));
101
102    /**
103     * The column
104     * <code>cachedsearches.csrch_srchsrtord_searchsortorderid</code>.
105     */
106    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, SearchSortOrderPK> SEARCH_SORT_ORDER = createField(DSL.name("csrch_srchsrtord_searchsortorderid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, SearchSortOrderPK.class, id -> new com.echothree.model.data.search.common.pk.SearchSortOrderPK(id), primaryKey -> primaryKey.getEntityId()));
107
108    /**
109     * The column
110     * <code>cachedsearches.csrch_srchsrtdir_searchsortdirectionid</code>.
111     */
112    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, SearchSortDirectionPK> SEARCH_SORT_DIRECTION = createField(DSL.name("csrch_srchsrtdir_searchsortdirectionid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, SearchSortDirectionPK.class, id -> new com.echothree.model.data.search.common.pk.SearchSortDirectionPK(id), primaryKey -> primaryKey.getEntityId()));
113
114    /**
115     * The column <code>cachedsearches.csrch_fromtime</code>.
116     */
117    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, Long> FROM_TIME = createField(DSL.name("csrch_fromtime"), SQLDataType.BIGINT.nullable(false), this, "");
118
119    /**
120     * The column <code>cachedsearches.csrch_thrutime</code>.
121     */
122    public final TableField<com.echothree.model.jooq.server.records.search.CachedSearches, Long> THRU_TIME = createField(DSL.name("csrch_thrutime"), SQLDataType.BIGINT.nullable(false), this, "");
123
124    private CachedSearches(Name alias, Table<com.echothree.model.jooq.server.records.search.CachedSearches> aliased) {
125        this(alias, aliased, (Field<?>[]) null, null);
126    }
127
128    private CachedSearches(Name alias, Table<com.echothree.model.jooq.server.records.search.CachedSearches> aliased, Field<?>[] parameters, Condition where) {
129        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
130    }
131
132    /**
133     * Create an aliased <code>cachedsearches</code> table reference
134     */
135    public CachedSearches(String alias) {
136        this(DSL.name(alias), CachedSearches);
137    }
138
139    /**
140     * Create an aliased <code>cachedsearches</code> table reference
141     */
142    public CachedSearches(Name alias) {
143        this(alias, CachedSearches);
144    }
145
146    /**
147     * Create a <code>cachedsearches</code> table reference
148     */
149    public CachedSearches() {
150        this(DSL.name("cachedsearches"), null);
151    }
152
153    public <O extends Record> CachedSearches(Table<O> path, ForeignKey<O, com.echothree.model.jooq.server.records.search.CachedSearches> childPath, InverseForeignKey<O, com.echothree.model.jooq.server.records.search.CachedSearches> parentPath) {
154        super(path, childPath, parentPath, CachedSearches);
155    }
156
157    /**
158     * A subtype implementing {@link Path} for simplified path-based joins.
159     */
160    public static class CachedSearchesPath extends CachedSearches implements Path<com.echothree.model.jooq.server.records.search.CachedSearches> {
161
162        private static final long serialVersionUID = 1L;
163        public <O extends Record> CachedSearchesPath(Table<O> path, ForeignKey<O, com.echothree.model.jooq.server.records.search.CachedSearches> childPath, InverseForeignKey<O, com.echothree.model.jooq.server.records.search.CachedSearches> parentPath) {
164            super(path, childPath, parentPath);
165        }
166        private CachedSearchesPath(Name alias, Table<com.echothree.model.jooq.server.records.search.CachedSearches> aliased) {
167            super(alias, aliased);
168        }
169
170        @Override
171        public CachedSearchesPath as(String alias) {
172            return new CachedSearchesPath(DSL.name(alias), this);
173        }
174
175        @Override
176        public CachedSearchesPath as(Name alias) {
177            return new CachedSearchesPath(alias, this);
178        }
179
180        @Override
181        public CachedSearchesPath as(Table<?> alias) {
182            return new CachedSearchesPath(alias.getQualifiedName(), this);
183        }
184    }
185
186    @Override
187    public UniqueKey<com.echothree.model.jooq.server.records.search.CachedSearches> getPrimaryKey() {
188        return KeyRegistry.CACHED_SEARCHES_PK;
189    }
190
191    @Override
192    public List<UniqueKey<com.echothree.model.jooq.server.records.search.CachedSearches>> getUniqueKeys() {
193        return Arrays.asList(KeyRegistry.CACHED_SEARCHES_INDEX_AND_QUERY_SHA1_HASH_AND_PARSED_QUERY_SHA1_HASH_AND_SEARCH_DEFAULT_OPERATOR_AND_SEARCH_SORT_ORDER_AND_SEARCH_SORT_DIRECTION_AND_THRU_TIME_UK);
194    }
195
196    @Override
197    public List<ForeignKey<com.echothree.model.jooq.server.records.search.CachedSearches, ?>> getReferences() {
198        return Arrays.asList(KeyRegistry.CACHED_SEARCHES_INDEX_FK, KeyRegistry.CACHED_SEARCHES_SEARCH_DEFAULT_OPERATOR_FK, KeyRegistry.CACHED_SEARCHES_SEARCH_SORT_DIRECTION_FK, KeyRegistry.CACHED_SEARCHES_SEARCH_SORT_ORDER_FK);
199    }
200
201    private transient IndexesPath _csrch_idx_indexid_fk;
202
203    /**
204     * Get the implicit join path to the <code>indexes</code> table.
205     */
206    public IndexesPath csrch_idx_indexid_fk() {
207        if (_csrch_idx_indexid_fk == null)
208            _csrch_idx_indexid_fk = new IndexesPath(this, KeyRegistry.CACHED_SEARCHES_INDEX_FK, null);
209
210        return _csrch_idx_indexid_fk;
211    }
212
213    private transient SearchDefaultOperatorsPath _csrch_srchdefop_searchdefaultoperatorid_fk;
214
215    /**
216     * Get the implicit join path to the <code>searchdefaultoperators</code>
217     * table.
218     */
219    public SearchDefaultOperatorsPath csrch_srchdefop_searchdefaultoperatorid_fk() {
220        if (_csrch_srchdefop_searchdefaultoperatorid_fk == null)
221            _csrch_srchdefop_searchdefaultoperatorid_fk = new SearchDefaultOperatorsPath(this, KeyRegistry.CACHED_SEARCHES_SEARCH_DEFAULT_OPERATOR_FK, null);
222
223        return _csrch_srchdefop_searchdefaultoperatorid_fk;
224    }
225
226    private transient SearchSortDirectionsPath _csrch_srchsrtdir_searchsortdirectionid_fk;
227
228    /**
229     * Get the implicit join path to the <code>searchsortdirections</code>
230     * table.
231     */
232    public SearchSortDirectionsPath csrch_srchsrtdir_searchsortdirectionid_fk() {
233        if (_csrch_srchsrtdir_searchsortdirectionid_fk == null)
234            _csrch_srchsrtdir_searchsortdirectionid_fk = new SearchSortDirectionsPath(this, KeyRegistry.CACHED_SEARCHES_SEARCH_SORT_DIRECTION_FK, null);
235
236        return _csrch_srchsrtdir_searchsortdirectionid_fk;
237    }
238
239    private transient SearchSortOrdersPath _csrch_srchsrtord_searchsortorderid_fk;
240
241    /**
242     * Get the implicit join path to the <code>searchsortorders</code> table.
243     */
244    public SearchSortOrdersPath csrch_srchsrtord_searchsortorderid_fk() {
245        if (_csrch_srchsrtord_searchsortorderid_fk == null)
246            _csrch_srchsrtord_searchsortorderid_fk = new SearchSortOrdersPath(this, KeyRegistry.CACHED_SEARCHES_SEARCH_SORT_ORDER_FK, null);
247
248        return _csrch_srchsrtord_searchsortorderid_fk;
249    }
250
251    @Override
252    public CachedSearches as(String alias) {
253        return new CachedSearches(DSL.name(alias), this);
254    }
255
256    @Override
257    public CachedSearches as(Name alias) {
258        return new CachedSearches(alias, this);
259    }
260
261    @Override
262    public CachedSearches as(Table<?> alias) {
263        return new CachedSearches(alias.getQualifiedName(), this);
264    }
265
266    /**
267     * Rename this table
268     */
269    @Override
270    public CachedSearches rename(String name) {
271        return new CachedSearches(DSL.name(name), null);
272    }
273
274    /**
275     * Rename this table
276     */
277    @Override
278    public CachedSearches rename(Name name) {
279        return new CachedSearches(name, null);
280    }
281
282    /**
283     * Rename this table
284     */
285    @Override
286    public CachedSearches rename(Table<?> name) {
287        return new CachedSearches(name.getQualifiedName(), null);
288    }
289
290    /**
291     * Create an inline derived table from this table
292     */
293    @Override
294    public CachedSearches where(Condition condition) {
295        return new CachedSearches(getQualifiedName(), aliased() ? this : null, null, Internal.condition(this, condition));
296    }
297
298    /**
299     * Create an inline derived table from this table
300     */
301    @Override
302    public CachedSearches where(Collection<? extends Condition> conditions) {
303        return where(DSL.and(conditions));
304    }
305
306    /**
307     * Create an inline derived table from this table
308     */
309    @Override
310    public CachedSearches where(Condition... conditions) {
311        return where(DSL.and(conditions));
312    }
313
314    /**
315     * Create an inline derived table from this table
316     */
317    @Override
318    public CachedSearches where(Field<Boolean> condition) {
319        return where(DSL.condition(condition));
320    }
321
322    /**
323     * Create an inline derived table from this table
324     */
325    @Override
326    @PlainSQL
327    public CachedSearches where(SQL condition) {
328        return where(DSL.condition(condition));
329    }
330
331    /**
332     * Create an inline derived table from this table
333     */
334    @Override
335    @PlainSQL
336    public CachedSearches where(@Stringly.SQL String condition) {
337        return where(DSL.condition(condition));
338    }
339
340    /**
341     * Create an inline derived table from this table
342     */
343    @Override
344    @PlainSQL
345    public CachedSearches where(@Stringly.SQL String condition, Object... binds) {
346        return where(DSL.condition(condition, binds));
347    }
348
349    /**
350     * Create an inline derived table from this table
351     */
352    @Override
353    @PlainSQL
354    public CachedSearches where(@Stringly.SQL String condition, QueryPart... parts) {
355        return where(DSL.condition(condition, parts));
356    }
357
358    /**
359     * Create an inline derived table from this table
360     */
361    @Override
362    public CachedSearches whereExists(TableLike<?> select) {
363        return where(DSL.exists(select));
364    }
365
366    /**
367     * Create an inline derived table from this table
368     */
369    @Override
370    public CachedSearches whereNotExists(TableLike<?> select) {
371        return where(DSL.notExists(select));
372    }
373}