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.EntityTypePK;
009import com.echothree.model.jooq.server.KeyRegistry;
010import com.echothree.model.jooq.server.tables.core.EntityTypes.EntityTypesPath;
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.InverseForeignKey;
021import org.jooq.Name;
022import org.jooq.Path;
023import org.jooq.PlainSQL;
024import org.jooq.QueryPart;
025import org.jooq.Record;
026import org.jooq.SQL;
027import org.jooq.Stringly;
028import org.jooq.Table;
029import org.jooq.TableField;
030import org.jooq.TableLike;
031import org.jooq.TableOptions;
032import org.jooq.UniqueKey;
033import org.jooq.impl.DSL;
034import org.jooq.impl.Internal;
035import org.jooq.impl.SQLDataType;
036import org.jooq.impl.TableImpl;
037
038
039/**
040 * This class is generated by jOOQ.
041 */
042@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" })
043public class EntityInstances extends TableImpl<com.echothree.model.jooq.server.records.core.EntityInstances> {
044
045    private static final long serialVersionUID = 1L;
046
047    /**
048     * The reference instance of <code>entityinstances</code>
049     */
050    public static final EntityInstances EntityInstances = new EntityInstances();
051
052    /**
053     * The class holding records for this type
054     */
055    @Override
056    public Class<com.echothree.model.jooq.server.records.core.EntityInstances> getRecordType() {
057        return com.echothree.model.jooq.server.records.core.EntityInstances.class;
058    }
059
060    /**
061     * The column <code>entityinstances.eni_entityinstanceid</code>.
062     */
063    public final TableField<com.echothree.model.jooq.server.records.core.EntityInstances, EntityInstancePK> ENTITY_INSTANCE = createField(DSL.name("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()));
064
065    /**
066     * The column <code>entityinstances.eni_ent_entitytypeid</code>.
067     */
068    public final TableField<com.echothree.model.jooq.server.records.core.EntityInstances, EntityTypePK> ENTITY_TYPE = createField(DSL.name("eni_ent_entitytypeid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, EntityTypePK.class, id -> new com.echothree.model.data.core.common.pk.EntityTypePK(id), primaryKey -> primaryKey.getEntityId()));
069
070    /**
071     * The column <code>entityinstances.eni_entityuniqueid</code>.
072     */
073    public final TableField<com.echothree.model.jooq.server.records.core.EntityInstances, Long> ENTITY_UNIQUE = createField(DSL.name("eni_entityuniqueid"), SQLDataType.BIGINT.nullable(false), this, "");
074
075    /**
076     * The column <code>entityinstances.eni_uuid</code>.
077     */
078    public final TableField<com.echothree.model.jooq.server.records.core.EntityInstances, byte[]> UUID = createField(DSL.name("eni_uuid"), SQLDataType.BINARY(16), this, "");
079
080    private EntityInstances(Name alias, Table<com.echothree.model.jooq.server.records.core.EntityInstances> aliased) {
081        this(alias, aliased, (Field<?>[]) null, null);
082    }
083
084    private EntityInstances(Name alias, Table<com.echothree.model.jooq.server.records.core.EntityInstances> aliased, Field<?>[] parameters, Condition where) {
085        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
086    }
087
088    /**
089     * Create an aliased <code>entityinstances</code> table reference
090     */
091    public EntityInstances(String alias) {
092        this(DSL.name(alias), EntityInstances);
093    }
094
095    /**
096     * Create an aliased <code>entityinstances</code> table reference
097     */
098    public EntityInstances(Name alias) {
099        this(alias, EntityInstances);
100    }
101
102    /**
103     * Create a <code>entityinstances</code> table reference
104     */
105    public EntityInstances() {
106        this(DSL.name("entityinstances"), null);
107    }
108
109    public <O extends Record> EntityInstances(Table<O> path, ForeignKey<O, com.echothree.model.jooq.server.records.core.EntityInstances> childPath, InverseForeignKey<O, com.echothree.model.jooq.server.records.core.EntityInstances> parentPath) {
110        super(path, childPath, parentPath, EntityInstances);
111    }
112
113    /**
114     * A subtype implementing {@link Path} for simplified path-based joins.
115     */
116    public static class EntityInstancesPath extends EntityInstances implements Path<com.echothree.model.jooq.server.records.core.EntityInstances> {
117
118        private static final long serialVersionUID = 1L;
119        public <O extends Record> EntityInstancesPath(Table<O> path, ForeignKey<O, com.echothree.model.jooq.server.records.core.EntityInstances> childPath, InverseForeignKey<O, com.echothree.model.jooq.server.records.core.EntityInstances> parentPath) {
120            super(path, childPath, parentPath);
121        }
122        private EntityInstancesPath(Name alias, Table<com.echothree.model.jooq.server.records.core.EntityInstances> aliased) {
123            super(alias, aliased);
124        }
125
126        @Override
127        public EntityInstancesPath as(String alias) {
128            return new EntityInstancesPath(DSL.name(alias), this);
129        }
130
131        @Override
132        public EntityInstancesPath as(Name alias) {
133            return new EntityInstancesPath(alias, this);
134        }
135
136        @Override
137        public EntityInstancesPath as(Table<?> alias) {
138            return new EntityInstancesPath(alias.getQualifiedName(), this);
139        }
140    }
141
142    @Override
143    public UniqueKey<com.echothree.model.jooq.server.records.core.EntityInstances> getPrimaryKey() {
144        return KeyRegistry.ENTITY_INSTANCES_PK;
145    }
146
147    @Override
148    public List<UniqueKey<com.echothree.model.jooq.server.records.core.EntityInstances>> getUniqueKeys() {
149        return Arrays.asList(KeyRegistry.ENTITY_INSTANCES_ENTITY_TYPE_AND_ENTITY_UNIQUE_UK, KeyRegistry.ENTITY_INSTANCES_UUID_UK);
150    }
151
152    @Override
153    public List<ForeignKey<com.echothree.model.jooq.server.records.core.EntityInstances, ?>> getReferences() {
154        return Arrays.asList(KeyRegistry.ENTITY_INSTANCES_ENTITY_TYPE_FK);
155    }
156
157    private transient EntityTypesPath _eni_ent_entitytypeid_fk;
158
159    /**
160     * Get the implicit join path to the <code>entitytypes</code> table.
161     */
162    public EntityTypesPath eni_ent_entitytypeid_fk() {
163        if (_eni_ent_entitytypeid_fk == null)
164            _eni_ent_entitytypeid_fk = new EntityTypesPath(this, KeyRegistry.ENTITY_INSTANCES_ENTITY_TYPE_FK, null);
165
166        return _eni_ent_entitytypeid_fk;
167    }
168
169    @Override
170    public EntityInstances as(String alias) {
171        return new EntityInstances(DSL.name(alias), this);
172    }
173
174    @Override
175    public EntityInstances as(Name alias) {
176        return new EntityInstances(alias, this);
177    }
178
179    @Override
180    public EntityInstances as(Table<?> alias) {
181        return new EntityInstances(alias.getQualifiedName(), this);
182    }
183
184    /**
185     * Rename this table
186     */
187    @Override
188    public EntityInstances rename(String name) {
189        return new EntityInstances(DSL.name(name), null);
190    }
191
192    /**
193     * Rename this table
194     */
195    @Override
196    public EntityInstances rename(Name name) {
197        return new EntityInstances(name, null);
198    }
199
200    /**
201     * Rename this table
202     */
203    @Override
204    public EntityInstances rename(Table<?> name) {
205        return new EntityInstances(name.getQualifiedName(), null);
206    }
207
208    /**
209     * Create an inline derived table from this table
210     */
211    @Override
212    public EntityInstances where(Condition condition) {
213        return new EntityInstances(getQualifiedName(), aliased() ? this : null, null, Internal.condition(this, condition));
214    }
215
216    /**
217     * Create an inline derived table from this table
218     */
219    @Override
220    public EntityInstances where(Collection<? extends Condition> conditions) {
221        return where(DSL.and(conditions));
222    }
223
224    /**
225     * Create an inline derived table from this table
226     */
227    @Override
228    public EntityInstances where(Condition... conditions) {
229        return where(DSL.and(conditions));
230    }
231
232    /**
233     * Create an inline derived table from this table
234     */
235    @Override
236    public EntityInstances where(Field<Boolean> condition) {
237        return where(DSL.condition(condition));
238    }
239
240    /**
241     * Create an inline derived table from this table
242     */
243    @Override
244    @PlainSQL
245    public EntityInstances where(SQL condition) {
246        return where(DSL.condition(condition));
247    }
248
249    /**
250     * Create an inline derived table from this table
251     */
252    @Override
253    @PlainSQL
254    public EntityInstances where(@Stringly.SQL String condition) {
255        return where(DSL.condition(condition));
256    }
257
258    /**
259     * Create an inline derived table from this table
260     */
261    @Override
262    @PlainSQL
263    public EntityInstances where(@Stringly.SQL String condition, Object... binds) {
264        return where(DSL.condition(condition, binds));
265    }
266
267    /**
268     * Create an inline derived table from this table
269     */
270    @Override
271    @PlainSQL
272    public EntityInstances where(@Stringly.SQL String condition, QueryPart... parts) {
273        return where(DSL.condition(condition, parts));
274    }
275
276    /**
277     * Create an inline derived table from this table
278     */
279    @Override
280    public EntityInstances whereExists(TableLike<?> select) {
281        return where(DSL.exists(select));
282    }
283
284    /**
285     * Create an inline derived table from this table
286     */
287    @Override
288    public EntityInstances whereNotExists(TableLike<?> select) {
289        return where(DSL.notExists(select));
290    }
291}