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 * InventoryTransactionLineDestination.java 021 */ 022 023package com.echothree.model.data.inventory.server.entity; 024 025import com.echothree.model.data.inventory.common.pk.InventoryTransactionLineDestinationPK; 026 027import com.echothree.model.data.inventory.common.pk.InventoryTransactionLinePK; 028import com.echothree.model.data.party.common.pk.PartyPK; 029import com.echothree.model.data.warehouse.common.pk.LocationPK; 030import com.echothree.model.data.inventory.common.pk.InventoryConditionPK; 031import com.echothree.model.data.uom.common.pk.UnitOfMeasureTypePK; 032 033import com.echothree.model.data.inventory.server.entity.InventoryTransactionLine; 034import com.echothree.model.data.party.server.entity.Party; 035import com.echothree.model.data.warehouse.server.entity.Location; 036import com.echothree.model.data.inventory.server.entity.InventoryCondition; 037import com.echothree.model.data.uom.server.entity.UnitOfMeasureType; 038 039import com.echothree.model.data.inventory.server.factory.InventoryTransactionLineFactory; 040import com.echothree.model.data.party.server.factory.PartyFactory; 041import com.echothree.model.data.warehouse.server.factory.LocationFactory; 042import com.echothree.model.data.inventory.server.factory.InventoryConditionFactory; 043import com.echothree.model.data.uom.server.factory.UnitOfMeasureTypeFactory; 044 045import com.echothree.model.data.inventory.common.pk.InventoryTransactionLineDestinationPK; 046 047import com.echothree.model.data.inventory.server.value.InventoryTransactionLineDestinationValue; 048 049import com.echothree.model.data.inventory.server.factory.InventoryTransactionLineDestinationFactory; 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 067import javax.annotation.Nonnull; 068import javax.annotation.Nullable; 069 070public class InventoryTransactionLineDestination 071 extends BaseEntity 072 implements Serializable { 073 074 private InventoryTransactionLineDestinationPK _pk; 075 private InventoryTransactionLineDestinationValue _value; 076 077 /** Creates a new instance of InventoryTransactionLineDestination */ 078 public InventoryTransactionLineDestination() 079 throws PersistenceException { 080 super(); 081 } 082 083 /** Creates a new instance of InventoryTransactionLineDestination */ 084 public InventoryTransactionLineDestination(InventoryTransactionLineDestinationValue value, EntityPermission entityPermission) { 085 super(entityPermission); 086 087 _value = value; 088 _pk = value.getPrimaryKey(); 089 } 090 091 @Override 092 @Nonnull 093 public InventoryTransactionLineDestinationFactory getBaseFactoryInstance() { 094 return InventoryTransactionLineDestinationFactory.getInstance(); 095 } 096 097 @Override 098 public boolean hasBeenModified() { 099 return _value.hasBeenModified(); 100 } 101 102 @Override 103 public int hashCode() { 104 return _pk.hashCode(); 105 } 106 107 @Override 108 @Nonnull 109 public String toString() { 110 return _pk.toString(); 111 } 112 113 @Override 114 public boolean equals(Object other) { 115 if(this == other) 116 return true; 117 118 if(other instanceof InventoryTransactionLineDestination that) { 119 InventoryTransactionLineDestinationValue thatValue = that.getInventoryTransactionLineDestinationValue(); 120 return _value.equals(thatValue); 121 } else { 122 return false; 123 } 124 } 125 126 @Override 127 public void store() 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().store(this); 130 } 131 132 @Override 133 public void remove() 134 throws PersistenceDatabaseException { 135 getBaseFactoryInstance().remove(this); 136 } 137 138 @Nonnull 139 public InventoryTransactionLineDestinationValue getInventoryTransactionLineDestinationValue() { 140 return _value; 141 } 142 143 public void setInventoryTransactionLineDestinationValue(@Nonnull InventoryTransactionLineDestinationValue value) 144 throws PersistenceReadOnlyException { 145 checkReadWrite(); 146 _value = value; 147 } 148 149 @Override 150 @Nonnull 151 public InventoryTransactionLineDestinationPK getPrimaryKey() { 152 return _pk; 153 } 154 155 @Nonnull 156 public InventoryTransactionLinePK getInventoryTransactionLinePK() { 157 return _value.getInventoryTransactionLinePK(); 158 } 159 160 @Nonnull 161 public InventoryTransactionLine getInventoryTransactionLine(EntityPermission entityPermission) { 162 return InventoryTransactionLineFactory.getInstance().getEntityFromPK(entityPermission, getInventoryTransactionLinePK()); 163 } 164 165 @Nonnull 166 public InventoryTransactionLine getInventoryTransactionLine() { 167 return getInventoryTransactionLine(EntityPermission.READ_ONLY); 168 } 169 170 @Nonnull 171 public InventoryTransactionLine getInventoryTransactionLineForUpdate() { 172 return getInventoryTransactionLine(EntityPermission.READ_WRITE); 173 } 174 175 public void setInventoryTransactionLinePK(@Nonnull InventoryTransactionLinePK inventoryTransactionLinePK) 176 throws PersistenceNotNullException, PersistenceReadOnlyException { 177 checkReadWrite(); 178 _value.setInventoryTransactionLinePK(inventoryTransactionLinePK); 179 } 180 181 public void setInventoryTransactionLine(@Nonnull InventoryTransactionLine entity) { 182 setInventoryTransactionLinePK(entity == null ? null : entity.getPrimaryKey()); 183 } 184 185 public boolean getInventoryTransactionLinePKHasBeenModified() { 186 return _value.getInventoryTransactionLinePKHasBeenModified(); 187 } 188 189 @Nullable 190 public PartyPK getDestinationOwnerPartyPK() { 191 return _value.getDestinationOwnerPartyPK(); 192 } 193 194 @Nullable 195 public Party getDestinationOwnerParty(EntityPermission entityPermission) { 196 PartyPK pk = getDestinationOwnerPartyPK(); 197 Party entity = pk == null? null: PartyFactory.getInstance().getEntityFromPK(entityPermission, pk); 198 199 return entity; 200 } 201 202 @Nullable 203 public Party getDestinationOwnerParty() { 204 return getDestinationOwnerParty(EntityPermission.READ_ONLY); 205 } 206 207 @Nullable 208 public Party getDestinationOwnerPartyForUpdate() { 209 return getDestinationOwnerParty(EntityPermission.READ_WRITE); 210 } 211 212 public void setDestinationOwnerPartyPK(@Nullable PartyPK destinationOwnerPartyPK) 213 throws PersistenceNotNullException, PersistenceReadOnlyException { 214 checkReadWrite(); 215 _value.setDestinationOwnerPartyPK(destinationOwnerPartyPK); 216 } 217 218 public void setDestinationOwnerParty(@Nullable Party entity) { 219 setDestinationOwnerPartyPK(entity == null ? null : entity.getPrimaryKey()); 220 } 221 222 public boolean getDestinationOwnerPartyPKHasBeenModified() { 223 return _value.getDestinationOwnerPartyPKHasBeenModified(); 224 } 225 226 @Nullable 227 public LocationPK getDestinationLocationPK() { 228 return _value.getDestinationLocationPK(); 229 } 230 231 @Nullable 232 public Location getDestinationLocation(EntityPermission entityPermission) { 233 LocationPK pk = getDestinationLocationPK(); 234 Location entity = pk == null? null: LocationFactory.getInstance().getEntityFromPK(entityPermission, pk); 235 236 return entity; 237 } 238 239 @Nullable 240 public Location getDestinationLocation() { 241 return getDestinationLocation(EntityPermission.READ_ONLY); 242 } 243 244 @Nullable 245 public Location getDestinationLocationForUpdate() { 246 return getDestinationLocation(EntityPermission.READ_WRITE); 247 } 248 249 public void setDestinationLocationPK(@Nullable LocationPK destinationLocationPK) 250 throws PersistenceNotNullException, PersistenceReadOnlyException { 251 checkReadWrite(); 252 _value.setDestinationLocationPK(destinationLocationPK); 253 } 254 255 public void setDestinationLocation(@Nullable Location entity) { 256 setDestinationLocationPK(entity == null ? null : entity.getPrimaryKey()); 257 } 258 259 public boolean getDestinationLocationPKHasBeenModified() { 260 return _value.getDestinationLocationPKHasBeenModified(); 261 } 262 263 @Nullable 264 public InventoryConditionPK getDestinationInventoryConditionPK() { 265 return _value.getDestinationInventoryConditionPK(); 266 } 267 268 @Nullable 269 public InventoryCondition getDestinationInventoryCondition(EntityPermission entityPermission) { 270 InventoryConditionPK pk = getDestinationInventoryConditionPK(); 271 InventoryCondition entity = pk == null? null: InventoryConditionFactory.getInstance().getEntityFromPK(entityPermission, pk); 272 273 return entity; 274 } 275 276 @Nullable 277 public InventoryCondition getDestinationInventoryCondition() { 278 return getDestinationInventoryCondition(EntityPermission.READ_ONLY); 279 } 280 281 @Nullable 282 public InventoryCondition getDestinationInventoryConditionForUpdate() { 283 return getDestinationInventoryCondition(EntityPermission.READ_WRITE); 284 } 285 286 public void setDestinationInventoryConditionPK(@Nullable InventoryConditionPK destinationInventoryConditionPK) 287 throws PersistenceNotNullException, PersistenceReadOnlyException { 288 checkReadWrite(); 289 _value.setDestinationInventoryConditionPK(destinationInventoryConditionPK); 290 } 291 292 public void setDestinationInventoryCondition(@Nullable InventoryCondition entity) { 293 setDestinationInventoryConditionPK(entity == null ? null : entity.getPrimaryKey()); 294 } 295 296 public boolean getDestinationInventoryConditionPKHasBeenModified() { 297 return _value.getDestinationInventoryConditionPKHasBeenModified(); 298 } 299 300 @Nullable 301 public UnitOfMeasureTypePK getDestinationUnitOfMeasureTypePK() { 302 return _value.getDestinationUnitOfMeasureTypePK(); 303 } 304 305 @Nullable 306 public UnitOfMeasureType getDestinationUnitOfMeasureType(EntityPermission entityPermission) { 307 UnitOfMeasureTypePK pk = getDestinationUnitOfMeasureTypePK(); 308 UnitOfMeasureType entity = pk == null? null: UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(entityPermission, pk); 309 310 return entity; 311 } 312 313 @Nullable 314 public UnitOfMeasureType getDestinationUnitOfMeasureType() { 315 return getDestinationUnitOfMeasureType(EntityPermission.READ_ONLY); 316 } 317 318 @Nullable 319 public UnitOfMeasureType getDestinationUnitOfMeasureTypeForUpdate() { 320 return getDestinationUnitOfMeasureType(EntityPermission.READ_WRITE); 321 } 322 323 public void setDestinationUnitOfMeasureTypePK(@Nullable UnitOfMeasureTypePK destinationUnitOfMeasureTypePK) 324 throws PersistenceNotNullException, PersistenceReadOnlyException { 325 checkReadWrite(); 326 _value.setDestinationUnitOfMeasureTypePK(destinationUnitOfMeasureTypePK); 327 } 328 329 public void setDestinationUnitOfMeasureType(@Nullable UnitOfMeasureType entity) { 330 setDestinationUnitOfMeasureTypePK(entity == null ? null : entity.getPrimaryKey()); 331 } 332 333 public boolean getDestinationUnitOfMeasureTypePKHasBeenModified() { 334 return _value.getDestinationUnitOfMeasureTypePKHasBeenModified(); 335 } 336 337 @Nonnull 338 public Long getFromTime() { 339 return _value.getFromTime(); 340 } 341 342 public void setFromTime(@Nonnull Long fromTime) 343 throws PersistenceNotNullException, PersistenceReadOnlyException { 344 checkReadWrite(); 345 _value.setFromTime(fromTime); 346 } 347 348 public boolean getFromTimeHasBeenModified() { 349 return _value.getFromTimeHasBeenModified(); 350 } 351 352 @Nonnull 353 public Long getThruTime() { 354 return _value.getThruTime(); 355 } 356 357 public void setThruTime(@Nonnull Long thruTime) 358 throws PersistenceNotNullException, PersistenceReadOnlyException { 359 checkReadWrite(); 360 _value.setThruTime(thruTime); 361 } 362 363 public boolean getThruTimeHasBeenModified() { 364 return _value.getThruTimeHasBeenModified(); 365 } 366 367}