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 * 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 067public class LocationDetail 068 extends BaseEntity 069 implements Serializable { 070 071 private LocationDetailPK _pk; 072 private LocationDetailValue _value; 073 074 /** Creates a new instance of LocationDetail */ 075 public LocationDetail() 076 throws PersistenceException { 077 super(); 078 } 079 080 /** Creates a new instance of LocationDetail */ 081 public LocationDetail(LocationDetailValue value, EntityPermission entityPermission) { 082 super(entityPermission); 083 084 _value = value; 085 _pk = value.getPrimaryKey(); 086 } 087 088 @Override 089 public LocationDetailFactory getBaseFactoryInstance() { 090 return LocationDetailFactory.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 LocationDetail that) { 114 LocationDetailValue thatValue = that.getLocationDetailValue(); 115 return _value.equals(thatValue); 116 } else { 117 return false; 118 } 119 } 120 121 @Override 122 public void store(Session session) 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().store(session, this); 125 } 126 127 @Override 128 public void remove(Session session) 129 throws PersistenceDatabaseException { 130 getBaseFactoryInstance().remove(session, this); 131 } 132 133 @Override 134 public void remove() 135 throws PersistenceDatabaseException { 136 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 137 } 138 139 public LocationDetailValue getLocationDetailValue() { 140 return _value; 141 } 142 143 public void setLocationDetailValue(LocationDetailValue value) 144 throws PersistenceReadOnlyException { 145 checkReadWrite(); 146 _value = value; 147 } 148 149 @Override 150 public LocationDetailPK getPrimaryKey() { 151 return _pk; 152 } 153 154 public LocationPK getLocationPK() { 155 return _value.getLocationPK(); 156 } 157 158 public Location getLocation(Session session, EntityPermission entityPermission) { 159 return LocationFactory.getInstance().getEntityFromPK(session, entityPermission, getLocationPK()); 160 } 161 162 public Location getLocation(EntityPermission entityPermission) { 163 return getLocation(ThreadSession.currentSession(), entityPermission); 164 } 165 166 public Location getLocation(Session session) { 167 return getLocation(session, EntityPermission.READ_ONLY); 168 } 169 170 public Location getLocation() { 171 return getLocation(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 172 } 173 174 public Location getLocationForUpdate(Session session) { 175 return getLocation(session, EntityPermission.READ_WRITE); 176 } 177 178 public Location getLocationForUpdate() { 179 return getLocation(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 180 } 181 182 public void setLocationPK(LocationPK locationPK) 183 throws PersistenceNotNullException, PersistenceReadOnlyException { 184 checkReadWrite(); 185 _value.setLocationPK(locationPK); 186 } 187 188 public void setLocation(Location entity) { 189 setLocationPK(entity == null? null: entity.getPrimaryKey()); 190 } 191 192 public boolean getLocationPKHasBeenModified() { 193 return _value.getLocationPKHasBeenModified(); 194 } 195 196 public PartyPK getWarehousePartyPK() { 197 return _value.getWarehousePartyPK(); 198 } 199 200 public Party getWarehouseParty(Session session, EntityPermission entityPermission) { 201 return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getWarehousePartyPK()); 202 } 203 204 public Party getWarehouseParty(EntityPermission entityPermission) { 205 return getWarehouseParty(ThreadSession.currentSession(), entityPermission); 206 } 207 208 public Party getWarehouseParty(Session session) { 209 return getWarehouseParty(session, EntityPermission.READ_ONLY); 210 } 211 212 public Party getWarehouseParty() { 213 return getWarehouseParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 214 } 215 216 public Party getWarehousePartyForUpdate(Session session) { 217 return getWarehouseParty(session, EntityPermission.READ_WRITE); 218 } 219 220 public Party getWarehousePartyForUpdate() { 221 return getWarehouseParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 222 } 223 224 public void setWarehousePartyPK(PartyPK warehousePartyPK) 225 throws PersistenceNotNullException, PersistenceReadOnlyException { 226 checkReadWrite(); 227 _value.setWarehousePartyPK(warehousePartyPK); 228 } 229 230 public void setWarehouseParty(Party entity) { 231 setWarehousePartyPK(entity == null? null: entity.getPrimaryKey()); 232 } 233 234 public boolean getWarehousePartyPKHasBeenModified() { 235 return _value.getWarehousePartyPKHasBeenModified(); 236 } 237 238 public String getLocationName() { 239 return _value.getLocationName(); 240 } 241 242 public void setLocationName(String locationName) 243 throws PersistenceNotNullException, PersistenceReadOnlyException { 244 checkReadWrite(); 245 _value.setLocationName(locationName); 246 } 247 248 public boolean getLocationNameHasBeenModified() { 249 return _value.getLocationNameHasBeenModified(); 250 } 251 252 public LocationTypePK getLocationTypePK() { 253 return _value.getLocationTypePK(); 254 } 255 256 public LocationType getLocationType(Session session, EntityPermission entityPermission) { 257 return LocationTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getLocationTypePK()); 258 } 259 260 public LocationType getLocationType(EntityPermission entityPermission) { 261 return getLocationType(ThreadSession.currentSession(), entityPermission); 262 } 263 264 public LocationType getLocationType(Session session) { 265 return getLocationType(session, EntityPermission.READ_ONLY); 266 } 267 268 public LocationType getLocationType() { 269 return getLocationType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 270 } 271 272 public LocationType getLocationTypeForUpdate(Session session) { 273 return getLocationType(session, EntityPermission.READ_WRITE); 274 } 275 276 public LocationType getLocationTypeForUpdate() { 277 return getLocationType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 278 } 279 280 public void setLocationTypePK(LocationTypePK locationTypePK) 281 throws PersistenceNotNullException, PersistenceReadOnlyException { 282 checkReadWrite(); 283 _value.setLocationTypePK(locationTypePK); 284 } 285 286 public void setLocationType(LocationType entity) { 287 setLocationTypePK(entity == null? null: entity.getPrimaryKey()); 288 } 289 290 public boolean getLocationTypePKHasBeenModified() { 291 return _value.getLocationTypePKHasBeenModified(); 292 } 293 294 public LocationUseTypePK getLocationUseTypePK() { 295 return _value.getLocationUseTypePK(); 296 } 297 298 public LocationUseType getLocationUseType(Session session, EntityPermission entityPermission) { 299 return LocationUseTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getLocationUseTypePK()); 300 } 301 302 public LocationUseType getLocationUseType(EntityPermission entityPermission) { 303 return getLocationUseType(ThreadSession.currentSession(), entityPermission); 304 } 305 306 public LocationUseType getLocationUseType(Session session) { 307 return getLocationUseType(session, EntityPermission.READ_ONLY); 308 } 309 310 public LocationUseType getLocationUseType() { 311 return getLocationUseType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 312 } 313 314 public LocationUseType getLocationUseTypeForUpdate(Session session) { 315 return getLocationUseType(session, EntityPermission.READ_WRITE); 316 } 317 318 public LocationUseType getLocationUseTypeForUpdate() { 319 return getLocationUseType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 320 } 321 322 public void setLocationUseTypePK(LocationUseTypePK locationUseTypePK) 323 throws PersistenceNotNullException, PersistenceReadOnlyException { 324 checkReadWrite(); 325 _value.setLocationUseTypePK(locationUseTypePK); 326 } 327 328 public void setLocationUseType(LocationUseType entity) { 329 setLocationUseTypePK(entity == null? null: entity.getPrimaryKey()); 330 } 331 332 public boolean getLocationUseTypePKHasBeenModified() { 333 return _value.getLocationUseTypePKHasBeenModified(); 334 } 335 336 public Integer getVelocity() { 337 return _value.getVelocity(); 338 } 339 340 public void setVelocity(Integer velocity) 341 throws PersistenceNotNullException, PersistenceReadOnlyException { 342 checkReadWrite(); 343 _value.setVelocity(velocity); 344 } 345 346 public boolean getVelocityHasBeenModified() { 347 return _value.getVelocityHasBeenModified(); 348 } 349 350 public InventoryLocationGroupPK getInventoryLocationGroupPK() { 351 return _value.getInventoryLocationGroupPK(); 352 } 353 354 public InventoryLocationGroup getInventoryLocationGroup(Session session, EntityPermission entityPermission) { 355 return InventoryLocationGroupFactory.getInstance().getEntityFromPK(session, entityPermission, getInventoryLocationGroupPK()); 356 } 357 358 public InventoryLocationGroup getInventoryLocationGroup(EntityPermission entityPermission) { 359 return getInventoryLocationGroup(ThreadSession.currentSession(), entityPermission); 360 } 361 362 public InventoryLocationGroup getInventoryLocationGroup(Session session) { 363 return getInventoryLocationGroup(session, EntityPermission.READ_ONLY); 364 } 365 366 public InventoryLocationGroup getInventoryLocationGroup() { 367 return getInventoryLocationGroup(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 368 } 369 370 public InventoryLocationGroup getInventoryLocationGroupForUpdate(Session session) { 371 return getInventoryLocationGroup(session, EntityPermission.READ_WRITE); 372 } 373 374 public InventoryLocationGroup getInventoryLocationGroupForUpdate() { 375 return getInventoryLocationGroup(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 376 } 377 378 public void setInventoryLocationGroupPK(InventoryLocationGroupPK inventoryLocationGroupPK) 379 throws PersistenceNotNullException, PersistenceReadOnlyException { 380 checkReadWrite(); 381 _value.setInventoryLocationGroupPK(inventoryLocationGroupPK); 382 } 383 384 public void setInventoryLocationGroup(InventoryLocationGroup entity) { 385 setInventoryLocationGroupPK(entity == null? null: entity.getPrimaryKey()); 386 } 387 388 public boolean getInventoryLocationGroupPKHasBeenModified() { 389 return _value.getInventoryLocationGroupPKHasBeenModified(); 390 } 391 392 public Long getFromTime() { 393 return _value.getFromTime(); 394 } 395 396 public void setFromTime(Long fromTime) 397 throws PersistenceNotNullException, PersistenceReadOnlyException { 398 checkReadWrite(); 399 _value.setFromTime(fromTime); 400 } 401 402 public boolean getFromTimeHasBeenModified() { 403 return _value.getFromTimeHasBeenModified(); 404 } 405 406 public Long getThruTime() { 407 return _value.getThruTime(); 408 } 409 410 public void setThruTime(Long thruTime) 411 throws PersistenceNotNullException, PersistenceReadOnlyException { 412 checkReadWrite(); 413 _value.setThruTime(thruTime); 414 } 415 416 public boolean getThruTimeHasBeenModified() { 417 return _value.getThruTimeHasBeenModified(); 418 } 419 420}