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 * 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() 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().store(this); 125 } 126 127 @Override 128 public void remove() 129 throws PersistenceDatabaseException { 130 getBaseFactoryInstance().remove(this); 131 } 132 133 public ShipmentDetailValue getShipmentDetailValue() { 134 return _value; 135 } 136 137 public void setShipmentDetailValue(ShipmentDetailValue value) 138 throws PersistenceReadOnlyException { 139 checkReadWrite(); 140 _value = value; 141 } 142 143 @Override 144 public ShipmentDetailPK getPrimaryKey() { 145 return _pk; 146 } 147 148 public ShipmentPK getShipmentPK() { 149 return _value.getShipmentPK(); 150 } 151 152 public Shipment getShipment(EntityPermission entityPermission) { 153 return ShipmentFactory.getInstance().getEntityFromPK(entityPermission, getShipmentPK()); 154 } 155 156 public Shipment getShipment() { 157 return getShipment(EntityPermission.READ_ONLY); 158 } 159 160 public Shipment getShipmentForUpdate() { 161 return getShipment(EntityPermission.READ_WRITE); 162 } 163 164 public void setShipmentPK(ShipmentPK shipmentPK) 165 throws PersistenceNotNullException, PersistenceReadOnlyException { 166 checkReadWrite(); 167 _value.setShipmentPK(shipmentPK); 168 } 169 170 public void setShipment(Shipment entity) { 171 setShipmentPK(entity == null? null: entity.getPrimaryKey()); 172 } 173 174 public boolean getShipmentPKHasBeenModified() { 175 return _value.getShipmentPKHasBeenModified(); 176 } 177 178 public ShipmentTypePK getShipmentTypePK() { 179 return _value.getShipmentTypePK(); 180 } 181 182 public ShipmentType getShipmentType(EntityPermission entityPermission) { 183 return ShipmentTypeFactory.getInstance().getEntityFromPK(entityPermission, getShipmentTypePK()); 184 } 185 186 public ShipmentType getShipmentType() { 187 return getShipmentType(EntityPermission.READ_ONLY); 188 } 189 190 public ShipmentType getShipmentTypeForUpdate() { 191 return getShipmentType(EntityPermission.READ_WRITE); 192 } 193 194 public void setShipmentTypePK(ShipmentTypePK shipmentTypePK) 195 throws PersistenceNotNullException, PersistenceReadOnlyException { 196 checkReadWrite(); 197 _value.setShipmentTypePK(shipmentTypePK); 198 } 199 200 public void setShipmentType(ShipmentType entity) { 201 setShipmentTypePK(entity == null? null: entity.getPrimaryKey()); 202 } 203 204 public boolean getShipmentTypePKHasBeenModified() { 205 return _value.getShipmentTypePKHasBeenModified(); 206 } 207 208 public String getShipmentName() { 209 return _value.getShipmentName(); 210 } 211 212 public void setShipmentName(String shipmentName) 213 throws PersistenceNotNullException, PersistenceReadOnlyException { 214 checkReadWrite(); 215 _value.setShipmentName(shipmentName); 216 } 217 218 public boolean getShipmentNameHasBeenModified() { 219 return _value.getShipmentNameHasBeenModified(); 220 } 221 222 public PartyPK getOriginPartyPK() { 223 return _value.getOriginPartyPK(); 224 } 225 226 public Party getOriginParty(EntityPermission entityPermission) { 227 return PartyFactory.getInstance().getEntityFromPK(entityPermission, getOriginPartyPK()); 228 } 229 230 public Party getOriginParty() { 231 return getOriginParty(EntityPermission.READ_ONLY); 232 } 233 234 public Party getOriginPartyForUpdate() { 235 return getOriginParty(EntityPermission.READ_WRITE); 236 } 237 238 public void setOriginPartyPK(PartyPK originPartyPK) 239 throws PersistenceNotNullException, PersistenceReadOnlyException { 240 checkReadWrite(); 241 _value.setOriginPartyPK(originPartyPK); 242 } 243 244 public void setOriginParty(Party entity) { 245 setOriginPartyPK(entity == null? null: entity.getPrimaryKey()); 246 } 247 248 public boolean getOriginPartyPKHasBeenModified() { 249 return _value.getOriginPartyPKHasBeenModified(); 250 } 251 252 public PartyPK getOriginWarehousePartyPK() { 253 return _value.getOriginWarehousePartyPK(); 254 } 255 256 public Party getOriginWarehouseParty(EntityPermission entityPermission) { 257 PartyPK pk = getOriginWarehousePartyPK(); 258 Party entity = pk == null? null: PartyFactory.getInstance().getEntityFromPK(entityPermission, pk); 259 260 return entity; 261 } 262 263 public Party getOriginWarehouseParty() { 264 return getOriginWarehouseParty(EntityPermission.READ_ONLY); 265 } 266 267 public Party getOriginWarehousePartyForUpdate() { 268 return getOriginWarehouseParty(EntityPermission.READ_WRITE); 269 } 270 271 public void setOriginWarehousePartyPK(PartyPK originWarehousePartyPK) 272 throws PersistenceNotNullException, PersistenceReadOnlyException { 273 checkReadWrite(); 274 _value.setOriginWarehousePartyPK(originWarehousePartyPK); 275 } 276 277 public void setOriginWarehouseParty(Party entity) { 278 setOriginWarehousePartyPK(entity == null? null: entity.getPrimaryKey()); 279 } 280 281 public boolean getOriginWarehousePartyPKHasBeenModified() { 282 return _value.getOriginWarehousePartyPKHasBeenModified(); 283 } 284 285 public PartyContactMechanismPK getOriginPartyContactMechanismPK() { 286 return _value.getOriginPartyContactMechanismPK(); 287 } 288 289 public PartyContactMechanism getOriginPartyContactMechanism(EntityPermission entityPermission) { 290 PartyContactMechanismPK pk = getOriginPartyContactMechanismPK(); 291 PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, pk); 292 293 return entity; 294 } 295 296 public PartyContactMechanism getOriginPartyContactMechanism() { 297 return getOriginPartyContactMechanism(EntityPermission.READ_ONLY); 298 } 299 300 public PartyContactMechanism getOriginPartyContactMechanismForUpdate() { 301 return getOriginPartyContactMechanism(EntityPermission.READ_WRITE); 302 } 303 304 public void setOriginPartyContactMechanismPK(PartyContactMechanismPK originPartyContactMechanismPK) 305 throws PersistenceNotNullException, PersistenceReadOnlyException { 306 checkReadWrite(); 307 _value.setOriginPartyContactMechanismPK(originPartyContactMechanismPK); 308 } 309 310 public void setOriginPartyContactMechanism(PartyContactMechanism entity) { 311 setOriginPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey()); 312 } 313 314 public boolean getOriginPartyContactMechanismPKHasBeenModified() { 315 return _value.getOriginPartyContactMechanismPKHasBeenModified(); 316 } 317 318 public PartyPK getDestinationPartyPK() { 319 return _value.getDestinationPartyPK(); 320 } 321 322 public Party getDestinationParty(EntityPermission entityPermission) { 323 return PartyFactory.getInstance().getEntityFromPK(entityPermission, getDestinationPartyPK()); 324 } 325 326 public Party getDestinationParty() { 327 return getDestinationParty(EntityPermission.READ_ONLY); 328 } 329 330 public Party getDestinationPartyForUpdate() { 331 return getDestinationParty(EntityPermission.READ_WRITE); 332 } 333 334 public void setDestinationPartyPK(PartyPK destinationPartyPK) 335 throws PersistenceNotNullException, PersistenceReadOnlyException { 336 checkReadWrite(); 337 _value.setDestinationPartyPK(destinationPartyPK); 338 } 339 340 public void setDestinationParty(Party entity) { 341 setDestinationPartyPK(entity == null? null: entity.getPrimaryKey()); 342 } 343 344 public boolean getDestinationPartyPKHasBeenModified() { 345 return _value.getDestinationPartyPKHasBeenModified(); 346 } 347 348 public PartyPK getDestinationWarehousePartyPK() { 349 return _value.getDestinationWarehousePartyPK(); 350 } 351 352 public Party getDestinationWarehouseParty(EntityPermission entityPermission) { 353 PartyPK pk = getDestinationWarehousePartyPK(); 354 Party entity = pk == null? null: PartyFactory.getInstance().getEntityFromPK(entityPermission, pk); 355 356 return entity; 357 } 358 359 public Party getDestinationWarehouseParty() { 360 return getDestinationWarehouseParty(EntityPermission.READ_ONLY); 361 } 362 363 public Party getDestinationWarehousePartyForUpdate() { 364 return getDestinationWarehouseParty(EntityPermission.READ_WRITE); 365 } 366 367 public void setDestinationWarehousePartyPK(PartyPK destinationWarehousePartyPK) 368 throws PersistenceNotNullException, PersistenceReadOnlyException { 369 checkReadWrite(); 370 _value.setDestinationWarehousePartyPK(destinationWarehousePartyPK); 371 } 372 373 public void setDestinationWarehouseParty(Party entity) { 374 setDestinationWarehousePartyPK(entity == null? null: entity.getPrimaryKey()); 375 } 376 377 public boolean getDestinationWarehousePartyPKHasBeenModified() { 378 return _value.getDestinationWarehousePartyPKHasBeenModified(); 379 } 380 381 public PartyContactMechanismPK getDestinationPartyContactMechanismPK() { 382 return _value.getDestinationPartyContactMechanismPK(); 383 } 384 385 public PartyContactMechanism getDestinationPartyContactMechanism(EntityPermission entityPermission) { 386 PartyContactMechanismPK pk = getDestinationPartyContactMechanismPK(); 387 PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, pk); 388 389 return entity; 390 } 391 392 public PartyContactMechanism getDestinationPartyContactMechanism() { 393 return getDestinationPartyContactMechanism(EntityPermission.READ_ONLY); 394 } 395 396 public PartyContactMechanism getDestinationPartyContactMechanismForUpdate() { 397 return getDestinationPartyContactMechanism(EntityPermission.READ_WRITE); 398 } 399 400 public void setDestinationPartyContactMechanismPK(PartyContactMechanismPK destinationPartyContactMechanismPK) 401 throws PersistenceNotNullException, PersistenceReadOnlyException { 402 checkReadWrite(); 403 _value.setDestinationPartyContactMechanismPK(destinationPartyContactMechanismPK); 404 } 405 406 public void setDestinationPartyContactMechanism(PartyContactMechanism entity) { 407 setDestinationPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey()); 408 } 409 410 public boolean getDestinationPartyContactMechanismPKHasBeenModified() { 411 return _value.getDestinationPartyContactMechanismPKHasBeenModified(); 412 } 413 414 public ShippingMethodPK getShippingMethodPK() { 415 return _value.getShippingMethodPK(); 416 } 417 418 public ShippingMethod getShippingMethod(EntityPermission entityPermission) { 419 ShippingMethodPK pk = getShippingMethodPK(); 420 ShippingMethod entity = pk == null? null: ShippingMethodFactory.getInstance().getEntityFromPK(entityPermission, pk); 421 422 return entity; 423 } 424 425 public ShippingMethod getShippingMethod() { 426 return getShippingMethod(EntityPermission.READ_ONLY); 427 } 428 429 public ShippingMethod getShippingMethodForUpdate() { 430 return getShippingMethod(EntityPermission.READ_WRITE); 431 } 432 433 public void setShippingMethodPK(ShippingMethodPK shippingMethodPK) 434 throws PersistenceNotNullException, PersistenceReadOnlyException { 435 checkReadWrite(); 436 _value.setShippingMethodPK(shippingMethodPK); 437 } 438 439 public void setShippingMethod(ShippingMethod entity) { 440 setShippingMethodPK(entity == null? null: entity.getPrimaryKey()); 441 } 442 443 public boolean getShippingMethodPKHasBeenModified() { 444 return _value.getShippingMethodPKHasBeenModified(); 445 } 446 447 public Long getFromTime() { 448 return _value.getFromTime(); 449 } 450 451 public void setFromTime(Long fromTime) 452 throws PersistenceNotNullException, PersistenceReadOnlyException { 453 checkReadWrite(); 454 _value.setFromTime(fromTime); 455 } 456 457 public boolean getFromTimeHasBeenModified() { 458 return _value.getFromTimeHasBeenModified(); 459 } 460 461 public Long getThruTime() { 462 return _value.getThruTime(); 463 } 464 465 public void setThruTime(Long thruTime) 466 throws PersistenceNotNullException, PersistenceReadOnlyException { 467 checkReadWrite(); 468 _value.setThruTime(thruTime); 469 } 470 471 public boolean getThruTimeHasBeenModified() { 472 return _value.getThruTimeHasBeenModified(); 473 } 474 475}