001// -------------------------------------------------------------------------------- 002// Copyright 2002-2026 Echo Three, LLC 003// 004// Licensed under the Apache License, Version 2.0 (the "License"); 005// you may not use this file except in compliance with the License. 006// You may obtain a copy of the License at 007// 008// http://www.apache.org/licenses/LICENSE-2.0 009// 010// Unless required by applicable law or agreed to in writing, software 011// distributed under the License is distributed on an "AS IS" BASIS, 012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013// See the License for the specific language governing permissions and 014// limitations under the License. 015// -------------------------------------------------------------------------------- 016// Generated File -- DO NOT EDIT BY HAND 017// -------------------------------------------------------------------------------- 018 019/** 020 * CarrierServiceOption.java 021 */ 022 023package com.echothree.model.data.carrier.server.entity; 024 025import com.echothree.model.data.carrier.common.pk.CarrierServiceOptionPK; 026 027import com.echothree.model.data.carrier.common.pk.CarrierServicePK; 028import com.echothree.model.data.carrier.common.pk.CarrierOptionPK; 029import com.echothree.model.data.selector.common.pk.SelectorPK; 030 031import com.echothree.model.data.carrier.server.entity.CarrierService; 032import com.echothree.model.data.carrier.server.entity.CarrierOption; 033import com.echothree.model.data.selector.server.entity.Selector; 034 035import com.echothree.model.data.carrier.server.factory.CarrierServiceFactory; 036import com.echothree.model.data.carrier.server.factory.CarrierOptionFactory; 037import com.echothree.model.data.selector.server.factory.SelectorFactory; 038 039import com.echothree.model.data.carrier.common.pk.CarrierServiceOptionPK; 040 041import com.echothree.model.data.carrier.server.value.CarrierServiceOptionValue; 042 043import com.echothree.model.data.carrier.server.factory.CarrierServiceOptionFactory; 044 045import com.echothree.util.common.exception.PersistenceException; 046import com.echothree.util.common.exception.PersistenceDatabaseException; 047import com.echothree.util.common.exception.PersistenceNotNullException; 048import com.echothree.util.common.exception.PersistenceReadOnlyException; 049 050import com.echothree.util.common.persistence.BasePK; 051 052import com.echothree.util.common.persistence.type.ByteArray; 053 054import com.echothree.util.server.persistence.BaseEntity; 055import com.echothree.util.server.persistence.EntityPermission; 056import com.echothree.util.server.persistence.Session; 057import com.echothree.util.server.persistence.ThreadSession; 058 059import java.io.Serializable; 060 061import javax.annotation.Nonnull; 062import javax.annotation.Nullable; 063 064public class CarrierServiceOption 065 extends BaseEntity 066 implements Serializable { 067 068 private CarrierServiceOptionPK _pk; 069 private CarrierServiceOptionValue _value; 070 071 /** Creates a new instance of CarrierServiceOption */ 072 public CarrierServiceOption() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of CarrierServiceOption */ 078 public CarrierServiceOption(CarrierServiceOptionValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 @Nonnull 087 public CarrierServiceOptionFactory getBaseFactoryInstance() { 088 return CarrierServiceOptionFactory.getInstance(); 089 } 090 091 @Override 092 public boolean hasBeenModified() { 093 return _value.hasBeenModified(); 094 } 095 096 @Override 097 public int hashCode() { 098 return _pk.hashCode(); 099 } 100 101 @Override 102 @Nonnull 103 public String toString() { 104 return _pk.toString(); 105 } 106 107 @Override 108 public boolean equals(Object other) { 109 if(this == other) 110 return true; 111 112 if(other instanceof CarrierServiceOption that) { 113 CarrierServiceOptionValue thatValue = that.getCarrierServiceOptionValue(); 114 return _value.equals(thatValue); 115 } else { 116 return false; 117 } 118 } 119 120 @Override 121 public void store() 122 throws PersistenceDatabaseException { 123 getBaseFactoryInstance().store(this); 124 } 125 126 @Override 127 public void remove() 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().remove(this); 130 } 131 132 @Nonnull 133 public CarrierServiceOptionValue getCarrierServiceOptionValue() { 134 return _value; 135 } 136 137 public void setCarrierServiceOptionValue(@Nonnull CarrierServiceOptionValue value) 138 throws PersistenceReadOnlyException { 139 checkReadWrite(); 140 _value = value; 141 } 142 143 @Override 144 @Nonnull 145 public CarrierServiceOptionPK getPrimaryKey() { 146 return _pk; 147 } 148 149 @Nonnull 150 public CarrierServicePK getCarrierServicePK() { 151 return _value.getCarrierServicePK(); 152 } 153 154 @Nonnull 155 public CarrierService getCarrierService(EntityPermission entityPermission) { 156 return CarrierServiceFactory.getInstance().getEntityFromPK(entityPermission, getCarrierServicePK()); 157 } 158 159 @Nonnull 160 public CarrierService getCarrierService() { 161 return getCarrierService(EntityPermission.READ_ONLY); 162 } 163 164 @Nonnull 165 public CarrierService getCarrierServiceForUpdate() { 166 return getCarrierService(EntityPermission.READ_WRITE); 167 } 168 169 public void setCarrierServicePK(@Nonnull CarrierServicePK carrierServicePK) 170 throws PersistenceNotNullException, PersistenceReadOnlyException { 171 checkReadWrite(); 172 _value.setCarrierServicePK(carrierServicePK); 173 } 174 175 public void setCarrierService(@Nonnull CarrierService entity) { 176 setCarrierServicePK(entity == null ? null : entity.getPrimaryKey()); 177 } 178 179 public boolean getCarrierServicePKHasBeenModified() { 180 return _value.getCarrierServicePKHasBeenModified(); 181 } 182 183 @Nonnull 184 public CarrierOptionPK getCarrierOptionPK() { 185 return _value.getCarrierOptionPK(); 186 } 187 188 @Nonnull 189 public CarrierOption getCarrierOption(EntityPermission entityPermission) { 190 return CarrierOptionFactory.getInstance().getEntityFromPK(entityPermission, getCarrierOptionPK()); 191 } 192 193 @Nonnull 194 public CarrierOption getCarrierOption() { 195 return getCarrierOption(EntityPermission.READ_ONLY); 196 } 197 198 @Nonnull 199 public CarrierOption getCarrierOptionForUpdate() { 200 return getCarrierOption(EntityPermission.READ_WRITE); 201 } 202 203 public void setCarrierOptionPK(@Nonnull CarrierOptionPK carrierOptionPK) 204 throws PersistenceNotNullException, PersistenceReadOnlyException { 205 checkReadWrite(); 206 _value.setCarrierOptionPK(carrierOptionPK); 207 } 208 209 public void setCarrierOption(@Nonnull CarrierOption entity) { 210 setCarrierOptionPK(entity == null ? null : entity.getPrimaryKey()); 211 } 212 213 public boolean getCarrierOptionPKHasBeenModified() { 214 return _value.getCarrierOptionPKHasBeenModified(); 215 } 216 217 @Nonnull 218 public Boolean getIsRecommended() { 219 return _value.getIsRecommended(); 220 } 221 222 public void setIsRecommended(@Nonnull Boolean isRecommended) 223 throws PersistenceNotNullException, PersistenceReadOnlyException { 224 checkReadWrite(); 225 _value.setIsRecommended(isRecommended); 226 } 227 228 public boolean getIsRecommendedHasBeenModified() { 229 return _value.getIsRecommendedHasBeenModified(); 230 } 231 232 @Nonnull 233 public Boolean getIsRequired() { 234 return _value.getIsRequired(); 235 } 236 237 public void setIsRequired(@Nonnull Boolean isRequired) 238 throws PersistenceNotNullException, PersistenceReadOnlyException { 239 checkReadWrite(); 240 _value.setIsRequired(isRequired); 241 } 242 243 public boolean getIsRequiredHasBeenModified() { 244 return _value.getIsRequiredHasBeenModified(); 245 } 246 247 @Nullable 248 public SelectorPK getRecommendedGeoCodeSelectorPK() { 249 return _value.getRecommendedGeoCodeSelectorPK(); 250 } 251 252 @Nullable 253 public Selector getRecommendedGeoCodeSelector(EntityPermission entityPermission) { 254 SelectorPK pk = getRecommendedGeoCodeSelectorPK(); 255 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 256 257 return entity; 258 } 259 260 @Nullable 261 public Selector getRecommendedGeoCodeSelector() { 262 return getRecommendedGeoCodeSelector(EntityPermission.READ_ONLY); 263 } 264 265 @Nullable 266 public Selector getRecommendedGeoCodeSelectorForUpdate() { 267 return getRecommendedGeoCodeSelector(EntityPermission.READ_WRITE); 268 } 269 270 public void setRecommendedGeoCodeSelectorPK(@Nullable SelectorPK recommendedGeoCodeSelectorPK) 271 throws PersistenceNotNullException, PersistenceReadOnlyException { 272 checkReadWrite(); 273 _value.setRecommendedGeoCodeSelectorPK(recommendedGeoCodeSelectorPK); 274 } 275 276 public void setRecommendedGeoCodeSelector(@Nullable Selector entity) { 277 setRecommendedGeoCodeSelectorPK(entity == null ? null : entity.getPrimaryKey()); 278 } 279 280 public boolean getRecommendedGeoCodeSelectorPKHasBeenModified() { 281 return _value.getRecommendedGeoCodeSelectorPKHasBeenModified(); 282 } 283 284 @Nullable 285 public SelectorPK getRequiredGeoCodeSelectorPK() { 286 return _value.getRequiredGeoCodeSelectorPK(); 287 } 288 289 @Nullable 290 public Selector getRequiredGeoCodeSelector(EntityPermission entityPermission) { 291 SelectorPK pk = getRequiredGeoCodeSelectorPK(); 292 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 293 294 return entity; 295 } 296 297 @Nullable 298 public Selector getRequiredGeoCodeSelector() { 299 return getRequiredGeoCodeSelector(EntityPermission.READ_ONLY); 300 } 301 302 @Nullable 303 public Selector getRequiredGeoCodeSelectorForUpdate() { 304 return getRequiredGeoCodeSelector(EntityPermission.READ_WRITE); 305 } 306 307 public void setRequiredGeoCodeSelectorPK(@Nullable SelectorPK requiredGeoCodeSelectorPK) 308 throws PersistenceNotNullException, PersistenceReadOnlyException { 309 checkReadWrite(); 310 _value.setRequiredGeoCodeSelectorPK(requiredGeoCodeSelectorPK); 311 } 312 313 public void setRequiredGeoCodeSelector(@Nullable Selector entity) { 314 setRequiredGeoCodeSelectorPK(entity == null ? null : entity.getPrimaryKey()); 315 } 316 317 public boolean getRequiredGeoCodeSelectorPKHasBeenModified() { 318 return _value.getRequiredGeoCodeSelectorPKHasBeenModified(); 319 } 320 321 @Nullable 322 public SelectorPK getRecommendedItemSelectorPK() { 323 return _value.getRecommendedItemSelectorPK(); 324 } 325 326 @Nullable 327 public Selector getRecommendedItemSelector(EntityPermission entityPermission) { 328 SelectorPK pk = getRecommendedItemSelectorPK(); 329 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 330 331 return entity; 332 } 333 334 @Nullable 335 public Selector getRecommendedItemSelector() { 336 return getRecommendedItemSelector(EntityPermission.READ_ONLY); 337 } 338 339 @Nullable 340 public Selector getRecommendedItemSelectorForUpdate() { 341 return getRecommendedItemSelector(EntityPermission.READ_WRITE); 342 } 343 344 public void setRecommendedItemSelectorPK(@Nullable SelectorPK recommendedItemSelectorPK) 345 throws PersistenceNotNullException, PersistenceReadOnlyException { 346 checkReadWrite(); 347 _value.setRecommendedItemSelectorPK(recommendedItemSelectorPK); 348 } 349 350 public void setRecommendedItemSelector(@Nullable Selector entity) { 351 setRecommendedItemSelectorPK(entity == null ? null : entity.getPrimaryKey()); 352 } 353 354 public boolean getRecommendedItemSelectorPKHasBeenModified() { 355 return _value.getRecommendedItemSelectorPKHasBeenModified(); 356 } 357 358 @Nullable 359 public SelectorPK getRequiredItemSelectorPK() { 360 return _value.getRequiredItemSelectorPK(); 361 } 362 363 @Nullable 364 public Selector getRequiredItemSelector(EntityPermission entityPermission) { 365 SelectorPK pk = getRequiredItemSelectorPK(); 366 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 367 368 return entity; 369 } 370 371 @Nullable 372 public Selector getRequiredItemSelector() { 373 return getRequiredItemSelector(EntityPermission.READ_ONLY); 374 } 375 376 @Nullable 377 public Selector getRequiredItemSelectorForUpdate() { 378 return getRequiredItemSelector(EntityPermission.READ_WRITE); 379 } 380 381 public void setRequiredItemSelectorPK(@Nullable SelectorPK requiredItemSelectorPK) 382 throws PersistenceNotNullException, PersistenceReadOnlyException { 383 checkReadWrite(); 384 _value.setRequiredItemSelectorPK(requiredItemSelectorPK); 385 } 386 387 public void setRequiredItemSelector(@Nullable Selector entity) { 388 setRequiredItemSelectorPK(entity == null ? null : entity.getPrimaryKey()); 389 } 390 391 public boolean getRequiredItemSelectorPKHasBeenModified() { 392 return _value.getRequiredItemSelectorPKHasBeenModified(); 393 } 394 395 @Nullable 396 public SelectorPK getRecommendedOrderSelectorPK() { 397 return _value.getRecommendedOrderSelectorPK(); 398 } 399 400 @Nullable 401 public Selector getRecommendedOrderSelector(EntityPermission entityPermission) { 402 SelectorPK pk = getRecommendedOrderSelectorPK(); 403 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 404 405 return entity; 406 } 407 408 @Nullable 409 public Selector getRecommendedOrderSelector() { 410 return getRecommendedOrderSelector(EntityPermission.READ_ONLY); 411 } 412 413 @Nullable 414 public Selector getRecommendedOrderSelectorForUpdate() { 415 return getRecommendedOrderSelector(EntityPermission.READ_WRITE); 416 } 417 418 public void setRecommendedOrderSelectorPK(@Nullable SelectorPK recommendedOrderSelectorPK) 419 throws PersistenceNotNullException, PersistenceReadOnlyException { 420 checkReadWrite(); 421 _value.setRecommendedOrderSelectorPK(recommendedOrderSelectorPK); 422 } 423 424 public void setRecommendedOrderSelector(@Nullable Selector entity) { 425 setRecommendedOrderSelectorPK(entity == null ? null : entity.getPrimaryKey()); 426 } 427 428 public boolean getRecommendedOrderSelectorPKHasBeenModified() { 429 return _value.getRecommendedOrderSelectorPKHasBeenModified(); 430 } 431 432 @Nullable 433 public SelectorPK getRequiredOrderSelectorPK() { 434 return _value.getRequiredOrderSelectorPK(); 435 } 436 437 @Nullable 438 public Selector getRequiredOrderSelector(EntityPermission entityPermission) { 439 SelectorPK pk = getRequiredOrderSelectorPK(); 440 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 441 442 return entity; 443 } 444 445 @Nullable 446 public Selector getRequiredOrderSelector() { 447 return getRequiredOrderSelector(EntityPermission.READ_ONLY); 448 } 449 450 @Nullable 451 public Selector getRequiredOrderSelectorForUpdate() { 452 return getRequiredOrderSelector(EntityPermission.READ_WRITE); 453 } 454 455 public void setRequiredOrderSelectorPK(@Nullable SelectorPK requiredOrderSelectorPK) 456 throws PersistenceNotNullException, PersistenceReadOnlyException { 457 checkReadWrite(); 458 _value.setRequiredOrderSelectorPK(requiredOrderSelectorPK); 459 } 460 461 public void setRequiredOrderSelector(@Nullable Selector entity) { 462 setRequiredOrderSelectorPK(entity == null ? null : entity.getPrimaryKey()); 463 } 464 465 public boolean getRequiredOrderSelectorPKHasBeenModified() { 466 return _value.getRequiredOrderSelectorPKHasBeenModified(); 467 } 468 469 @Nullable 470 public SelectorPK getRecommendedShipmentSelectorPK() { 471 return _value.getRecommendedShipmentSelectorPK(); 472 } 473 474 @Nullable 475 public Selector getRecommendedShipmentSelector(EntityPermission entityPermission) { 476 SelectorPK pk = getRecommendedShipmentSelectorPK(); 477 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 478 479 return entity; 480 } 481 482 @Nullable 483 public Selector getRecommendedShipmentSelector() { 484 return getRecommendedShipmentSelector(EntityPermission.READ_ONLY); 485 } 486 487 @Nullable 488 public Selector getRecommendedShipmentSelectorForUpdate() { 489 return getRecommendedShipmentSelector(EntityPermission.READ_WRITE); 490 } 491 492 public void setRecommendedShipmentSelectorPK(@Nullable SelectorPK recommendedShipmentSelectorPK) 493 throws PersistenceNotNullException, PersistenceReadOnlyException { 494 checkReadWrite(); 495 _value.setRecommendedShipmentSelectorPK(recommendedShipmentSelectorPK); 496 } 497 498 public void setRecommendedShipmentSelector(@Nullable Selector entity) { 499 setRecommendedShipmentSelectorPK(entity == null ? null : entity.getPrimaryKey()); 500 } 501 502 public boolean getRecommendedShipmentSelectorPKHasBeenModified() { 503 return _value.getRecommendedShipmentSelectorPKHasBeenModified(); 504 } 505 506 @Nullable 507 public SelectorPK getRequiredShipmentSelectorPK() { 508 return _value.getRequiredShipmentSelectorPK(); 509 } 510 511 @Nullable 512 public Selector getRequiredShipmentSelector(EntityPermission entityPermission) { 513 SelectorPK pk = getRequiredShipmentSelectorPK(); 514 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 515 516 return entity; 517 } 518 519 @Nullable 520 public Selector getRequiredShipmentSelector() { 521 return getRequiredShipmentSelector(EntityPermission.READ_ONLY); 522 } 523 524 @Nullable 525 public Selector getRequiredShipmentSelectorForUpdate() { 526 return getRequiredShipmentSelector(EntityPermission.READ_WRITE); 527 } 528 529 public void setRequiredShipmentSelectorPK(@Nullable SelectorPK requiredShipmentSelectorPK) 530 throws PersistenceNotNullException, PersistenceReadOnlyException { 531 checkReadWrite(); 532 _value.setRequiredShipmentSelectorPK(requiredShipmentSelectorPK); 533 } 534 535 public void setRequiredShipmentSelector(@Nullable Selector entity) { 536 setRequiredShipmentSelectorPK(entity == null ? null : entity.getPrimaryKey()); 537 } 538 539 public boolean getRequiredShipmentSelectorPKHasBeenModified() { 540 return _value.getRequiredShipmentSelectorPKHasBeenModified(); 541 } 542 543 @Nonnull 544 public Long getFromTime() { 545 return _value.getFromTime(); 546 } 547 548 public void setFromTime(@Nonnull Long fromTime) 549 throws PersistenceNotNullException, PersistenceReadOnlyException { 550 checkReadWrite(); 551 _value.setFromTime(fromTime); 552 } 553 554 public boolean getFromTimeHasBeenModified() { 555 return _value.getFromTimeHasBeenModified(); 556 } 557 558 @Nonnull 559 public Long getThruTime() { 560 return _value.getThruTime(); 561 } 562 563 public void setThruTime(@Nonnull Long thruTime) 564 throws PersistenceNotNullException, PersistenceReadOnlyException { 565 checkReadWrite(); 566 _value.setThruTime(thruTime); 567 } 568 569 public boolean getThruTimeHasBeenModified() { 570 return _value.getThruTimeHasBeenModified(); 571 } 572 573}