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