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 061public class CarrierServiceOption 062 extends BaseEntity 063 implements Serializable { 064 065 private CarrierServiceOptionPK _pk; 066 private CarrierServiceOptionValue _value; 067 068 /** Creates a new instance of CarrierServiceOption */ 069 public CarrierServiceOption() 070 throws PersistenceException { 071 super(); 072 } 073 074 /** Creates a new instance of CarrierServiceOption */ 075 public CarrierServiceOption(CarrierServiceOptionValue value, EntityPermission entityPermission) { 076 super(entityPermission); 077 078 _value = value; 079 _pk = value.getPrimaryKey(); 080 } 081 082 @Override 083 public CarrierServiceOptionFactory getBaseFactoryInstance() { 084 return CarrierServiceOptionFactory.getInstance(); 085 } 086 087 @Override 088 public boolean hasBeenModified() { 089 return _value.hasBeenModified(); 090 } 091 092 @Override 093 public int hashCode() { 094 return _pk.hashCode(); 095 } 096 097 @Override 098 public String toString() { 099 return _pk.toString(); 100 } 101 102 @Override 103 public boolean equals(Object other) { 104 if(this == other) 105 return true; 106 107 if(other instanceof CarrierServiceOption that) { 108 CarrierServiceOptionValue thatValue = that.getCarrierServiceOptionValue(); 109 return _value.equals(thatValue); 110 } else { 111 return false; 112 } 113 } 114 115 @Override 116 public void store() 117 throws PersistenceDatabaseException { 118 getBaseFactoryInstance().store(this); 119 } 120 121 @Override 122 public void remove() 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().remove(this); 125 } 126 127 public CarrierServiceOptionValue getCarrierServiceOptionValue() { 128 return _value; 129 } 130 131 public void setCarrierServiceOptionValue(CarrierServiceOptionValue value) 132 throws PersistenceReadOnlyException { 133 checkReadWrite(); 134 _value = value; 135 } 136 137 @Override 138 public CarrierServiceOptionPK getPrimaryKey() { 139 return _pk; 140 } 141 142 public CarrierServicePK getCarrierServicePK() { 143 return _value.getCarrierServicePK(); 144 } 145 146 public CarrierService getCarrierService(EntityPermission entityPermission) { 147 return CarrierServiceFactory.getInstance().getEntityFromPK(entityPermission, getCarrierServicePK()); 148 } 149 150 public CarrierService getCarrierService() { 151 return getCarrierService(EntityPermission.READ_ONLY); 152 } 153 154 public CarrierService getCarrierServiceForUpdate() { 155 return getCarrierService(EntityPermission.READ_WRITE); 156 } 157 158 public void setCarrierServicePK(CarrierServicePK carrierServicePK) 159 throws PersistenceNotNullException, PersistenceReadOnlyException { 160 checkReadWrite(); 161 _value.setCarrierServicePK(carrierServicePK); 162 } 163 164 public void setCarrierService(CarrierService entity) { 165 setCarrierServicePK(entity == null? null: entity.getPrimaryKey()); 166 } 167 168 public boolean getCarrierServicePKHasBeenModified() { 169 return _value.getCarrierServicePKHasBeenModified(); 170 } 171 172 public CarrierOptionPK getCarrierOptionPK() { 173 return _value.getCarrierOptionPK(); 174 } 175 176 public CarrierOption getCarrierOption(EntityPermission entityPermission) { 177 return CarrierOptionFactory.getInstance().getEntityFromPK(entityPermission, getCarrierOptionPK()); 178 } 179 180 public CarrierOption getCarrierOption() { 181 return getCarrierOption(EntityPermission.READ_ONLY); 182 } 183 184 public CarrierOption getCarrierOptionForUpdate() { 185 return getCarrierOption(EntityPermission.READ_WRITE); 186 } 187 188 public void setCarrierOptionPK(CarrierOptionPK carrierOptionPK) 189 throws PersistenceNotNullException, PersistenceReadOnlyException { 190 checkReadWrite(); 191 _value.setCarrierOptionPK(carrierOptionPK); 192 } 193 194 public void setCarrierOption(CarrierOption entity) { 195 setCarrierOptionPK(entity == null? null: entity.getPrimaryKey()); 196 } 197 198 public boolean getCarrierOptionPKHasBeenModified() { 199 return _value.getCarrierOptionPKHasBeenModified(); 200 } 201 202 public Boolean getIsRecommended() { 203 return _value.getIsRecommended(); 204 } 205 206 public void setIsRecommended(Boolean isRecommended) 207 throws PersistenceNotNullException, PersistenceReadOnlyException { 208 checkReadWrite(); 209 _value.setIsRecommended(isRecommended); 210 } 211 212 public boolean getIsRecommendedHasBeenModified() { 213 return _value.getIsRecommendedHasBeenModified(); 214 } 215 216 public Boolean getIsRequired() { 217 return _value.getIsRequired(); 218 } 219 220 public void setIsRequired(Boolean isRequired) 221 throws PersistenceNotNullException, PersistenceReadOnlyException { 222 checkReadWrite(); 223 _value.setIsRequired(isRequired); 224 } 225 226 public boolean getIsRequiredHasBeenModified() { 227 return _value.getIsRequiredHasBeenModified(); 228 } 229 230 public SelectorPK getRecommendedGeoCodeSelectorPK() { 231 return _value.getRecommendedGeoCodeSelectorPK(); 232 } 233 234 public Selector getRecommendedGeoCodeSelector(EntityPermission entityPermission) { 235 SelectorPK pk = getRecommendedGeoCodeSelectorPK(); 236 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 237 238 return entity; 239 } 240 241 public Selector getRecommendedGeoCodeSelector() { 242 return getRecommendedGeoCodeSelector(EntityPermission.READ_ONLY); 243 } 244 245 public Selector getRecommendedGeoCodeSelectorForUpdate() { 246 return getRecommendedGeoCodeSelector(EntityPermission.READ_WRITE); 247 } 248 249 public void setRecommendedGeoCodeSelectorPK(SelectorPK recommendedGeoCodeSelectorPK) 250 throws PersistenceNotNullException, PersistenceReadOnlyException { 251 checkReadWrite(); 252 _value.setRecommendedGeoCodeSelectorPK(recommendedGeoCodeSelectorPK); 253 } 254 255 public void setRecommendedGeoCodeSelector(Selector entity) { 256 setRecommendedGeoCodeSelectorPK(entity == null? null: entity.getPrimaryKey()); 257 } 258 259 public boolean getRecommendedGeoCodeSelectorPKHasBeenModified() { 260 return _value.getRecommendedGeoCodeSelectorPKHasBeenModified(); 261 } 262 263 public SelectorPK getRequiredGeoCodeSelectorPK() { 264 return _value.getRequiredGeoCodeSelectorPK(); 265 } 266 267 public Selector getRequiredGeoCodeSelector(EntityPermission entityPermission) { 268 SelectorPK pk = getRequiredGeoCodeSelectorPK(); 269 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 270 271 return entity; 272 } 273 274 public Selector getRequiredGeoCodeSelector() { 275 return getRequiredGeoCodeSelector(EntityPermission.READ_ONLY); 276 } 277 278 public Selector getRequiredGeoCodeSelectorForUpdate() { 279 return getRequiredGeoCodeSelector(EntityPermission.READ_WRITE); 280 } 281 282 public void setRequiredGeoCodeSelectorPK(SelectorPK requiredGeoCodeSelectorPK) 283 throws PersistenceNotNullException, PersistenceReadOnlyException { 284 checkReadWrite(); 285 _value.setRequiredGeoCodeSelectorPK(requiredGeoCodeSelectorPK); 286 } 287 288 public void setRequiredGeoCodeSelector(Selector entity) { 289 setRequiredGeoCodeSelectorPK(entity == null? null: entity.getPrimaryKey()); 290 } 291 292 public boolean getRequiredGeoCodeSelectorPKHasBeenModified() { 293 return _value.getRequiredGeoCodeSelectorPKHasBeenModified(); 294 } 295 296 public SelectorPK getRecommendedItemSelectorPK() { 297 return _value.getRecommendedItemSelectorPK(); 298 } 299 300 public Selector getRecommendedItemSelector(EntityPermission entityPermission) { 301 SelectorPK pk = getRecommendedItemSelectorPK(); 302 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 303 304 return entity; 305 } 306 307 public Selector getRecommendedItemSelector() { 308 return getRecommendedItemSelector(EntityPermission.READ_ONLY); 309 } 310 311 public Selector getRecommendedItemSelectorForUpdate() { 312 return getRecommendedItemSelector(EntityPermission.READ_WRITE); 313 } 314 315 public void setRecommendedItemSelectorPK(SelectorPK recommendedItemSelectorPK) 316 throws PersistenceNotNullException, PersistenceReadOnlyException { 317 checkReadWrite(); 318 _value.setRecommendedItemSelectorPK(recommendedItemSelectorPK); 319 } 320 321 public void setRecommendedItemSelector(Selector entity) { 322 setRecommendedItemSelectorPK(entity == null? null: entity.getPrimaryKey()); 323 } 324 325 public boolean getRecommendedItemSelectorPKHasBeenModified() { 326 return _value.getRecommendedItemSelectorPKHasBeenModified(); 327 } 328 329 public SelectorPK getRequiredItemSelectorPK() { 330 return _value.getRequiredItemSelectorPK(); 331 } 332 333 public Selector getRequiredItemSelector(EntityPermission entityPermission) { 334 SelectorPK pk = getRequiredItemSelectorPK(); 335 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 336 337 return entity; 338 } 339 340 public Selector getRequiredItemSelector() { 341 return getRequiredItemSelector(EntityPermission.READ_ONLY); 342 } 343 344 public Selector getRequiredItemSelectorForUpdate() { 345 return getRequiredItemSelector(EntityPermission.READ_WRITE); 346 } 347 348 public void setRequiredItemSelectorPK(SelectorPK requiredItemSelectorPK) 349 throws PersistenceNotNullException, PersistenceReadOnlyException { 350 checkReadWrite(); 351 _value.setRequiredItemSelectorPK(requiredItemSelectorPK); 352 } 353 354 public void setRequiredItemSelector(Selector entity) { 355 setRequiredItemSelectorPK(entity == null? null: entity.getPrimaryKey()); 356 } 357 358 public boolean getRequiredItemSelectorPKHasBeenModified() { 359 return _value.getRequiredItemSelectorPKHasBeenModified(); 360 } 361 362 public SelectorPK getRecommendedOrderSelectorPK() { 363 return _value.getRecommendedOrderSelectorPK(); 364 } 365 366 public Selector getRecommendedOrderSelector(EntityPermission entityPermission) { 367 SelectorPK pk = getRecommendedOrderSelectorPK(); 368 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 369 370 return entity; 371 } 372 373 public Selector getRecommendedOrderSelector() { 374 return getRecommendedOrderSelector(EntityPermission.READ_ONLY); 375 } 376 377 public Selector getRecommendedOrderSelectorForUpdate() { 378 return getRecommendedOrderSelector(EntityPermission.READ_WRITE); 379 } 380 381 public void setRecommendedOrderSelectorPK(SelectorPK recommendedOrderSelectorPK) 382 throws PersistenceNotNullException, PersistenceReadOnlyException { 383 checkReadWrite(); 384 _value.setRecommendedOrderSelectorPK(recommendedOrderSelectorPK); 385 } 386 387 public void setRecommendedOrderSelector(Selector entity) { 388 setRecommendedOrderSelectorPK(entity == null? null: entity.getPrimaryKey()); 389 } 390 391 public boolean getRecommendedOrderSelectorPKHasBeenModified() { 392 return _value.getRecommendedOrderSelectorPKHasBeenModified(); 393 } 394 395 public SelectorPK getRequiredOrderSelectorPK() { 396 return _value.getRequiredOrderSelectorPK(); 397 } 398 399 public Selector getRequiredOrderSelector(EntityPermission entityPermission) { 400 SelectorPK pk = getRequiredOrderSelectorPK(); 401 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 402 403 return entity; 404 } 405 406 public Selector getRequiredOrderSelector() { 407 return getRequiredOrderSelector(EntityPermission.READ_ONLY); 408 } 409 410 public Selector getRequiredOrderSelectorForUpdate() { 411 return getRequiredOrderSelector(EntityPermission.READ_WRITE); 412 } 413 414 public void setRequiredOrderSelectorPK(SelectorPK requiredOrderSelectorPK) 415 throws PersistenceNotNullException, PersistenceReadOnlyException { 416 checkReadWrite(); 417 _value.setRequiredOrderSelectorPK(requiredOrderSelectorPK); 418 } 419 420 public void setRequiredOrderSelector(Selector entity) { 421 setRequiredOrderSelectorPK(entity == null? null: entity.getPrimaryKey()); 422 } 423 424 public boolean getRequiredOrderSelectorPKHasBeenModified() { 425 return _value.getRequiredOrderSelectorPKHasBeenModified(); 426 } 427 428 public SelectorPK getRecommendedShipmentSelectorPK() { 429 return _value.getRecommendedShipmentSelectorPK(); 430 } 431 432 public Selector getRecommendedShipmentSelector(EntityPermission entityPermission) { 433 SelectorPK pk = getRecommendedShipmentSelectorPK(); 434 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 435 436 return entity; 437 } 438 439 public Selector getRecommendedShipmentSelector() { 440 return getRecommendedShipmentSelector(EntityPermission.READ_ONLY); 441 } 442 443 public Selector getRecommendedShipmentSelectorForUpdate() { 444 return getRecommendedShipmentSelector(EntityPermission.READ_WRITE); 445 } 446 447 public void setRecommendedShipmentSelectorPK(SelectorPK recommendedShipmentSelectorPK) 448 throws PersistenceNotNullException, PersistenceReadOnlyException { 449 checkReadWrite(); 450 _value.setRecommendedShipmentSelectorPK(recommendedShipmentSelectorPK); 451 } 452 453 public void setRecommendedShipmentSelector(Selector entity) { 454 setRecommendedShipmentSelectorPK(entity == null? null: entity.getPrimaryKey()); 455 } 456 457 public boolean getRecommendedShipmentSelectorPKHasBeenModified() { 458 return _value.getRecommendedShipmentSelectorPKHasBeenModified(); 459 } 460 461 public SelectorPK getRequiredShipmentSelectorPK() { 462 return _value.getRequiredShipmentSelectorPK(); 463 } 464 465 public Selector getRequiredShipmentSelector(EntityPermission entityPermission) { 466 SelectorPK pk = getRequiredShipmentSelectorPK(); 467 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 468 469 return entity; 470 } 471 472 public Selector getRequiredShipmentSelector() { 473 return getRequiredShipmentSelector(EntityPermission.READ_ONLY); 474 } 475 476 public Selector getRequiredShipmentSelectorForUpdate() { 477 return getRequiredShipmentSelector(EntityPermission.READ_WRITE); 478 } 479 480 public void setRequiredShipmentSelectorPK(SelectorPK requiredShipmentSelectorPK) 481 throws PersistenceNotNullException, PersistenceReadOnlyException { 482 checkReadWrite(); 483 _value.setRequiredShipmentSelectorPK(requiredShipmentSelectorPK); 484 } 485 486 public void setRequiredShipmentSelector(Selector entity) { 487 setRequiredShipmentSelectorPK(entity == null? null: entity.getPrimaryKey()); 488 } 489 490 public boolean getRequiredShipmentSelectorPKHasBeenModified() { 491 return _value.getRequiredShipmentSelectorPKHasBeenModified(); 492 } 493 494 public Long getFromTime() { 495 return _value.getFromTime(); 496 } 497 498 public void setFromTime(Long fromTime) 499 throws PersistenceNotNullException, PersistenceReadOnlyException { 500 checkReadWrite(); 501 _value.setFromTime(fromTime); 502 } 503 504 public boolean getFromTimeHasBeenModified() { 505 return _value.getFromTimeHasBeenModified(); 506 } 507 508 public Long getThruTime() { 509 return _value.getThruTime(); 510 } 511 512 public void setThruTime(Long thruTime) 513 throws PersistenceNotNullException, PersistenceReadOnlyException { 514 checkReadWrite(); 515 _value.setThruTime(thruTime); 516 } 517 518 public boolean getThruTimeHasBeenModified() { 519 return _value.getThruTimeHasBeenModified(); 520 } 521 522}