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 * ItemAccountingCategoryDetail.java
021 */
022
023package com.echothree.model.data.accounting.server.entity;
024
025import com.echothree.model.data.accounting.common.pk.ItemAccountingCategoryDetailPK;
026
027import com.echothree.model.data.accounting.common.pk.ItemAccountingCategoryPK;
028import com.echothree.model.data.accounting.common.pk.GlAccountPK;
029
030import com.echothree.model.data.accounting.server.entity.ItemAccountingCategory;
031import com.echothree.model.data.accounting.server.entity.GlAccount;
032
033import com.echothree.model.data.accounting.server.factory.ItemAccountingCategoryFactory;
034import com.echothree.model.data.accounting.server.factory.GlAccountFactory;
035
036import com.echothree.model.data.accounting.common.pk.ItemAccountingCategoryDetailPK;
037
038import com.echothree.model.data.accounting.server.value.ItemAccountingCategoryDetailValue;
039
040import com.echothree.model.data.accounting.server.factory.ItemAccountingCategoryDetailFactory;
041
042import com.echothree.util.common.exception.PersistenceException;
043import com.echothree.util.common.exception.PersistenceDatabaseException;
044import com.echothree.util.common.exception.PersistenceNotNullException;
045import com.echothree.util.common.exception.PersistenceReadOnlyException;
046
047import com.echothree.util.common.persistence.BasePK;
048
049import com.echothree.util.common.persistence.type.ByteArray;
050
051import com.echothree.util.server.persistence.BaseEntity;
052import com.echothree.util.server.persistence.EntityPermission;
053import com.echothree.util.server.persistence.Session;
054import com.echothree.util.server.persistence.ThreadSession;
055
056import java.io.Serializable;
057
058public class ItemAccountingCategoryDetail
059        extends BaseEntity
060        implements Serializable {
061    
062    private ItemAccountingCategoryDetailPK _pk;
063    private ItemAccountingCategoryDetailValue _value;
064    
065    /** Creates a new instance of ItemAccountingCategoryDetail */
066    public ItemAccountingCategoryDetail()
067            throws PersistenceException {
068        super();
069    }
070    
071    /** Creates a new instance of ItemAccountingCategoryDetail */
072    public ItemAccountingCategoryDetail(ItemAccountingCategoryDetailValue value, EntityPermission entityPermission) {
073        super(entityPermission);
074        
075        _value = value;
076        _pk = value.getPrimaryKey();
077    }
078    
079    @Override
080    public ItemAccountingCategoryDetailFactory getBaseFactoryInstance() {
081        return ItemAccountingCategoryDetailFactory.getInstance();
082    }
083    
084    @Override
085    public boolean hasBeenModified() {
086        return _value.hasBeenModified();
087    }
088    
089    @Override
090    public int hashCode() {
091        return _pk.hashCode();
092    }
093    
094    @Override
095    public String toString() {
096        return _pk.toString();
097    }
098    
099    @Override
100    public boolean equals(Object other) {
101        if(this == other)
102            return true;
103        
104        if(other instanceof ItemAccountingCategoryDetail) {
105            ItemAccountingCategoryDetail that = (ItemAccountingCategoryDetail)other;
106            
107            ItemAccountingCategoryDetailValue thatValue = that.getItemAccountingCategoryDetailValue();
108            return _value.equals(thatValue);
109        } else {
110            return false;
111        }
112    }
113    
114    @Override
115    public void store(Session session)
116            throws PersistenceDatabaseException {
117        getBaseFactoryInstance().store(session, this);
118    }
119    
120    @Override
121    public void remove(Session session)
122            throws PersistenceDatabaseException {
123        getBaseFactoryInstance().remove(session, this);
124    }
125    
126    @Override
127    public void remove()
128            throws PersistenceDatabaseException {
129        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
130    }
131    
132    public ItemAccountingCategoryDetailValue getItemAccountingCategoryDetailValue() {
133        return _value;
134    }
135    
136    public void setItemAccountingCategoryDetailValue(ItemAccountingCategoryDetailValue value)
137            throws PersistenceReadOnlyException {
138        checkReadWrite();
139        _value = value;
140    }
141    
142    @Override
143    public ItemAccountingCategoryDetailPK getPrimaryKey() {
144        return _pk;
145    }
146    
147    public ItemAccountingCategoryPK getItemAccountingCategoryPK() {
148        return _value.getItemAccountingCategoryPK();
149    }
150    
151    public ItemAccountingCategory getItemAccountingCategory(Session session, EntityPermission entityPermission) {
152        return ItemAccountingCategoryFactory.getInstance().getEntityFromPK(session, entityPermission, getItemAccountingCategoryPK());
153    }
154    
155    public ItemAccountingCategory getItemAccountingCategory(EntityPermission entityPermission) {
156        return getItemAccountingCategory(ThreadSession.currentSession(), entityPermission);
157    }
158    
159    public ItemAccountingCategory getItemAccountingCategory(Session session) {
160        return getItemAccountingCategory(session, EntityPermission.READ_ONLY);
161    }
162    
163    public ItemAccountingCategory getItemAccountingCategory() {
164        return getItemAccountingCategory(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
165    }
166    
167    public ItemAccountingCategory getItemAccountingCategoryForUpdate(Session session) {
168        return getItemAccountingCategory(session, EntityPermission.READ_WRITE);
169    }
170    
171    public ItemAccountingCategory getItemAccountingCategoryForUpdate() {
172        return getItemAccountingCategory(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
173    }
174    
175    public void setItemAccountingCategoryPK(ItemAccountingCategoryPK itemAccountingCategoryPK)
176            throws PersistenceNotNullException, PersistenceReadOnlyException {
177        checkReadWrite();
178        _value.setItemAccountingCategoryPK(itemAccountingCategoryPK);
179    }
180    
181    public void setItemAccountingCategory(ItemAccountingCategory entity) {
182        setItemAccountingCategoryPK(entity == null? null: entity.getPrimaryKey());
183    }
184    
185    public boolean getItemAccountingCategoryPKHasBeenModified() {
186        return _value.getItemAccountingCategoryPKHasBeenModified();
187    }
188    
189    public String getItemAccountingCategoryName() {
190        return _value.getItemAccountingCategoryName();
191    }
192    
193    public void setItemAccountingCategoryName(String itemAccountingCategoryName)
194            throws PersistenceNotNullException, PersistenceReadOnlyException {
195        checkReadWrite();
196        _value.setItemAccountingCategoryName(itemAccountingCategoryName);
197    }
198    
199    public boolean getItemAccountingCategoryNameHasBeenModified() {
200        return _value.getItemAccountingCategoryNameHasBeenModified();
201    }
202    
203    public ItemAccountingCategoryPK getParentItemAccountingCategoryPK() {
204        return _value.getParentItemAccountingCategoryPK();
205    }
206    
207    public ItemAccountingCategory getParentItemAccountingCategory(Session session, EntityPermission entityPermission) {
208        ItemAccountingCategoryPK pk = getParentItemAccountingCategoryPK();
209        ItemAccountingCategory entity = pk == null? null: ItemAccountingCategoryFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
210        
211        return entity;
212    }
213    
214    public ItemAccountingCategory getParentItemAccountingCategory(EntityPermission entityPermission) {
215        return getParentItemAccountingCategory(ThreadSession.currentSession(), entityPermission);
216    }
217    
218    public ItemAccountingCategory getParentItemAccountingCategory(Session session) {
219        return getParentItemAccountingCategory(session, EntityPermission.READ_ONLY);
220    }
221    
222    public ItemAccountingCategory getParentItemAccountingCategory() {
223        return getParentItemAccountingCategory(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
224    }
225    
226    public ItemAccountingCategory getParentItemAccountingCategoryForUpdate(Session session) {
227        return getParentItemAccountingCategory(session, EntityPermission.READ_WRITE);
228    }
229    
230    public ItemAccountingCategory getParentItemAccountingCategoryForUpdate() {
231        return getParentItemAccountingCategory(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
232    }
233    
234    public void setParentItemAccountingCategoryPK(ItemAccountingCategoryPK parentItemAccountingCategoryPK)
235            throws PersistenceNotNullException, PersistenceReadOnlyException {
236        checkReadWrite();
237        _value.setParentItemAccountingCategoryPK(parentItemAccountingCategoryPK);
238    }
239    
240    public void setParentItemAccountingCategory(ItemAccountingCategory entity) {
241        setParentItemAccountingCategoryPK(entity == null? null: entity.getPrimaryKey());
242    }
243    
244    public boolean getParentItemAccountingCategoryPKHasBeenModified() {
245        return _value.getParentItemAccountingCategoryPKHasBeenModified();
246    }
247    
248    public GlAccountPK getInventoryGlAccountPK() {
249        return _value.getInventoryGlAccountPK();
250    }
251    
252    public GlAccount getInventoryGlAccount(Session session, EntityPermission entityPermission) {
253        GlAccountPK pk = getInventoryGlAccountPK();
254        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
255        
256        return entity;
257    }
258    
259    public GlAccount getInventoryGlAccount(EntityPermission entityPermission) {
260        return getInventoryGlAccount(ThreadSession.currentSession(), entityPermission);
261    }
262    
263    public GlAccount getInventoryGlAccount(Session session) {
264        return getInventoryGlAccount(session, EntityPermission.READ_ONLY);
265    }
266    
267    public GlAccount getInventoryGlAccount() {
268        return getInventoryGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
269    }
270    
271    public GlAccount getInventoryGlAccountForUpdate(Session session) {
272        return getInventoryGlAccount(session, EntityPermission.READ_WRITE);
273    }
274    
275    public GlAccount getInventoryGlAccountForUpdate() {
276        return getInventoryGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
277    }
278    
279    public void setInventoryGlAccountPK(GlAccountPK inventoryGlAccountPK)
280            throws PersistenceNotNullException, PersistenceReadOnlyException {
281        checkReadWrite();
282        _value.setInventoryGlAccountPK(inventoryGlAccountPK);
283    }
284    
285    public void setInventoryGlAccount(GlAccount entity) {
286        setInventoryGlAccountPK(entity == null? null: entity.getPrimaryKey());
287    }
288    
289    public boolean getInventoryGlAccountPKHasBeenModified() {
290        return _value.getInventoryGlAccountPKHasBeenModified();
291    }
292    
293    public GlAccountPK getSalesGlAccountPK() {
294        return _value.getSalesGlAccountPK();
295    }
296    
297    public GlAccount getSalesGlAccount(Session session, EntityPermission entityPermission) {
298        GlAccountPK pk = getSalesGlAccountPK();
299        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
300        
301        return entity;
302    }
303    
304    public GlAccount getSalesGlAccount(EntityPermission entityPermission) {
305        return getSalesGlAccount(ThreadSession.currentSession(), entityPermission);
306    }
307    
308    public GlAccount getSalesGlAccount(Session session) {
309        return getSalesGlAccount(session, EntityPermission.READ_ONLY);
310    }
311    
312    public GlAccount getSalesGlAccount() {
313        return getSalesGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
314    }
315    
316    public GlAccount getSalesGlAccountForUpdate(Session session) {
317        return getSalesGlAccount(session, EntityPermission.READ_WRITE);
318    }
319    
320    public GlAccount getSalesGlAccountForUpdate() {
321        return getSalesGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
322    }
323    
324    public void setSalesGlAccountPK(GlAccountPK salesGlAccountPK)
325            throws PersistenceNotNullException, PersistenceReadOnlyException {
326        checkReadWrite();
327        _value.setSalesGlAccountPK(salesGlAccountPK);
328    }
329    
330    public void setSalesGlAccount(GlAccount entity) {
331        setSalesGlAccountPK(entity == null? null: entity.getPrimaryKey());
332    }
333    
334    public boolean getSalesGlAccountPKHasBeenModified() {
335        return _value.getSalesGlAccountPKHasBeenModified();
336    }
337    
338    public GlAccountPK getReturnsGlAccountPK() {
339        return _value.getReturnsGlAccountPK();
340    }
341    
342    public GlAccount getReturnsGlAccount(Session session, EntityPermission entityPermission) {
343        GlAccountPK pk = getReturnsGlAccountPK();
344        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
345        
346        return entity;
347    }
348    
349    public GlAccount getReturnsGlAccount(EntityPermission entityPermission) {
350        return getReturnsGlAccount(ThreadSession.currentSession(), entityPermission);
351    }
352    
353    public GlAccount getReturnsGlAccount(Session session) {
354        return getReturnsGlAccount(session, EntityPermission.READ_ONLY);
355    }
356    
357    public GlAccount getReturnsGlAccount() {
358        return getReturnsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
359    }
360    
361    public GlAccount getReturnsGlAccountForUpdate(Session session) {
362        return getReturnsGlAccount(session, EntityPermission.READ_WRITE);
363    }
364    
365    public GlAccount getReturnsGlAccountForUpdate() {
366        return getReturnsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
367    }
368    
369    public void setReturnsGlAccountPK(GlAccountPK returnsGlAccountPK)
370            throws PersistenceNotNullException, PersistenceReadOnlyException {
371        checkReadWrite();
372        _value.setReturnsGlAccountPK(returnsGlAccountPK);
373    }
374    
375    public void setReturnsGlAccount(GlAccount entity) {
376        setReturnsGlAccountPK(entity == null? null: entity.getPrimaryKey());
377    }
378    
379    public boolean getReturnsGlAccountPKHasBeenModified() {
380        return _value.getReturnsGlAccountPKHasBeenModified();
381    }
382    
383    public GlAccountPK getCogsGlAccountPK() {
384        return _value.getCogsGlAccountPK();
385    }
386    
387    public GlAccount getCogsGlAccount(Session session, EntityPermission entityPermission) {
388        GlAccountPK pk = getCogsGlAccountPK();
389        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
390        
391        return entity;
392    }
393    
394    public GlAccount getCogsGlAccount(EntityPermission entityPermission) {
395        return getCogsGlAccount(ThreadSession.currentSession(), entityPermission);
396    }
397    
398    public GlAccount getCogsGlAccount(Session session) {
399        return getCogsGlAccount(session, EntityPermission.READ_ONLY);
400    }
401    
402    public GlAccount getCogsGlAccount() {
403        return getCogsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
404    }
405    
406    public GlAccount getCogsGlAccountForUpdate(Session session) {
407        return getCogsGlAccount(session, EntityPermission.READ_WRITE);
408    }
409    
410    public GlAccount getCogsGlAccountForUpdate() {
411        return getCogsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
412    }
413    
414    public void setCogsGlAccountPK(GlAccountPK cogsGlAccountPK)
415            throws PersistenceNotNullException, PersistenceReadOnlyException {
416        checkReadWrite();
417        _value.setCogsGlAccountPK(cogsGlAccountPK);
418    }
419    
420    public void setCogsGlAccount(GlAccount entity) {
421        setCogsGlAccountPK(entity == null? null: entity.getPrimaryKey());
422    }
423    
424    public boolean getCogsGlAccountPKHasBeenModified() {
425        return _value.getCogsGlAccountPKHasBeenModified();
426    }
427    
428    public GlAccountPK getReturnsCogsGlAccountPK() {
429        return _value.getReturnsCogsGlAccountPK();
430    }
431    
432    public GlAccount getReturnsCogsGlAccount(Session session, EntityPermission entityPermission) {
433        GlAccountPK pk = getReturnsCogsGlAccountPK();
434        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
435        
436        return entity;
437    }
438    
439    public GlAccount getReturnsCogsGlAccount(EntityPermission entityPermission) {
440        return getReturnsCogsGlAccount(ThreadSession.currentSession(), entityPermission);
441    }
442    
443    public GlAccount getReturnsCogsGlAccount(Session session) {
444        return getReturnsCogsGlAccount(session, EntityPermission.READ_ONLY);
445    }
446    
447    public GlAccount getReturnsCogsGlAccount() {
448        return getReturnsCogsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
449    }
450    
451    public GlAccount getReturnsCogsGlAccountForUpdate(Session session) {
452        return getReturnsCogsGlAccount(session, EntityPermission.READ_WRITE);
453    }
454    
455    public GlAccount getReturnsCogsGlAccountForUpdate() {
456        return getReturnsCogsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
457    }
458    
459    public void setReturnsCogsGlAccountPK(GlAccountPK returnsCogsGlAccountPK)
460            throws PersistenceNotNullException, PersistenceReadOnlyException {
461        checkReadWrite();
462        _value.setReturnsCogsGlAccountPK(returnsCogsGlAccountPK);
463    }
464    
465    public void setReturnsCogsGlAccount(GlAccount entity) {
466        setReturnsCogsGlAccountPK(entity == null? null: entity.getPrimaryKey());
467    }
468    
469    public boolean getReturnsCogsGlAccountPKHasBeenModified() {
470        return _value.getReturnsCogsGlAccountPKHasBeenModified();
471    }
472    
473    public Boolean getIsDefault() {
474        return _value.getIsDefault();
475    }
476    
477    public void setIsDefault(Boolean isDefault)
478            throws PersistenceNotNullException, PersistenceReadOnlyException {
479        checkReadWrite();
480        _value.setIsDefault(isDefault);
481    }
482    
483    public boolean getIsDefaultHasBeenModified() {
484        return _value.getIsDefaultHasBeenModified();
485    }
486    
487    public Integer getSortOrder() {
488        return _value.getSortOrder();
489    }
490    
491    public void setSortOrder(Integer sortOrder)
492            throws PersistenceNotNullException, PersistenceReadOnlyException {
493        checkReadWrite();
494        _value.setSortOrder(sortOrder);
495    }
496    
497    public boolean getSortOrderHasBeenModified() {
498        return _value.getSortOrderHasBeenModified();
499    }
500    
501    public Long getFromTime() {
502        return _value.getFromTime();
503    }
504    
505    public void setFromTime(Long fromTime)
506            throws PersistenceNotNullException, PersistenceReadOnlyException {
507        checkReadWrite();
508        _value.setFromTime(fromTime);
509    }
510    
511    public boolean getFromTimeHasBeenModified() {
512        return _value.getFromTimeHasBeenModified();
513    }
514    
515    public Long getThruTime() {
516        return _value.getThruTime();
517    }
518    
519    public void setThruTime(Long thruTime)
520            throws PersistenceNotNullException, PersistenceReadOnlyException {
521        checkReadWrite();
522        _value.setThruTime(thruTime);
523    }
524    
525    public boolean getThruTimeHasBeenModified() {
526        return _value.getThruTimeHasBeenModified();
527    }
528    
529}