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