001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 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) { 117 ShipmentPackageLineDetail that = (ShipmentPackageLineDetail)other; 118 119 ShipmentPackageLineDetailValue thatValue = that.getShipmentPackageLineDetailValue(); 120 return _value.equals(thatValue); 121 } else { 122 return false; 123 } 124 } 125 126 @Override 127 public void store(Session session) 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().store(session, this); 130 } 131 132 @Override 133 public void remove(Session session) 134 throws PersistenceDatabaseException { 135 getBaseFactoryInstance().remove(session, this); 136 } 137 138 @Override 139 public void remove() 140 throws PersistenceDatabaseException { 141 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 142 } 143 144 public ShipmentPackageLineDetailValue getShipmentPackageLineDetailValue() { 145 return _value; 146 } 147 148 public void setShipmentPackageLineDetailValue(ShipmentPackageLineDetailValue value) 149 throws PersistenceReadOnlyException { 150 checkReadWrite(); 151 _value = value; 152 } 153 154 @Override 155 public ShipmentPackageLineDetailPK getPrimaryKey() { 156 return _pk; 157 } 158 159 public ShipmentPackageLinePK getShipmentPackageLinePK() { 160 return _value.getShipmentPackageLinePK(); 161 } 162 163 public ShipmentPackageLine getShipmentPackageLine(Session session, EntityPermission entityPermission) { 164 return ShipmentPackageLineFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentPackageLinePK()); 165 } 166 167 public ShipmentPackageLine getShipmentPackageLine(EntityPermission entityPermission) { 168 return getShipmentPackageLine(ThreadSession.currentSession(), entityPermission); 169 } 170 171 public ShipmentPackageLine getShipmentPackageLine(Session session) { 172 return getShipmentPackageLine(session, EntityPermission.READ_ONLY); 173 } 174 175 public ShipmentPackageLine getShipmentPackageLine() { 176 return getShipmentPackageLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 177 } 178 179 public ShipmentPackageLine getShipmentPackageLineForUpdate(Session session) { 180 return getShipmentPackageLine(session, EntityPermission.READ_WRITE); 181 } 182 183 public ShipmentPackageLine getShipmentPackageLineForUpdate() { 184 return getShipmentPackageLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 185 } 186 187 public void setShipmentPackageLinePK(ShipmentPackageLinePK shipmentPackageLinePK) 188 throws PersistenceNotNullException, PersistenceReadOnlyException { 189 checkReadWrite(); 190 _value.setShipmentPackageLinePK(shipmentPackageLinePK); 191 } 192 193 public void setShipmentPackageLine(ShipmentPackageLine entity) { 194 setShipmentPackageLinePK(entity == null? null: entity.getPrimaryKey()); 195 } 196 197 public boolean getShipmentPackageLinePKHasBeenModified() { 198 return _value.getShipmentPackageLinePKHasBeenModified(); 199 } 200 201 public ShipmentPackagePK getShipmentPackagePK() { 202 return _value.getShipmentPackagePK(); 203 } 204 205 public ShipmentPackage getShipmentPackage(Session session, EntityPermission entityPermission) { 206 return ShipmentPackageFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentPackagePK()); 207 } 208 209 public ShipmentPackage getShipmentPackage(EntityPermission entityPermission) { 210 return getShipmentPackage(ThreadSession.currentSession(), entityPermission); 211 } 212 213 public ShipmentPackage getShipmentPackage(Session session) { 214 return getShipmentPackage(session, EntityPermission.READ_ONLY); 215 } 216 217 public ShipmentPackage getShipmentPackage() { 218 return getShipmentPackage(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 219 } 220 221 public ShipmentPackage getShipmentPackageForUpdate(Session session) { 222 return getShipmentPackage(session, EntityPermission.READ_WRITE); 223 } 224 225 public ShipmentPackage getShipmentPackageForUpdate() { 226 return getShipmentPackage(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 227 } 228 229 public void setShipmentPackagePK(ShipmentPackagePK shipmentPackagePK) 230 throws PersistenceNotNullException, PersistenceReadOnlyException { 231 checkReadWrite(); 232 _value.setShipmentPackagePK(shipmentPackagePK); 233 } 234 235 public void setShipmentPackage(ShipmentPackage entity) { 236 setShipmentPackagePK(entity == null? null: entity.getPrimaryKey()); 237 } 238 239 public boolean getShipmentPackagePKHasBeenModified() { 240 return _value.getShipmentPackagePKHasBeenModified(); 241 } 242 243 public Integer getShipmentPackageLineSequence() { 244 return _value.getShipmentPackageLineSequence(); 245 } 246 247 public void setShipmentPackageLineSequence(Integer shipmentPackageLineSequence) 248 throws PersistenceNotNullException, PersistenceReadOnlyException { 249 checkReadWrite(); 250 _value.setShipmentPackageLineSequence(shipmentPackageLineSequence); 251 } 252 253 public boolean getShipmentPackageLineSequenceHasBeenModified() { 254 return _value.getShipmentPackageLineSequenceHasBeenModified(); 255 } 256 257 public ShipmentLinePK getShipmentLinePK() { 258 return _value.getShipmentLinePK(); 259 } 260 261 public ShipmentLine getShipmentLine(Session session, EntityPermission entityPermission) { 262 ShipmentLinePK pk = getShipmentLinePK(); 263 ShipmentLine entity = pk == null? null: ShipmentLineFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 264 265 return entity; 266 } 267 268 public ShipmentLine getShipmentLine(EntityPermission entityPermission) { 269 return getShipmentLine(ThreadSession.currentSession(), entityPermission); 270 } 271 272 public ShipmentLine getShipmentLine(Session session) { 273 return getShipmentLine(session, EntityPermission.READ_ONLY); 274 } 275 276 public ShipmentLine getShipmentLine() { 277 return getShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 278 } 279 280 public ShipmentLine getShipmentLineForUpdate(Session session) { 281 return getShipmentLine(session, EntityPermission.READ_WRITE); 282 } 283 284 public ShipmentLine getShipmentLineForUpdate() { 285 return getShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 286 } 287 288 public void setShipmentLinePK(ShipmentLinePK shipmentLinePK) 289 throws PersistenceNotNullException, PersistenceReadOnlyException { 290 checkReadWrite(); 291 _value.setShipmentLinePK(shipmentLinePK); 292 } 293 294 public void setShipmentLine(ShipmentLine entity) { 295 setShipmentLinePK(entity == null? null: entity.getPrimaryKey()); 296 } 297 298 public boolean getShipmentLinePKHasBeenModified() { 299 return _value.getShipmentLinePKHasBeenModified(); 300 } 301 302 public ItemPK getItemPK() { 303 return _value.getItemPK(); 304 } 305 306 public Item getItem(Session session, EntityPermission entityPermission) { 307 return ItemFactory.getInstance().getEntityFromPK(session, entityPermission, getItemPK()); 308 } 309 310 public Item getItem(EntityPermission entityPermission) { 311 return getItem(ThreadSession.currentSession(), entityPermission); 312 } 313 314 public Item getItem(Session session) { 315 return getItem(session, EntityPermission.READ_ONLY); 316 } 317 318 public Item getItem() { 319 return getItem(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 320 } 321 322 public Item getItemForUpdate(Session session) { 323 return getItem(session, EntityPermission.READ_WRITE); 324 } 325 326 public Item getItemForUpdate() { 327 return getItem(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 328 } 329 330 public void setItemPK(ItemPK itemPK) 331 throws PersistenceNotNullException, PersistenceReadOnlyException { 332 checkReadWrite(); 333 _value.setItemPK(itemPK); 334 } 335 336 public void setItem(Item entity) { 337 setItemPK(entity == null? null: entity.getPrimaryKey()); 338 } 339 340 public boolean getItemPKHasBeenModified() { 341 return _value.getItemPKHasBeenModified(); 342 } 343 344 public InventoryConditionPK getInventoryConditionPK() { 345 return _value.getInventoryConditionPK(); 346 } 347 348 public InventoryCondition getInventoryCondition(Session session, EntityPermission entityPermission) { 349 return InventoryConditionFactory.getInstance().getEntityFromPK(session, entityPermission, getInventoryConditionPK()); 350 } 351 352 public InventoryCondition getInventoryCondition(EntityPermission entityPermission) { 353 return getInventoryCondition(ThreadSession.currentSession(), entityPermission); 354 } 355 356 public InventoryCondition getInventoryCondition(Session session) { 357 return getInventoryCondition(session, EntityPermission.READ_ONLY); 358 } 359 360 public InventoryCondition getInventoryCondition() { 361 return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 362 } 363 364 public InventoryCondition getInventoryConditionForUpdate(Session session) { 365 return getInventoryCondition(session, EntityPermission.READ_WRITE); 366 } 367 368 public InventoryCondition getInventoryConditionForUpdate() { 369 return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 370 } 371 372 public void setInventoryConditionPK(InventoryConditionPK inventoryConditionPK) 373 throws PersistenceNotNullException, PersistenceReadOnlyException { 374 checkReadWrite(); 375 _value.setInventoryConditionPK(inventoryConditionPK); 376 } 377 378 public void setInventoryCondition(InventoryCondition entity) { 379 setInventoryConditionPK(entity == null? null: entity.getPrimaryKey()); 380 } 381 382 public boolean getInventoryConditionPKHasBeenModified() { 383 return _value.getInventoryConditionPKHasBeenModified(); 384 } 385 386 public UnitOfMeasureTypePK getUnitOfMeasureTypePK() { 387 return _value.getUnitOfMeasureTypePK(); 388 } 389 390 public UnitOfMeasureType getUnitOfMeasureType(Session session, EntityPermission entityPermission) { 391 return UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getUnitOfMeasureTypePK()); 392 } 393 394 public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) { 395 return getUnitOfMeasureType(ThreadSession.currentSession(), entityPermission); 396 } 397 398 public UnitOfMeasureType getUnitOfMeasureType(Session session) { 399 return getUnitOfMeasureType(session, EntityPermission.READ_ONLY); 400 } 401 402 public UnitOfMeasureType getUnitOfMeasureType() { 403 return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 404 } 405 406 public UnitOfMeasureType getUnitOfMeasureTypeForUpdate(Session session) { 407 return getUnitOfMeasureType(session, EntityPermission.READ_WRITE); 408 } 409 410 public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() { 411 return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 412 } 413 414 public void setUnitOfMeasureTypePK(UnitOfMeasureTypePK unitOfMeasureTypePK) 415 throws PersistenceNotNullException, PersistenceReadOnlyException { 416 checkReadWrite(); 417 _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK); 418 } 419 420 public void setUnitOfMeasureType(UnitOfMeasureType entity) { 421 setUnitOfMeasureTypePK(entity == null? null: entity.getPrimaryKey()); 422 } 423 424 public boolean getUnitOfMeasureTypePKHasBeenModified() { 425 return _value.getUnitOfMeasureTypePKHasBeenModified(); 426 } 427 428 public Long getQuantity() { 429 return _value.getQuantity(); 430 } 431 432 public void setQuantity(Long quantity) 433 throws PersistenceNotNullException, PersistenceReadOnlyException { 434 checkReadWrite(); 435 _value.setQuantity(quantity); 436 } 437 438 public boolean getQuantityHasBeenModified() { 439 return _value.getQuantityHasBeenModified(); 440 } 441 442 public Long getFromTime() { 443 return _value.getFromTime(); 444 } 445 446 public void setFromTime(Long fromTime) 447 throws PersistenceNotNullException, PersistenceReadOnlyException { 448 checkReadWrite(); 449 _value.setFromTime(fromTime); 450 } 451 452 public boolean getFromTimeHasBeenModified() { 453 return _value.getFromTimeHasBeenModified(); 454 } 455 456 public Long getThruTime() { 457 return _value.getThruTime(); 458 } 459 460 public void setThruTime(Long thruTime) 461 throws PersistenceNotNullException, PersistenceReadOnlyException { 462 checkReadWrite(); 463 _value.setThruTime(thruTime); 464 } 465 466 public boolean getThruTimeHasBeenModified() { 467 return _value.getThruTimeHasBeenModified(); 468 } 469 470}