001/* 002 * This file is generated by jOOQ. 003 */ 004package com.echothree.model.jooq.server.tables.customer; 005 006 007import com.echothree.model.data.accounting.common.pk.GlAccountPK; 008import com.echothree.model.data.cancellationpolicy.common.pk.CancellationPolicyPK; 009import com.echothree.model.data.customer.common.pk.CustomerPK; 010import com.echothree.model.data.customer.common.pk.CustomerTypePK; 011import com.echothree.model.data.offer.common.pk.OfferUsePK; 012import com.echothree.model.data.party.common.pk.PartyPK; 013import com.echothree.model.data.returnpolicy.common.pk.ReturnPolicyPK; 014import com.echothree.model.jooq.server.KeyRegistry; 015import com.echothree.model.jooq.server.tables.accounting.GlAccounts.GlAccountsPath; 016import com.echothree.model.jooq.server.tables.cancellationpolicy.CancellationPolicies.CancellationPoliciesPath; 017import com.echothree.model.jooq.server.tables.customer.CustomerTypes.CustomerTypesPath; 018import com.echothree.model.jooq.server.tables.offer.OfferUses.OfferUsesPath; 019import com.echothree.model.jooq.server.tables.party.Parties.PartiesPath; 020import com.echothree.model.jooq.server.tables.returnpolicy.ReturnPolicies.ReturnPoliciesPath; 021 022import java.util.Arrays; 023import java.util.Collection; 024import java.util.List; 025 026import org.jooq.Condition; 027import org.jooq.Converter; 028import org.jooq.Field; 029import org.jooq.ForeignKey; 030import org.jooq.Name; 031import org.jooq.PlainSQL; 032import org.jooq.QueryPart; 033import org.jooq.SQL; 034import org.jooq.Stringly; 035import org.jooq.Table; 036import org.jooq.TableField; 037import org.jooq.TableLike; 038import org.jooq.TableOptions; 039import org.jooq.UniqueKey; 040import org.jooq.impl.DSL; 041import org.jooq.impl.Internal; 042import org.jooq.impl.SQLDataType; 043import org.jooq.impl.TableImpl; 044 045 046/** 047 * This class is generated by jOOQ. 048 */ 049@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) 050public class Customers extends TableImpl<com.echothree.model.jooq.server.records.customer.Customers> { 051 052 private static final long serialVersionUID = 1L; 053 054 /** 055 * The reference instance of <code>customers</code> 056 */ 057 public static final Customers Customers = new Customers(); 058 059 /** 060 * The class holding records for this type 061 */ 062 @Override 063 public Class<com.echothree.model.jooq.server.records.customer.Customers> getRecordType() { 064 return com.echothree.model.jooq.server.records.customer.Customers.class; 065 } 066 067 /** 068 * The column <code>customers.cu_customerid</code>. 069 */ 070 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, CustomerPK> CUSTOMER = createField(DSL.name("cu_customerid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, CustomerPK.class, id -> new com.echothree.model.data.customer.common.pk.CustomerPK(id), primaryKey -> primaryKey.getEntityId())); 071 072 /** 073 * The column <code>customers.cu_par_partyid</code>. 074 */ 075 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, PartyPK> PARTY = createField(DSL.name("cu_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())); 076 077 /** 078 * The column <code>customers.cu_customername</code>. 079 */ 080 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, String> CUSTOMER_NAME = createField(DSL.name("cu_customername"), SQLDataType.VARCHAR(40).nullable(false), this, ""); 081 082 /** 083 * The column <code>customers.cu_cuty_customertypeid</code>. 084 */ 085 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, CustomerTypePK> CUSTOMER_TYPE = createField(DSL.name("cu_cuty_customertypeid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, CustomerTypePK.class, id -> new com.echothree.model.data.customer.common.pk.CustomerTypePK(id), primaryKey -> primaryKey.getEntityId())); 086 087 /** 088 * The column <code>customers.cu_initialofferuseid</code>. 089 */ 090 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, OfferUsePK> INITIAL_OFFER_USE = createField(DSL.name("cu_initialofferuseid"), SQLDataType.BIGINT.nullable(false), this, "", Converter.ofNullable(Long.class, OfferUsePK.class, id -> new com.echothree.model.data.offer.common.pk.OfferUsePK(id), primaryKey -> primaryKey.getEntityId())); 091 092 /** 093 * The column <code>customers.cu_cnclplcy_cancellationpolicyid</code>. 094 */ 095 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, CancellationPolicyPK> CANCELLATION_POLICY = createField(DSL.name("cu_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())); 096 097 /** 098 * The column <code>customers.cu_rtnplcy_returnpolicyid</code>. 099 */ 100 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, ReturnPolicyPK> RETURN_POLICY = createField(DSL.name("cu_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())); 101 102 /** 103 * The column <code>customers.cu_arglaccountid</code>. 104 */ 105 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, GlAccountPK> AR_GL_ACCOUNT = createField(DSL.name("cu_arglaccountid"), SQLDataType.BIGINT, this, "", Converter.ofNullable(Long.class, GlAccountPK.class, id -> new com.echothree.model.data.accounting.common.pk.GlAccountPK(id), primaryKey -> primaryKey.getEntityId())); 106 107 /** 108 * The column <code>customers.cu_holduntilcomplete</code>. 109 */ 110 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, Boolean> HOLD_UNTIL_COMPLETE = createField(DSL.name("cu_holduntilcomplete"), SQLDataType.BIT.nullable(false), this, ""); 111 112 /** 113 * The column <code>customers.cu_allowbackorders</code>. 114 */ 115 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, Boolean> ALLOW_BACKORDERS = createField(DSL.name("cu_allowbackorders"), SQLDataType.BIT.nullable(false), this, ""); 116 117 /** 118 * The column <code>customers.cu_allowsubstitutions</code>. 119 */ 120 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, Boolean> ALLOW_SUBSTITUTIONS = createField(DSL.name("cu_allowsubstitutions"), SQLDataType.BIT.nullable(false), this, ""); 121 122 /** 123 * The column <code>customers.cu_allowcombiningshipments</code>. 124 */ 125 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, Boolean> ALLOW_COMBINING_SHIPMENTS = createField(DSL.name("cu_allowcombiningshipments"), SQLDataType.BIT.nullable(false), this, ""); 126 127 /** 128 * The column <code>customers.cu_requirereference</code>. 129 */ 130 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, Boolean> REQUIRE_REFERENCE = createField(DSL.name("cu_requirereference"), SQLDataType.BIT.nullable(false), this, ""); 131 132 /** 133 * The column <code>customers.cu_allowreferenceduplicates</code>. 134 */ 135 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, Boolean> ALLOW_REFERENCE_DUPLICATES = createField(DSL.name("cu_allowreferenceduplicates"), SQLDataType.BIT.nullable(false), this, ""); 136 137 /** 138 * The column <code>customers.cu_referencevalidationpattern</code>. 139 */ 140 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, String> REFERENCE_VALIDATION_PATTERN = createField(DSL.name("cu_referencevalidationpattern"), SQLDataType.VARCHAR(128), this, ""); 141 142 /** 143 * The column <code>customers.cu_fromtime</code>. 144 */ 145 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, Long> FROM_TIME = createField(DSL.name("cu_fromtime"), SQLDataType.BIGINT.nullable(false), this, ""); 146 147 /** 148 * The column <code>customers.cu_thrutime</code>. 149 */ 150 public final TableField<com.echothree.model.jooq.server.records.customer.Customers, Long> THRU_TIME = createField(DSL.name("cu_thrutime"), SQLDataType.BIGINT.nullable(false), this, ""); 151 152 private Customers(Name alias, Table<com.echothree.model.jooq.server.records.customer.Customers> aliased) { 153 this(alias, aliased, (Field<?>[]) null, null); 154 } 155 156 private Customers(Name alias, Table<com.echothree.model.jooq.server.records.customer.Customers> aliased, Field<?>[] parameters, Condition where) { 157 super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); 158 } 159 160 /** 161 * Create an aliased <code>customers</code> table reference 162 */ 163 public Customers(String alias) { 164 this(DSL.name(alias), Customers); 165 } 166 167 /** 168 * Create an aliased <code>customers</code> table reference 169 */ 170 public Customers(Name alias) { 171 this(alias, Customers); 172 } 173 174 /** 175 * Create a <code>customers</code> table reference 176 */ 177 public Customers() { 178 this(DSL.name("customers"), null); 179 } 180 181 @Override 182 public UniqueKey<com.echothree.model.jooq.server.records.customer.Customers> getPrimaryKey() { 183 return KeyRegistry.CUSTOMERS_PK; 184 } 185 186 @Override 187 public List<UniqueKey<com.echothree.model.jooq.server.records.customer.Customers>> getUniqueKeys() { 188 return Arrays.asList(KeyRegistry.CUSTOMERS_PARTY_AND_THRU_TIME_UK, KeyRegistry.CUSTOMERS_CUSTOMER_NAME_AND_THRU_TIME_UK); 189 } 190 191 @Override 192 public List<ForeignKey<com.echothree.model.jooq.server.records.customer.Customers, ?>> getReferences() { 193 return Arrays.asList(KeyRegistry.CUSTOMERS_AR_GL_ACCOUNT_FK, KeyRegistry.CUSTOMERS_CANCELLATION_POLICY_FK, KeyRegistry.CUSTOMERS_CUSTOMER_TYPE_FK, KeyRegistry.CUSTOMERS_INITIAL_OFFER_USE_FK, KeyRegistry.CUSTOMERS_PARTY_FK, KeyRegistry.CUSTOMERS_RETURN_POLICY_FK); 194 } 195 196 private transient GlAccountsPath _cu_arglaccountid_fk; 197 198 /** 199 * Get the implicit join path to the <code>glaccounts</code> table. 200 */ 201 public GlAccountsPath cu_arglaccountid_fk() { 202 if (_cu_arglaccountid_fk == null) 203 _cu_arglaccountid_fk = new GlAccountsPath(this, KeyRegistry.CUSTOMERS_AR_GL_ACCOUNT_FK, null); 204 205 return _cu_arglaccountid_fk; 206 } 207 208 private transient CancellationPoliciesPath _cu_cnclplcy_cancellationpolicyid_fk; 209 210 /** 211 * Get the implicit join path to the <code>cancellationpolicies</code> 212 * table. 213 */ 214 public CancellationPoliciesPath cu_cnclplcy_cancellationpolicyid_fk() { 215 if (_cu_cnclplcy_cancellationpolicyid_fk == null) 216 _cu_cnclplcy_cancellationpolicyid_fk = new CancellationPoliciesPath(this, KeyRegistry.CUSTOMERS_CANCELLATION_POLICY_FK, null); 217 218 return _cu_cnclplcy_cancellationpolicyid_fk; 219 } 220 221 private transient CustomerTypesPath _cu_cuty_customertypeid_fk; 222 223 /** 224 * Get the implicit join path to the <code>customertypes</code> table. 225 */ 226 public CustomerTypesPath cu_cuty_customertypeid_fk() { 227 if (_cu_cuty_customertypeid_fk == null) 228 _cu_cuty_customertypeid_fk = new CustomerTypesPath(this, KeyRegistry.CUSTOMERS_CUSTOMER_TYPE_FK, null); 229 230 return _cu_cuty_customertypeid_fk; 231 } 232 233 private transient OfferUsesPath _cu_initialofferuseid_fk; 234 235 /** 236 * Get the implicit join path to the <code>offeruses</code> table. 237 */ 238 public OfferUsesPath cu_initialofferuseid_fk() { 239 if (_cu_initialofferuseid_fk == null) 240 _cu_initialofferuseid_fk = new OfferUsesPath(this, KeyRegistry.CUSTOMERS_INITIAL_OFFER_USE_FK, null); 241 242 return _cu_initialofferuseid_fk; 243 } 244 245 private transient PartiesPath _cu_par_partyid_fk; 246 247 /** 248 * Get the implicit join path to the <code>parties</code> table. 249 */ 250 public PartiesPath cu_par_partyid_fk() { 251 if (_cu_par_partyid_fk == null) 252 _cu_par_partyid_fk = new PartiesPath(this, KeyRegistry.CUSTOMERS_PARTY_FK, null); 253 254 return _cu_par_partyid_fk; 255 } 256 257 private transient ReturnPoliciesPath _cu_rtnplcy_returnpolicyid_fk; 258 259 /** 260 * Get the implicit join path to the <code>returnpolicies</code> table. 261 */ 262 public ReturnPoliciesPath cu_rtnplcy_returnpolicyid_fk() { 263 if (_cu_rtnplcy_returnpolicyid_fk == null) 264 _cu_rtnplcy_returnpolicyid_fk = new ReturnPoliciesPath(this, KeyRegistry.CUSTOMERS_RETURN_POLICY_FK, null); 265 266 return _cu_rtnplcy_returnpolicyid_fk; 267 } 268 269 @Override 270 public Customers as(String alias) { 271 return new Customers(DSL.name(alias), this); 272 } 273 274 @Override 275 public Customers as(Name alias) { 276 return new Customers(alias, this); 277 } 278 279 @Override 280 public Customers as(Table<?> alias) { 281 return new Customers(alias.getQualifiedName(), this); 282 } 283 284 /** 285 * Rename this table 286 */ 287 @Override 288 public Customers rename(String name) { 289 return new Customers(DSL.name(name), null); 290 } 291 292 /** 293 * Rename this table 294 */ 295 @Override 296 public Customers rename(Name name) { 297 return new Customers(name, null); 298 } 299 300 /** 301 * Rename this table 302 */ 303 @Override 304 public Customers rename(Table<?> name) { 305 return new Customers(name.getQualifiedName(), null); 306 } 307 308 /** 309 * Create an inline derived table from this table 310 */ 311 @Override 312 public Customers where(Condition condition) { 313 return new Customers(getQualifiedName(), aliased() ? this : null, null, Internal.condition(this, condition)); 314 } 315 316 /** 317 * Create an inline derived table from this table 318 */ 319 @Override 320 public Customers where(Collection<? extends Condition> conditions) { 321 return where(DSL.and(conditions)); 322 } 323 324 /** 325 * Create an inline derived table from this table 326 */ 327 @Override 328 public Customers where(Condition... conditions) { 329 return where(DSL.and(conditions)); 330 } 331 332 /** 333 * Create an inline derived table from this table 334 */ 335 @Override 336 public Customers where(Field<Boolean> 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 Customers where(SQL condition) { 346 return where(DSL.condition(condition)); 347 } 348 349 /** 350 * Create an inline derived table from this table 351 */ 352 @Override 353 @PlainSQL 354 public Customers where(@Stringly.SQL String condition) { 355 return where(DSL.condition(condition)); 356 } 357 358 /** 359 * Create an inline derived table from this table 360 */ 361 @Override 362 @PlainSQL 363 public Customers where(@Stringly.SQL String condition, Object... binds) { 364 return where(DSL.condition(condition, binds)); 365 } 366 367 /** 368 * Create an inline derived table from this table 369 */ 370 @Override 371 @PlainSQL 372 public Customers where(@Stringly.SQL String condition, QueryPart... parts) { 373 return where(DSL.condition(condition, parts)); 374 } 375 376 /** 377 * Create an inline derived table from this table 378 */ 379 @Override 380 public Customers whereExists(TableLike<?> select) { 381 return where(DSL.exists(select)); 382 } 383 384 /** 385 * Create an inline derived table from this table 386 */ 387 @Override 388 public Customers whereNotExists(TableLike<?> select) { 389 return where(DSL.notExists(select)); 390 } 391}