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
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()
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().store(this);
125    }
126    
127    @Override
128    public void remove()
129            throws PersistenceDatabaseException {
130        getBaseFactoryInstance().remove(this);
131    }
132    
133    public LocationDetailValue getLocationDetailValue() {
134        return _value;
135    }
136    
137    public void setLocationDetailValue(LocationDetailValue value)
138            throws PersistenceReadOnlyException {
139        checkReadWrite();
140        _value = value;
141    }
142    
143    @Override
144    public LocationDetailPK getPrimaryKey() {
145        return _pk;
146    }
147    
148    public LocationPK getLocationPK() {
149        return _value.getLocationPK();
150    }
151    
152    public Location getLocation(EntityPermission entityPermission) {
153        return LocationFactory.getInstance().getEntityFromPK(entityPermission, getLocationPK());
154    }
155    
156    public Location getLocation() {
157        return getLocation(EntityPermission.READ_ONLY);
158    }
159    
160    public Location getLocationForUpdate() {
161        return getLocation(EntityPermission.READ_WRITE);
162    }
163    
164    public void setLocationPK(LocationPK locationPK)
165            throws PersistenceNotNullException, PersistenceReadOnlyException {
166        checkReadWrite();
167        _value.setLocationPK(locationPK);
168    }
169    
170    public void setLocation(Location entity) {
171        setLocationPK(entity == null? null: entity.getPrimaryKey());
172    }
173    
174    public boolean getLocationPKHasBeenModified() {
175        return _value.getLocationPKHasBeenModified();
176    }
177    
178    public PartyPK getWarehousePartyPK() {
179        return _value.getWarehousePartyPK();
180    }
181    
182    public Party getWarehouseParty(EntityPermission entityPermission) {
183        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getWarehousePartyPK());
184    }
185    
186    public Party getWarehouseParty() {
187        return getWarehouseParty(EntityPermission.READ_ONLY);
188    }
189    
190    public Party getWarehousePartyForUpdate() {
191        return getWarehouseParty(EntityPermission.READ_WRITE);
192    }
193    
194    public void setWarehousePartyPK(PartyPK warehousePartyPK)
195            throws PersistenceNotNullException, PersistenceReadOnlyException {
196        checkReadWrite();
197        _value.setWarehousePartyPK(warehousePartyPK);
198    }
199    
200    public void setWarehouseParty(Party entity) {
201        setWarehousePartyPK(entity == null? null: entity.getPrimaryKey());
202    }
203    
204    public boolean getWarehousePartyPKHasBeenModified() {
205        return _value.getWarehousePartyPKHasBeenModified();
206    }
207    
208    public String getLocationName() {
209        return _value.getLocationName();
210    }
211    
212    public void setLocationName(String locationName)
213            throws PersistenceNotNullException, PersistenceReadOnlyException {
214        checkReadWrite();
215        _value.setLocationName(locationName);
216    }
217    
218    public boolean getLocationNameHasBeenModified() {
219        return _value.getLocationNameHasBeenModified();
220    }
221    
222    public LocationTypePK getLocationTypePK() {
223        return _value.getLocationTypePK();
224    }
225    
226    public LocationType getLocationType(EntityPermission entityPermission) {
227        return LocationTypeFactory.getInstance().getEntityFromPK(entityPermission, getLocationTypePK());
228    }
229    
230    public LocationType getLocationType() {
231        return getLocationType(EntityPermission.READ_ONLY);
232    }
233    
234    public LocationType getLocationTypeForUpdate() {
235        return getLocationType(EntityPermission.READ_WRITE);
236    }
237    
238    public void setLocationTypePK(LocationTypePK locationTypePK)
239            throws PersistenceNotNullException, PersistenceReadOnlyException {
240        checkReadWrite();
241        _value.setLocationTypePK(locationTypePK);
242    }
243    
244    public void setLocationType(LocationType entity) {
245        setLocationTypePK(entity == null? null: entity.getPrimaryKey());
246    }
247    
248    public boolean getLocationTypePKHasBeenModified() {
249        return _value.getLocationTypePKHasBeenModified();
250    }
251    
252    public LocationUseTypePK getLocationUseTypePK() {
253        return _value.getLocationUseTypePK();
254    }
255    
256    public LocationUseType getLocationUseType(EntityPermission entityPermission) {
257        return LocationUseTypeFactory.getInstance().getEntityFromPK(entityPermission, getLocationUseTypePK());
258    }
259    
260    public LocationUseType getLocationUseType() {
261        return getLocationUseType(EntityPermission.READ_ONLY);
262    }
263    
264    public LocationUseType getLocationUseTypeForUpdate() {
265        return getLocationUseType(EntityPermission.READ_WRITE);
266    }
267    
268    public void setLocationUseTypePK(LocationUseTypePK locationUseTypePK)
269            throws PersistenceNotNullException, PersistenceReadOnlyException {
270        checkReadWrite();
271        _value.setLocationUseTypePK(locationUseTypePK);
272    }
273    
274    public void setLocationUseType(LocationUseType entity) {
275        setLocationUseTypePK(entity == null? null: entity.getPrimaryKey());
276    }
277    
278    public boolean getLocationUseTypePKHasBeenModified() {
279        return _value.getLocationUseTypePKHasBeenModified();
280    }
281    
282    public Integer getVelocity() {
283        return _value.getVelocity();
284    }
285    
286    public void setVelocity(Integer velocity)
287            throws PersistenceNotNullException, PersistenceReadOnlyException {
288        checkReadWrite();
289        _value.setVelocity(velocity);
290    }
291    
292    public boolean getVelocityHasBeenModified() {
293        return _value.getVelocityHasBeenModified();
294    }
295    
296    public InventoryLocationGroupPK getInventoryLocationGroupPK() {
297        return _value.getInventoryLocationGroupPK();
298    }
299    
300    public InventoryLocationGroup getInventoryLocationGroup(EntityPermission entityPermission) {
301        return InventoryLocationGroupFactory.getInstance().getEntityFromPK(entityPermission, getInventoryLocationGroupPK());
302    }
303    
304    public InventoryLocationGroup getInventoryLocationGroup() {
305        return getInventoryLocationGroup(EntityPermission.READ_ONLY);
306    }
307    
308    public InventoryLocationGroup getInventoryLocationGroupForUpdate() {
309        return getInventoryLocationGroup(EntityPermission.READ_WRITE);
310    }
311    
312    public void setInventoryLocationGroupPK(InventoryLocationGroupPK inventoryLocationGroupPK)
313            throws PersistenceNotNullException, PersistenceReadOnlyException {
314        checkReadWrite();
315        _value.setInventoryLocationGroupPK(inventoryLocationGroupPK);
316    }
317    
318    public void setInventoryLocationGroup(InventoryLocationGroup entity) {
319        setInventoryLocationGroupPK(entity == null? null: entity.getPrimaryKey());
320    }
321    
322    public boolean getInventoryLocationGroupPKHasBeenModified() {
323        return _value.getInventoryLocationGroupPKHasBeenModified();
324    }
325    
326    public Long getFromTime() {
327        return _value.getFromTime();
328    }
329    
330    public void setFromTime(Long fromTime)
331            throws PersistenceNotNullException, PersistenceReadOnlyException {
332        checkReadWrite();
333        _value.setFromTime(fromTime);
334    }
335    
336    public boolean getFromTimeHasBeenModified() {
337        return _value.getFromTimeHasBeenModified();
338    }
339    
340    public Long getThruTime() {
341        return _value.getThruTime();
342    }
343    
344    public void setThruTime(Long thruTime)
345            throws PersistenceNotNullException, PersistenceReadOnlyException {
346        checkReadWrite();
347        _value.setThruTime(thruTime);
348    }
349    
350    public boolean getThruTimeHasBeenModified() {
351        return _value.getThruTimeHasBeenModified();
352    }
353    
354}