001// -------------------------------------------------------------------------------- 002// Copyright 2002-2025 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 * ShipmentDetail.java 021 */ 022 023package com.echothree.model.data.shipment.server.entity; 024 025import com.echothree.model.data.shipment.common.pk.ShipmentDetailPK; 026 027import com.echothree.model.data.shipment.common.pk.ShipmentPK; 028import com.echothree.model.data.shipment.common.pk.ShipmentTypePK; 029import com.echothree.model.data.party.common.pk.PartyPK; 030import com.echothree.model.data.contact.common.pk.PartyContactMechanismPK; 031import com.echothree.model.data.shipping.common.pk.ShippingMethodPK; 032 033import com.echothree.model.data.shipment.server.entity.Shipment; 034import com.echothree.model.data.shipment.server.entity.ShipmentType; 035import com.echothree.model.data.party.server.entity.Party; 036import com.echothree.model.data.contact.server.entity.PartyContactMechanism; 037import com.echothree.model.data.shipping.server.entity.ShippingMethod; 038 039import com.echothree.model.data.shipment.server.factory.ShipmentFactory; 040import com.echothree.model.data.shipment.server.factory.ShipmentTypeFactory; 041import com.echothree.model.data.party.server.factory.PartyFactory; 042import com.echothree.model.data.contact.server.factory.PartyContactMechanismFactory; 043import com.echothree.model.data.shipping.server.factory.ShippingMethodFactory; 044 045import com.echothree.model.data.shipment.common.pk.ShipmentDetailPK; 046 047import com.echothree.model.data.shipment.server.value.ShipmentDetailValue; 048 049import com.echothree.model.data.shipment.server.factory.ShipmentDetailFactory; 050 051import com.echothree.util.common.exception.PersistenceException; 052import com.echothree.util.common.exception.PersistenceDatabaseException; 053import com.echothree.util.common.exception.PersistenceNotNullException; 054import com.echothree.util.common.exception.PersistenceReadOnlyException; 055 056import com.echothree.util.common.persistence.BasePK; 057 058import com.echothree.util.common.persistence.type.ByteArray; 059 060import com.echothree.util.server.persistence.BaseEntity; 061import com.echothree.util.server.persistence.EntityPermission; 062import com.echothree.util.server.persistence.Session; 063import com.echothree.util.server.persistence.ThreadSession; 064 065import java.io.Serializable; 066 067public class ShipmentDetail 068 extends BaseEntity 069 implements Serializable { 070 071 private ShipmentDetailPK _pk; 072 private ShipmentDetailValue _value; 073 074 /** Creates a new instance of ShipmentDetail */ 075 public ShipmentDetail() 076 throws PersistenceException { 077 super(); 078 } 079 080 /** Creates a new instance of ShipmentDetail */ 081 public ShipmentDetail(ShipmentDetailValue value, EntityPermission entityPermission) { 082 super(entityPermission); 083 084 _value = value; 085 _pk = value.getPrimaryKey(); 086 } 087 088 @Override 089 public ShipmentDetailFactory getBaseFactoryInstance() { 090 return ShipmentDetailFactory.getInstance(); 091 } 092 093 @Override 094 public boolean hasBeenModified() { 095 return _value.hasBeenModified(); 096 } 097 098 @Override 099 public int hashCode() { 100 return _pk.hashCode(); 101 } 102 103 @Override 104 public String toString() { 105 return _pk.toString(); 106 } 107 108 @Override 109 public boolean equals(Object other) { 110 if(this == other) 111 return true; 112 113 if(other instanceof ShipmentDetail that) { 114 ShipmentDetailValue thatValue = that.getShipmentDetailValue(); 115 return _value.equals(thatValue); 116 } else { 117 return false; 118 } 119 } 120 121 @Override 122 public void store(Session session) 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().store(session, this); 125 } 126 127 @Override 128 public void remove(Session session) 129 throws PersistenceDatabaseException { 130 getBaseFactoryInstance().remove(session, this); 131 } 132 133 @Override 134 public void remove() 135 throws PersistenceDatabaseException { 136 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 137 } 138 139 public ShipmentDetailValue getShipmentDetailValue() { 140 return _value; 141 } 142 143 public void setShipmentDetailValue(ShipmentDetailValue value) 144 throws PersistenceReadOnlyException { 145 checkReadWrite(); 146 _value = value; 147 } 148 149 @Override 150 public ShipmentDetailPK getPrimaryKey() { 151 return _pk; 152 } 153 154 public ShipmentPK getShipmentPK() { 155 return _value.getShipmentPK(); 156 } 157 158 public Shipment getShipment(Session session, EntityPermission entityPermission) { 159 return ShipmentFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentPK()); 160 } 161 162 public Shipment getShipment(EntityPermission entityPermission) { 163 return getShipment(ThreadSession.currentSession(), entityPermission); 164 } 165 166 public Shipment getShipment(Session session) { 167 return getShipment(session, EntityPermission.READ_ONLY); 168 } 169 170 public Shipment getShipment() { 171 return getShipment(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 172 } 173 174 public Shipment getShipmentForUpdate(Session session) { 175 return getShipment(session, EntityPermission.READ_WRITE); 176 } 177 178 public Shipment getShipmentForUpdate() { 179 return getShipment(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 180 } 181 182 public void setShipmentPK(ShipmentPK shipmentPK) 183 throws PersistenceNotNullException, PersistenceReadOnlyException { 184 checkReadWrite(); 185 _value.setShipmentPK(shipmentPK); 186 } 187 188 public void setShipment(Shipment entity) { 189 setShipmentPK(entity == null? null: entity.getPrimaryKey()); 190 } 191 192 public boolean getShipmentPKHasBeenModified() { 193 return _value.getShipmentPKHasBeenModified(); 194 } 195 196 public ShipmentTypePK getShipmentTypePK() { 197 return _value.getShipmentTypePK(); 198 } 199 200 public ShipmentType getShipmentType(Session session, EntityPermission entityPermission) { 201 return ShipmentTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentTypePK()); 202 } 203 204 public ShipmentType getShipmentType(EntityPermission entityPermission) { 205 return getShipmentType(ThreadSession.currentSession(), entityPermission); 206 } 207 208 public ShipmentType getShipmentType(Session session) { 209 return getShipmentType(session, EntityPermission.READ_ONLY); 210 } 211 212 public ShipmentType getShipmentType() { 213 return getShipmentType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 214 } 215 216 public ShipmentType getShipmentTypeForUpdate(Session session) { 217 return getShipmentType(session, EntityPermission.READ_WRITE); 218 } 219 220 public ShipmentType getShipmentTypeForUpdate() { 221 return getShipmentType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 222 } 223 224 public void setShipmentTypePK(ShipmentTypePK shipmentTypePK) 225 throws PersistenceNotNullException, PersistenceReadOnlyException { 226 checkReadWrite(); 227 _value.setShipmentTypePK(shipmentTypePK); 228 } 229 230 public void setShipmentType(ShipmentType entity) { 231 setShipmentTypePK(entity == null? null: entity.getPrimaryKey()); 232 } 233 234 public boolean getShipmentTypePKHasBeenModified() { 235 return _value.getShipmentTypePKHasBeenModified(); 236 } 237 238 public String getShipmentName() { 239 return _value.getShipmentName(); 240 } 241 242 public void setShipmentName(String shipmentName) 243 throws PersistenceNotNullException, PersistenceReadOnlyException { 244 checkReadWrite(); 245 _value.setShipmentName(shipmentName); 246 } 247 248 public boolean getShipmentNameHasBeenModified() { 249 return _value.getShipmentNameHasBeenModified(); 250 } 251 252 public PartyPK getOriginPartyPK() { 253 return _value.getOriginPartyPK(); 254 } 255 256 public Party getOriginParty(Session session, EntityPermission entityPermission) { 257 return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getOriginPartyPK()); 258 } 259 260 public Party getOriginParty(EntityPermission entityPermission) { 261 return getOriginParty(ThreadSession.currentSession(), entityPermission); 262 } 263 264 public Party getOriginParty(Session session) { 265 return getOriginParty(session, EntityPermission.READ_ONLY); 266 } 267 268 public Party getOriginParty() { 269 return getOriginParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 270 } 271 272 public Party getOriginPartyForUpdate(Session session) { 273 return getOriginParty(session, EntityPermission.READ_WRITE); 274 } 275 276 public Party getOriginPartyForUpdate() { 277 return getOriginParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 278 } 279 280 public void setOriginPartyPK(PartyPK originPartyPK) 281 throws PersistenceNotNullException, PersistenceReadOnlyException { 282 checkReadWrite(); 283 _value.setOriginPartyPK(originPartyPK); 284 } 285 286 public void setOriginParty(Party entity) { 287 setOriginPartyPK(entity == null? null: entity.getPrimaryKey()); 288 } 289 290 public boolean getOriginPartyPKHasBeenModified() { 291 return _value.getOriginPartyPKHasBeenModified(); 292 } 293 294 public PartyPK getOriginWarehousePartyPK() { 295 return _value.getOriginWarehousePartyPK(); 296 } 297 298 public Party getOriginWarehouseParty(Session session, EntityPermission entityPermission) { 299 PartyPK pk = getOriginWarehousePartyPK(); 300 Party entity = pk == null? null: PartyFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 301 302 return entity; 303 } 304 305 public Party getOriginWarehouseParty(EntityPermission entityPermission) { 306 return getOriginWarehouseParty(ThreadSession.currentSession(), entityPermission); 307 } 308 309 public Party getOriginWarehouseParty(Session session) { 310 return getOriginWarehouseParty(session, EntityPermission.READ_ONLY); 311 } 312 313 public Party getOriginWarehouseParty() { 314 return getOriginWarehouseParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 315 } 316 317 public Party getOriginWarehousePartyForUpdate(Session session) { 318 return getOriginWarehouseParty(session, EntityPermission.READ_WRITE); 319 } 320 321 public Party getOriginWarehousePartyForUpdate() { 322 return getOriginWarehouseParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 323 } 324 325 public void setOriginWarehousePartyPK(PartyPK originWarehousePartyPK) 326 throws PersistenceNotNullException, PersistenceReadOnlyException { 327 checkReadWrite(); 328 _value.setOriginWarehousePartyPK(originWarehousePartyPK); 329 } 330 331 public void setOriginWarehouseParty(Party entity) { 332 setOriginWarehousePartyPK(entity == null? null: entity.getPrimaryKey()); 333 } 334 335 public boolean getOriginWarehousePartyPKHasBeenModified() { 336 return _value.getOriginWarehousePartyPKHasBeenModified(); 337 } 338 339 public PartyContactMechanismPK getOriginPartyContactMechanismPK() { 340 return _value.getOriginPartyContactMechanismPK(); 341 } 342 343 public PartyContactMechanism getOriginPartyContactMechanism(Session session, EntityPermission entityPermission) { 344 PartyContactMechanismPK pk = getOriginPartyContactMechanismPK(); 345 PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 346 347 return entity; 348 } 349 350 public PartyContactMechanism getOriginPartyContactMechanism(EntityPermission entityPermission) { 351 return getOriginPartyContactMechanism(ThreadSession.currentSession(), entityPermission); 352 } 353 354 public PartyContactMechanism getOriginPartyContactMechanism(Session session) { 355 return getOriginPartyContactMechanism(session, EntityPermission.READ_ONLY); 356 } 357 358 public PartyContactMechanism getOriginPartyContactMechanism() { 359 return getOriginPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 360 } 361 362 public PartyContactMechanism getOriginPartyContactMechanismForUpdate(Session session) { 363 return getOriginPartyContactMechanism(session, EntityPermission.READ_WRITE); 364 } 365 366 public PartyContactMechanism getOriginPartyContactMechanismForUpdate() { 367 return getOriginPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 368 } 369 370 public void setOriginPartyContactMechanismPK(PartyContactMechanismPK originPartyContactMechanismPK) 371 throws PersistenceNotNullException, PersistenceReadOnlyException { 372 checkReadWrite(); 373 _value.setOriginPartyContactMechanismPK(originPartyContactMechanismPK); 374 } 375 376 public void setOriginPartyContactMechanism(PartyContactMechanism entity) { 377 setOriginPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey()); 378 } 379 380 public boolean getOriginPartyContactMechanismPKHasBeenModified() { 381 return _value.getOriginPartyContactMechanismPKHasBeenModified(); 382 } 383 384 public PartyPK getDestinationPartyPK() { 385 return _value.getDestinationPartyPK(); 386 } 387 388 public Party getDestinationParty(Session session, EntityPermission entityPermission) { 389 return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getDestinationPartyPK()); 390 } 391 392 public Party getDestinationParty(EntityPermission entityPermission) { 393 return getDestinationParty(ThreadSession.currentSession(), entityPermission); 394 } 395 396 public Party getDestinationParty(Session session) { 397 return getDestinationParty(session, EntityPermission.READ_ONLY); 398 } 399 400 public Party getDestinationParty() { 401 return getDestinationParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 402 } 403 404 public Party getDestinationPartyForUpdate(Session session) { 405 return getDestinationParty(session, EntityPermission.READ_WRITE); 406 } 407 408 public Party getDestinationPartyForUpdate() { 409 return getDestinationParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 410 } 411 412 public void setDestinationPartyPK(PartyPK destinationPartyPK) 413 throws PersistenceNotNullException, PersistenceReadOnlyException { 414 checkReadWrite(); 415 _value.setDestinationPartyPK(destinationPartyPK); 416 } 417 418 public void setDestinationParty(Party entity) { 419 setDestinationPartyPK(entity == null? null: entity.getPrimaryKey()); 420 } 421 422 public boolean getDestinationPartyPKHasBeenModified() { 423 return _value.getDestinationPartyPKHasBeenModified(); 424 } 425 426 public PartyPK getDestinationWarehousePartyPK() { 427 return _value.getDestinationWarehousePartyPK(); 428 } 429 430 public Party getDestinationWarehouseParty(Session session, EntityPermission entityPermission) { 431 PartyPK pk = getDestinationWarehousePartyPK(); 432 Party entity = pk == null? null: PartyFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 433 434 return entity; 435 } 436 437 public Party getDestinationWarehouseParty(EntityPermission entityPermission) { 438 return getDestinationWarehouseParty(ThreadSession.currentSession(), entityPermission); 439 } 440 441 public Party getDestinationWarehouseParty(Session session) { 442 return getDestinationWarehouseParty(session, EntityPermission.READ_ONLY); 443 } 444 445 public Party getDestinationWarehouseParty() { 446 return getDestinationWarehouseParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 447 } 448 449 public Party getDestinationWarehousePartyForUpdate(Session session) { 450 return getDestinationWarehouseParty(session, EntityPermission.READ_WRITE); 451 } 452 453 public Party getDestinationWarehousePartyForUpdate() { 454 return getDestinationWarehouseParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 455 } 456 457 public void setDestinationWarehousePartyPK(PartyPK destinationWarehousePartyPK) 458 throws PersistenceNotNullException, PersistenceReadOnlyException { 459 checkReadWrite(); 460 _value.setDestinationWarehousePartyPK(destinationWarehousePartyPK); 461 } 462 463 public void setDestinationWarehouseParty(Party entity) { 464 setDestinationWarehousePartyPK(entity == null? null: entity.getPrimaryKey()); 465 } 466 467 public boolean getDestinationWarehousePartyPKHasBeenModified() { 468 return _value.getDestinationWarehousePartyPKHasBeenModified(); 469 } 470 471 public PartyContactMechanismPK getDestinationPartyContactMechanismPK() { 472 return _value.getDestinationPartyContactMechanismPK(); 473 } 474 475 public PartyContactMechanism getDestinationPartyContactMechanism(Session session, EntityPermission entityPermission) { 476 PartyContactMechanismPK pk = getDestinationPartyContactMechanismPK(); 477 PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 478 479 return entity; 480 } 481 482 public PartyContactMechanism getDestinationPartyContactMechanism(EntityPermission entityPermission) { 483 return getDestinationPartyContactMechanism(ThreadSession.currentSession(), entityPermission); 484 } 485 486 public PartyContactMechanism getDestinationPartyContactMechanism(Session session) { 487 return getDestinationPartyContactMechanism(session, EntityPermission.READ_ONLY); 488 } 489 490 public PartyContactMechanism getDestinationPartyContactMechanism() { 491 return getDestinationPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 492 } 493 494 public PartyContactMechanism getDestinationPartyContactMechanismForUpdate(Session session) { 495 return getDestinationPartyContactMechanism(session, EntityPermission.READ_WRITE); 496 } 497 498 public PartyContactMechanism getDestinationPartyContactMechanismForUpdate() { 499 return getDestinationPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 500 } 501 502 public void setDestinationPartyContactMechanismPK(PartyContactMechanismPK destinationPartyContactMechanismPK) 503 throws PersistenceNotNullException, PersistenceReadOnlyException { 504 checkReadWrite(); 505 _value.setDestinationPartyContactMechanismPK(destinationPartyContactMechanismPK); 506 } 507 508 public void setDestinationPartyContactMechanism(PartyContactMechanism entity) { 509 setDestinationPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey()); 510 } 511 512 public boolean getDestinationPartyContactMechanismPKHasBeenModified() { 513 return _value.getDestinationPartyContactMechanismPKHasBeenModified(); 514 } 515 516 public ShippingMethodPK getShippingMethodPK() { 517 return _value.getShippingMethodPK(); 518 } 519 520 public ShippingMethod getShippingMethod(Session session, EntityPermission entityPermission) { 521 ShippingMethodPK pk = getShippingMethodPK(); 522 ShippingMethod entity = pk == null? null: ShippingMethodFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 523 524 return entity; 525 } 526 527 public ShippingMethod getShippingMethod(EntityPermission entityPermission) { 528 return getShippingMethod(ThreadSession.currentSession(), entityPermission); 529 } 530 531 public ShippingMethod getShippingMethod(Session session) { 532 return getShippingMethod(session, EntityPermission.READ_ONLY); 533 } 534 535 public ShippingMethod getShippingMethod() { 536 return getShippingMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 537 } 538 539 public ShippingMethod getShippingMethodForUpdate(Session session) { 540 return getShippingMethod(session, EntityPermission.READ_WRITE); 541 } 542 543 public ShippingMethod getShippingMethodForUpdate() { 544 return getShippingMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 545 } 546 547 public void setShippingMethodPK(ShippingMethodPK shippingMethodPK) 548 throws PersistenceNotNullException, PersistenceReadOnlyException { 549 checkReadWrite(); 550 _value.setShippingMethodPK(shippingMethodPK); 551 } 552 553 public void setShippingMethod(ShippingMethod entity) { 554 setShippingMethodPK(entity == null? null: entity.getPrimaryKey()); 555 } 556 557 public boolean getShippingMethodPKHasBeenModified() { 558 return _value.getShippingMethodPKHasBeenModified(); 559 } 560 561 public Long getFromTime() { 562 return _value.getFromTime(); 563 } 564 565 public void setFromTime(Long fromTime) 566 throws PersistenceNotNullException, PersistenceReadOnlyException { 567 checkReadWrite(); 568 _value.setFromTime(fromTime); 569 } 570 571 public boolean getFromTimeHasBeenModified() { 572 return _value.getFromTimeHasBeenModified(); 573 } 574 575 public Long getThruTime() { 576 return _value.getThruTime(); 577 } 578 579 public void setThruTime(Long thruTime) 580 throws PersistenceNotNullException, PersistenceReadOnlyException { 581 checkReadWrite(); 582 _value.setThruTime(thruTime); 583 } 584 585 public boolean getThruTimeHasBeenModified() { 586 return _value.getThruTimeHasBeenModified(); 587 } 588 589}