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 * LocationDetail.java 021 */ 022 023package com.echothree.model.data.warehouse.server.entity; 024 025import com.echothree.model.data.warehouse.common.pk.LocationDetailPK; 026 027import com.echothree.model.data.warehouse.common.pk.LocationPK; 028import com.echothree.model.data.party.common.pk.PartyPK; 029import com.echothree.model.data.warehouse.common.pk.LocationTypePK; 030import com.echothree.model.data.warehouse.common.pk.LocationUseTypePK; 031import com.echothree.model.data.inventory.common.pk.InventoryLocationGroupPK; 032 033import com.echothree.model.data.warehouse.server.entity.Location; 034import com.echothree.model.data.party.server.entity.Party; 035import com.echothree.model.data.warehouse.server.entity.LocationType; 036import com.echothree.model.data.warehouse.server.entity.LocationUseType; 037import com.echothree.model.data.inventory.server.entity.InventoryLocationGroup; 038 039import com.echothree.model.data.warehouse.server.factory.LocationFactory; 040import com.echothree.model.data.party.server.factory.PartyFactory; 041import com.echothree.model.data.warehouse.server.factory.LocationTypeFactory; 042import com.echothree.model.data.warehouse.server.factory.LocationUseTypeFactory; 043import com.echothree.model.data.inventory.server.factory.InventoryLocationGroupFactory; 044 045import com.echothree.model.data.warehouse.common.pk.LocationDetailPK; 046 047import com.echothree.model.data.warehouse.server.value.LocationDetailValue; 048 049import com.echothree.model.data.warehouse.server.factory.LocationDetailFactory; 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 LocationDetail 071 extends BaseEntity 072 implements Serializable { 073 074 private LocationDetailPK _pk; 075 private LocationDetailValue _value; 076 077 /** Creates a new instance of LocationDetail */ 078 public LocationDetail() 079 throws PersistenceException { 080 super(); 081 } 082 083 /** Creates a new instance of LocationDetail */ 084 public LocationDetail(LocationDetailValue value, EntityPermission entityPermission) { 085 super(entityPermission); 086 087 _value = value; 088 _pk = value.getPrimaryKey(); 089 } 090 091 @Override 092 @Nonnull 093 public LocationDetailFactory getBaseFactoryInstance() { 094 return LocationDetailFactory.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 LocationDetail that) { 119 LocationDetailValue thatValue = that.getLocationDetailValue(); 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 LocationDetailValue getLocationDetailValue() { 140 return _value; 141 } 142 143 public void setLocationDetailValue(@Nonnull LocationDetailValue value) 144 throws PersistenceReadOnlyException { 145 checkReadWrite(); 146 _value = value; 147 } 148 149 @Override 150 @Nonnull 151 public LocationDetailPK getPrimaryKey() { 152 return _pk; 153 } 154 155 @Nonnull 156 public LocationPK getLocationPK() { 157 return _value.getLocationPK(); 158 } 159 160 @Nonnull 161 public Location getLocation(EntityPermission entityPermission) { 162 return LocationFactory.getInstance().getEntityFromPK(entityPermission, getLocationPK()); 163 } 164 165 @Nonnull 166 public Location getLocation() { 167 return getLocation(EntityPermission.READ_ONLY); 168 } 169 170 @Nonnull 171 public Location getLocationForUpdate() { 172 return getLocation(EntityPermission.READ_WRITE); 173 } 174 175 public void setLocationPK(@Nonnull LocationPK locationPK) 176 throws PersistenceNotNullException, PersistenceReadOnlyException { 177 checkReadWrite(); 178 _value.setLocationPK(locationPK); 179 } 180 181 public void setLocation(@Nonnull Location entity) { 182 setLocationPK(entity == null ? null : entity.getPrimaryKey()); 183 } 184 185 public boolean getLocationPKHasBeenModified() { 186 return _value.getLocationPKHasBeenModified(); 187 } 188 189 @Nonnull 190 public PartyPK getWarehousePartyPK() { 191 return _value.getWarehousePartyPK(); 192 } 193 194 @Nonnull 195 public Party getWarehouseParty(EntityPermission entityPermission) { 196 return PartyFactory.getInstance().getEntityFromPK(entityPermission, getWarehousePartyPK()); 197 } 198 199 @Nonnull 200 public Party getWarehouseParty() { 201 return getWarehouseParty(EntityPermission.READ_ONLY); 202 } 203 204 @Nonnull 205 public Party getWarehousePartyForUpdate() { 206 return getWarehouseParty(EntityPermission.READ_WRITE); 207 } 208 209 public void setWarehousePartyPK(@Nonnull PartyPK warehousePartyPK) 210 throws PersistenceNotNullException, PersistenceReadOnlyException { 211 checkReadWrite(); 212 _value.setWarehousePartyPK(warehousePartyPK); 213 } 214 215 public void setWarehouseParty(@Nonnull Party entity) { 216 setWarehousePartyPK(entity == null ? null : entity.getPrimaryKey()); 217 } 218 219 public boolean getWarehousePartyPKHasBeenModified() { 220 return _value.getWarehousePartyPKHasBeenModified(); 221 } 222 223 @Nonnull 224 public String getLocationName() { 225 return _value.getLocationName(); 226 } 227 228 public void setLocationName(@Nonnull String locationName) 229 throws PersistenceNotNullException, PersistenceReadOnlyException { 230 checkReadWrite(); 231 _value.setLocationName(locationName); 232 } 233 234 public boolean getLocationNameHasBeenModified() { 235 return _value.getLocationNameHasBeenModified(); 236 } 237 238 @Nonnull 239 public LocationTypePK getLocationTypePK() { 240 return _value.getLocationTypePK(); 241 } 242 243 @Nonnull 244 public LocationType getLocationType(EntityPermission entityPermission) { 245 return LocationTypeFactory.getInstance().getEntityFromPK(entityPermission, getLocationTypePK()); 246 } 247 248 @Nonnull 249 public LocationType getLocationType() { 250 return getLocationType(EntityPermission.READ_ONLY); 251 } 252 253 @Nonnull 254 public LocationType getLocationTypeForUpdate() { 255 return getLocationType(EntityPermission.READ_WRITE); 256 } 257 258 public void setLocationTypePK(@Nonnull LocationTypePK locationTypePK) 259 throws PersistenceNotNullException, PersistenceReadOnlyException { 260 checkReadWrite(); 261 _value.setLocationTypePK(locationTypePK); 262 } 263 264 public void setLocationType(@Nonnull LocationType entity) { 265 setLocationTypePK(entity == null ? null : entity.getPrimaryKey()); 266 } 267 268 public boolean getLocationTypePKHasBeenModified() { 269 return _value.getLocationTypePKHasBeenModified(); 270 } 271 272 @Nonnull 273 public LocationUseTypePK getLocationUseTypePK() { 274 return _value.getLocationUseTypePK(); 275 } 276 277 @Nonnull 278 public LocationUseType getLocationUseType(EntityPermission entityPermission) { 279 return LocationUseTypeFactory.getInstance().getEntityFromPK(entityPermission, getLocationUseTypePK()); 280 } 281 282 @Nonnull 283 public LocationUseType getLocationUseType() { 284 return getLocationUseType(EntityPermission.READ_ONLY); 285 } 286 287 @Nonnull 288 public LocationUseType getLocationUseTypeForUpdate() { 289 return getLocationUseType(EntityPermission.READ_WRITE); 290 } 291 292 public void setLocationUseTypePK(@Nonnull LocationUseTypePK locationUseTypePK) 293 throws PersistenceNotNullException, PersistenceReadOnlyException { 294 checkReadWrite(); 295 _value.setLocationUseTypePK(locationUseTypePK); 296 } 297 298 public void setLocationUseType(@Nonnull LocationUseType entity) { 299 setLocationUseTypePK(entity == null ? null : entity.getPrimaryKey()); 300 } 301 302 public boolean getLocationUseTypePKHasBeenModified() { 303 return _value.getLocationUseTypePKHasBeenModified(); 304 } 305 306 @Nonnull 307 public Integer getVelocity() { 308 return _value.getVelocity(); 309 } 310 311 public void setVelocity(@Nonnull Integer velocity) 312 throws PersistenceNotNullException, PersistenceReadOnlyException { 313 checkReadWrite(); 314 _value.setVelocity(velocity); 315 } 316 317 public boolean getVelocityHasBeenModified() { 318 return _value.getVelocityHasBeenModified(); 319 } 320 321 @Nonnull 322 public InventoryLocationGroupPK getInventoryLocationGroupPK() { 323 return _value.getInventoryLocationGroupPK(); 324 } 325 326 @Nonnull 327 public InventoryLocationGroup getInventoryLocationGroup(EntityPermission entityPermission) { 328 return InventoryLocationGroupFactory.getInstance().getEntityFromPK(entityPermission, getInventoryLocationGroupPK()); 329 } 330 331 @Nonnull 332 public InventoryLocationGroup getInventoryLocationGroup() { 333 return getInventoryLocationGroup(EntityPermission.READ_ONLY); 334 } 335 336 @Nonnull 337 public InventoryLocationGroup getInventoryLocationGroupForUpdate() { 338 return getInventoryLocationGroup(EntityPermission.READ_WRITE); 339 } 340 341 public void setInventoryLocationGroupPK(@Nonnull InventoryLocationGroupPK inventoryLocationGroupPK) 342 throws PersistenceNotNullException, PersistenceReadOnlyException { 343 checkReadWrite(); 344 _value.setInventoryLocationGroupPK(inventoryLocationGroupPK); 345 } 346 347 public void setInventoryLocationGroup(@Nonnull InventoryLocationGroup entity) { 348 setInventoryLocationGroupPK(entity == null ? null : entity.getPrimaryKey()); 349 } 350 351 public boolean getInventoryLocationGroupPKHasBeenModified() { 352 return _value.getInventoryLocationGroupPKHasBeenModified(); 353 } 354 355 @Nonnull 356 public Long getFromTime() { 357 return _value.getFromTime(); 358 } 359 360 public void setFromTime(@Nonnull Long fromTime) 361 throws PersistenceNotNullException, PersistenceReadOnlyException { 362 checkReadWrite(); 363 _value.setFromTime(fromTime); 364 } 365 366 public boolean getFromTimeHasBeenModified() { 367 return _value.getFromTimeHasBeenModified(); 368 } 369 370 @Nonnull 371 public Long getThruTime() { 372 return _value.getThruTime(); 373 } 374 375 public void setThruTime(@Nonnull Long thruTime) 376 throws PersistenceNotNullException, PersistenceReadOnlyException { 377 checkReadWrite(); 378 _value.setThruTime(thruTime); 379 } 380 381 public boolean getThruTimeHasBeenModified() { 382 return _value.getThruTimeHasBeenModified(); 383 } 384 385}