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 * ShipmentPackageLineDetail.java 021 */ 022 023package com.echothree.model.data.shipment.server.entity; 024 025import com.echothree.model.data.shipment.common.pk.ShipmentPackageLineDetailPK; 026 027import com.echothree.model.data.shipment.common.pk.ShipmentPackageLinePK; 028import com.echothree.model.data.shipment.common.pk.ShipmentPackagePK; 029import com.echothree.model.data.shipment.common.pk.ShipmentLinePK; 030import com.echothree.model.data.item.common.pk.ItemPK; 031import com.echothree.model.data.inventory.common.pk.InventoryConditionPK; 032import com.echothree.model.data.uom.common.pk.UnitOfMeasureTypePK; 033 034import com.echothree.model.data.shipment.server.entity.ShipmentPackageLine; 035import com.echothree.model.data.shipment.server.entity.ShipmentPackage; 036import com.echothree.model.data.shipment.server.entity.ShipmentLine; 037import com.echothree.model.data.item.server.entity.Item; 038import com.echothree.model.data.inventory.server.entity.InventoryCondition; 039import com.echothree.model.data.uom.server.entity.UnitOfMeasureType; 040 041import com.echothree.model.data.shipment.server.factory.ShipmentPackageLineFactory; 042import com.echothree.model.data.shipment.server.factory.ShipmentPackageFactory; 043import com.echothree.model.data.shipment.server.factory.ShipmentLineFactory; 044import com.echothree.model.data.item.server.factory.ItemFactory; 045import com.echothree.model.data.inventory.server.factory.InventoryConditionFactory; 046import com.echothree.model.data.uom.server.factory.UnitOfMeasureTypeFactory; 047 048import com.echothree.model.data.shipment.common.pk.ShipmentPackageLineDetailPK; 049 050import com.echothree.model.data.shipment.server.value.ShipmentPackageLineDetailValue; 051 052import com.echothree.model.data.shipment.server.factory.ShipmentPackageLineDetailFactory; 053 054import com.echothree.util.common.exception.PersistenceException; 055import com.echothree.util.common.exception.PersistenceDatabaseException; 056import com.echothree.util.common.exception.PersistenceNotNullException; 057import com.echothree.util.common.exception.PersistenceReadOnlyException; 058 059import com.echothree.util.common.persistence.BasePK; 060 061import com.echothree.util.common.persistence.type.ByteArray; 062 063import com.echothree.util.server.persistence.BaseEntity; 064import com.echothree.util.server.persistence.EntityPermission; 065import com.echothree.util.server.persistence.Session; 066import com.echothree.util.server.persistence.ThreadSession; 067 068import java.io.Serializable; 069 070public class ShipmentPackageLineDetail 071 extends BaseEntity 072 implements Serializable { 073 074 private ShipmentPackageLineDetailPK _pk; 075 private ShipmentPackageLineDetailValue _value; 076 077 /** Creates a new instance of ShipmentPackageLineDetail */ 078 public ShipmentPackageLineDetail() 079 throws PersistenceException { 080 super(); 081 } 082 083 /** Creates a new instance of ShipmentPackageLineDetail */ 084 public ShipmentPackageLineDetail(ShipmentPackageLineDetailValue value, EntityPermission entityPermission) { 085 super(entityPermission); 086 087 _value = value; 088 _pk = value.getPrimaryKey(); 089 } 090 091 @Override 092 public ShipmentPackageLineDetailFactory getBaseFactoryInstance() { 093 return ShipmentPackageLineDetailFactory.getInstance(); 094 } 095 096 @Override 097 public boolean hasBeenModified() { 098 return _value.hasBeenModified(); 099 } 100 101 @Override 102 public int hashCode() { 103 return _pk.hashCode(); 104 } 105 106 @Override 107 public String toString() { 108 return _pk.toString(); 109 } 110 111 @Override 112 public boolean equals(Object other) { 113 if(this == other) 114 return true; 115 116 if(other instanceof ShipmentPackageLineDetail that) { 117 ShipmentPackageLineDetailValue thatValue = that.getShipmentPackageLineDetailValue(); 118 return _value.equals(thatValue); 119 } else { 120 return false; 121 } 122 } 123 124 @Override 125 public void store(Session session) 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().store(session, this); 128 } 129 130 @Override 131 public void remove(Session session) 132 throws PersistenceDatabaseException { 133 getBaseFactoryInstance().remove(session, this); 134 } 135 136 @Override 137 public void remove() 138 throws PersistenceDatabaseException { 139 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 140 } 141 142 public ShipmentPackageLineDetailValue getShipmentPackageLineDetailValue() { 143 return _value; 144 } 145 146 public void setShipmentPackageLineDetailValue(ShipmentPackageLineDetailValue value) 147 throws PersistenceReadOnlyException { 148 checkReadWrite(); 149 _value = value; 150 } 151 152 @Override 153 public ShipmentPackageLineDetailPK getPrimaryKey() { 154 return _pk; 155 } 156 157 public ShipmentPackageLinePK getShipmentPackageLinePK() { 158 return _value.getShipmentPackageLinePK(); 159 } 160 161 public ShipmentPackageLine getShipmentPackageLine(Session session, EntityPermission entityPermission) { 162 return ShipmentPackageLineFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentPackageLinePK()); 163 } 164 165 public ShipmentPackageLine getShipmentPackageLine(EntityPermission entityPermission) { 166 return getShipmentPackageLine(ThreadSession.currentSession(), entityPermission); 167 } 168 169 public ShipmentPackageLine getShipmentPackageLine(Session session) { 170 return getShipmentPackageLine(session, EntityPermission.READ_ONLY); 171 } 172 173 public ShipmentPackageLine getShipmentPackageLine() { 174 return getShipmentPackageLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 175 } 176 177 public ShipmentPackageLine getShipmentPackageLineForUpdate(Session session) { 178 return getShipmentPackageLine(session, EntityPermission.READ_WRITE); 179 } 180 181 public ShipmentPackageLine getShipmentPackageLineForUpdate() { 182 return getShipmentPackageLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 183 } 184 185 public void setShipmentPackageLinePK(ShipmentPackageLinePK shipmentPackageLinePK) 186 throws PersistenceNotNullException, PersistenceReadOnlyException { 187 checkReadWrite(); 188 _value.setShipmentPackageLinePK(shipmentPackageLinePK); 189 } 190 191 public void setShipmentPackageLine(ShipmentPackageLine entity) { 192 setShipmentPackageLinePK(entity == null? null: entity.getPrimaryKey()); 193 } 194 195 public boolean getShipmentPackageLinePKHasBeenModified() { 196 return _value.getShipmentPackageLinePKHasBeenModified(); 197 } 198 199 public ShipmentPackagePK getShipmentPackagePK() { 200 return _value.getShipmentPackagePK(); 201 } 202 203 public ShipmentPackage getShipmentPackage(Session session, EntityPermission entityPermission) { 204 return ShipmentPackageFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentPackagePK()); 205 } 206 207 public ShipmentPackage getShipmentPackage(EntityPermission entityPermission) { 208 return getShipmentPackage(ThreadSession.currentSession(), entityPermission); 209 } 210 211 public ShipmentPackage getShipmentPackage(Session session) { 212 return getShipmentPackage(session, EntityPermission.READ_ONLY); 213 } 214 215 public ShipmentPackage getShipmentPackage() { 216 return getShipmentPackage(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 217 } 218 219 public ShipmentPackage getShipmentPackageForUpdate(Session session) { 220 return getShipmentPackage(session, EntityPermission.READ_WRITE); 221 } 222 223 public ShipmentPackage getShipmentPackageForUpdate() { 224 return getShipmentPackage(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 225 } 226 227 public void setShipmentPackagePK(ShipmentPackagePK shipmentPackagePK) 228 throws PersistenceNotNullException, PersistenceReadOnlyException { 229 checkReadWrite(); 230 _value.setShipmentPackagePK(shipmentPackagePK); 231 } 232 233 public void setShipmentPackage(ShipmentPackage entity) { 234 setShipmentPackagePK(entity == null? null: entity.getPrimaryKey()); 235 } 236 237 public boolean getShipmentPackagePKHasBeenModified() { 238 return _value.getShipmentPackagePKHasBeenModified(); 239 } 240 241 public Integer getShipmentPackageLineSequence() { 242 return _value.getShipmentPackageLineSequence(); 243 } 244 245 public void setShipmentPackageLineSequence(Integer shipmentPackageLineSequence) 246 throws PersistenceNotNullException, PersistenceReadOnlyException { 247 checkReadWrite(); 248 _value.setShipmentPackageLineSequence(shipmentPackageLineSequence); 249 } 250 251 public boolean getShipmentPackageLineSequenceHasBeenModified() { 252 return _value.getShipmentPackageLineSequenceHasBeenModified(); 253 } 254 255 public ShipmentLinePK getShipmentLinePK() { 256 return _value.getShipmentLinePK(); 257 } 258 259 public ShipmentLine getShipmentLine(Session session, EntityPermission entityPermission) { 260 ShipmentLinePK pk = getShipmentLinePK(); 261 ShipmentLine entity = pk == null? null: ShipmentLineFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 262 263 return entity; 264 } 265 266 public ShipmentLine getShipmentLine(EntityPermission entityPermission) { 267 return getShipmentLine(ThreadSession.currentSession(), entityPermission); 268 } 269 270 public ShipmentLine getShipmentLine(Session session) { 271 return getShipmentLine(session, EntityPermission.READ_ONLY); 272 } 273 274 public ShipmentLine getShipmentLine() { 275 return getShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 276 } 277 278 public ShipmentLine getShipmentLineForUpdate(Session session) { 279 return getShipmentLine(session, EntityPermission.READ_WRITE); 280 } 281 282 public ShipmentLine getShipmentLineForUpdate() { 283 return getShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 284 } 285 286 public void setShipmentLinePK(ShipmentLinePK shipmentLinePK) 287 throws PersistenceNotNullException, PersistenceReadOnlyException { 288 checkReadWrite(); 289 _value.setShipmentLinePK(shipmentLinePK); 290 } 291 292 public void setShipmentLine(ShipmentLine entity) { 293 setShipmentLinePK(entity == null? null: entity.getPrimaryKey()); 294 } 295 296 public boolean getShipmentLinePKHasBeenModified() { 297 return _value.getShipmentLinePKHasBeenModified(); 298 } 299 300 public ItemPK getItemPK() { 301 return _value.getItemPK(); 302 } 303 304 public Item getItem(Session session, EntityPermission entityPermission) { 305 return ItemFactory.getInstance().getEntityFromPK(session, entityPermission, getItemPK()); 306 } 307 308 public Item getItem(EntityPermission entityPermission) { 309 return getItem(ThreadSession.currentSession(), entityPermission); 310 } 311 312 public Item getItem(Session session) { 313 return getItem(session, EntityPermission.READ_ONLY); 314 } 315 316 public Item getItem() { 317 return getItem(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 318 } 319 320 public Item getItemForUpdate(Session session) { 321 return getItem(session, EntityPermission.READ_WRITE); 322 } 323 324 public Item getItemForUpdate() { 325 return getItem(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 326 } 327 328 public void setItemPK(ItemPK itemPK) 329 throws PersistenceNotNullException, PersistenceReadOnlyException { 330 checkReadWrite(); 331 _value.setItemPK(itemPK); 332 } 333 334 public void setItem(Item entity) { 335 setItemPK(entity == null? null: entity.getPrimaryKey()); 336 } 337 338 public boolean getItemPKHasBeenModified() { 339 return _value.getItemPKHasBeenModified(); 340 } 341 342 public InventoryConditionPK getInventoryConditionPK() { 343 return _value.getInventoryConditionPK(); 344 } 345 346 public InventoryCondition getInventoryCondition(Session session, EntityPermission entityPermission) { 347 return InventoryConditionFactory.getInstance().getEntityFromPK(session, entityPermission, getInventoryConditionPK()); 348 } 349 350 public InventoryCondition getInventoryCondition(EntityPermission entityPermission) { 351 return getInventoryCondition(ThreadSession.currentSession(), entityPermission); 352 } 353 354 public InventoryCondition getInventoryCondition(Session session) { 355 return getInventoryCondition(session, EntityPermission.READ_ONLY); 356 } 357 358 public InventoryCondition getInventoryCondition() { 359 return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 360 } 361 362 public InventoryCondition getInventoryConditionForUpdate(Session session) { 363 return getInventoryCondition(session, EntityPermission.READ_WRITE); 364 } 365 366 public InventoryCondition getInventoryConditionForUpdate() { 367 return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 368 } 369 370 public void setInventoryConditionPK(InventoryConditionPK inventoryConditionPK) 371 throws PersistenceNotNullException, PersistenceReadOnlyException { 372 checkReadWrite(); 373 _value.setInventoryConditionPK(inventoryConditionPK); 374 } 375 376 public void setInventoryCondition(InventoryCondition entity) { 377 setInventoryConditionPK(entity == null? null: entity.getPrimaryKey()); 378 } 379 380 public boolean getInventoryConditionPKHasBeenModified() { 381 return _value.getInventoryConditionPKHasBeenModified(); 382 } 383 384 public UnitOfMeasureTypePK getUnitOfMeasureTypePK() { 385 return _value.getUnitOfMeasureTypePK(); 386 } 387 388 public UnitOfMeasureType getUnitOfMeasureType(Session session, EntityPermission entityPermission) { 389 return UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getUnitOfMeasureTypePK()); 390 } 391 392 public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) { 393 return getUnitOfMeasureType(ThreadSession.currentSession(), entityPermission); 394 } 395 396 public UnitOfMeasureType getUnitOfMeasureType(Session session) { 397 return getUnitOfMeasureType(session, EntityPermission.READ_ONLY); 398 } 399 400 public UnitOfMeasureType getUnitOfMeasureType() { 401 return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 402 } 403 404 public UnitOfMeasureType getUnitOfMeasureTypeForUpdate(Session session) { 405 return getUnitOfMeasureType(session, EntityPermission.READ_WRITE); 406 } 407 408 public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() { 409 return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 410 } 411 412 public void setUnitOfMeasureTypePK(UnitOfMeasureTypePK unitOfMeasureTypePK) 413 throws PersistenceNotNullException, PersistenceReadOnlyException { 414 checkReadWrite(); 415 _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK); 416 } 417 418 public void setUnitOfMeasureType(UnitOfMeasureType entity) { 419 setUnitOfMeasureTypePK(entity == null? null: entity.getPrimaryKey()); 420 } 421 422 public boolean getUnitOfMeasureTypePKHasBeenModified() { 423 return _value.getUnitOfMeasureTypePKHasBeenModified(); 424 } 425 426 public Long getQuantity() { 427 return _value.getQuantity(); 428 } 429 430 public void setQuantity(Long quantity) 431 throws PersistenceNotNullException, PersistenceReadOnlyException { 432 checkReadWrite(); 433 _value.setQuantity(quantity); 434 } 435 436 public boolean getQuantityHasBeenModified() { 437 return _value.getQuantityHasBeenModified(); 438 } 439 440 public Long getFromTime() { 441 return _value.getFromTime(); 442 } 443 444 public void setFromTime(Long fromTime) 445 throws PersistenceNotNullException, PersistenceReadOnlyException { 446 checkReadWrite(); 447 _value.setFromTime(fromTime); 448 } 449 450 public boolean getFromTimeHasBeenModified() { 451 return _value.getFromTimeHasBeenModified(); 452 } 453 454 public Long getThruTime() { 455 return _value.getThruTime(); 456 } 457 458 public void setThruTime(Long thruTime) 459 throws PersistenceNotNullException, PersistenceReadOnlyException { 460 checkReadWrite(); 461 _value.setThruTime(thruTime); 462 } 463 464 public boolean getThruTimeHasBeenModified() { 465 return _value.getThruTimeHasBeenModified(); 466 } 467 468}