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 * Vendor.java
021 */
022
023package com.echothree.model.data.vendor.server.entity;
024
025import com.echothree.model.data.vendor.common.pk.VendorPK;
026
027import com.echothree.model.data.party.common.pk.PartyPK;
028import com.echothree.model.data.vendor.common.pk.VendorTypePK;
029import com.echothree.model.data.item.common.pk.ItemAliasTypePK;
030import com.echothree.model.data.cancellationpolicy.common.pk.CancellationPolicyPK;
031import com.echothree.model.data.returnpolicy.common.pk.ReturnPolicyPK;
032import com.echothree.model.data.accounting.common.pk.GlAccountPK;
033import com.echothree.model.data.selector.common.pk.SelectorPK;
034import com.echothree.model.data.filter.common.pk.FilterPK;
035
036import com.echothree.model.data.party.server.entity.Party;
037import com.echothree.model.data.vendor.server.entity.VendorType;
038import com.echothree.model.data.item.server.entity.ItemAliasType;
039import com.echothree.model.data.cancellationpolicy.server.entity.CancellationPolicy;
040import com.echothree.model.data.returnpolicy.server.entity.ReturnPolicy;
041import com.echothree.model.data.accounting.server.entity.GlAccount;
042import com.echothree.model.data.selector.server.entity.Selector;
043import com.echothree.model.data.filter.server.entity.Filter;
044
045import com.echothree.model.data.party.server.factory.PartyFactory;
046import com.echothree.model.data.vendor.server.factory.VendorTypeFactory;
047import com.echothree.model.data.item.server.factory.ItemAliasTypeFactory;
048import com.echothree.model.data.cancellationpolicy.server.factory.CancellationPolicyFactory;
049import com.echothree.model.data.returnpolicy.server.factory.ReturnPolicyFactory;
050import com.echothree.model.data.accounting.server.factory.GlAccountFactory;
051import com.echothree.model.data.selector.server.factory.SelectorFactory;
052import com.echothree.model.data.filter.server.factory.FilterFactory;
053
054import com.echothree.model.data.vendor.common.pk.VendorPK;
055
056import com.echothree.model.data.vendor.server.value.VendorValue;
057
058import com.echothree.model.data.vendor.server.factory.VendorFactory;
059
060import com.echothree.util.common.exception.PersistenceException;
061import com.echothree.util.common.exception.PersistenceDatabaseException;
062import com.echothree.util.common.exception.PersistenceNotNullException;
063import com.echothree.util.common.exception.PersistenceReadOnlyException;
064
065import com.echothree.util.common.persistence.BasePK;
066
067import com.echothree.util.common.persistence.type.ByteArray;
068
069import com.echothree.util.server.persistence.BaseEntity;
070import com.echothree.util.server.persistence.EntityPermission;
071import com.echothree.util.server.persistence.Session;
072import com.echothree.util.server.persistence.ThreadSession;
073
074import java.io.Serializable;
075
076public class Vendor
077        extends BaseEntity
078        implements Serializable {
079    
080    private VendorPK _pk;
081    private VendorValue _value;
082    
083    /** Creates a new instance of Vendor */
084    public Vendor()
085            throws PersistenceException {
086        super();
087    }
088    
089    /** Creates a new instance of Vendor */
090    public Vendor(VendorValue value, EntityPermission entityPermission) {
091        super(entityPermission);
092        
093        _value = value;
094        _pk = value.getPrimaryKey();
095    }
096    
097    @Override
098    public VendorFactory getBaseFactoryInstance() {
099        return VendorFactory.getInstance();
100    }
101    
102    @Override
103    public boolean hasBeenModified() {
104        return _value.hasBeenModified();
105    }
106    
107    @Override
108    public int hashCode() {
109        return _pk.hashCode();
110    }
111    
112    @Override
113    public String toString() {
114        return _pk.toString();
115    }
116    
117    @Override
118    public boolean equals(Object other) {
119        if(this == other)
120            return true;
121        
122        if(other instanceof Vendor that) {
123            VendorValue thatValue = that.getVendorValue();
124            return _value.equals(thatValue);
125        } else {
126            return false;
127        }
128    }
129    
130    @Override
131    public void store()
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().store(this);
134    }
135    
136    @Override
137    public void remove()
138            throws PersistenceDatabaseException {
139        getBaseFactoryInstance().remove(this);
140    }
141    
142    public VendorValue getVendorValue() {
143        return _value;
144    }
145    
146    public void setVendorValue(VendorValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    public VendorPK getPrimaryKey() {
154        return _pk;
155    }
156    
157    public PartyPK getPartyPK() {
158        return _value.getPartyPK();
159    }
160    
161    public Party getParty(EntityPermission entityPermission) {
162        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getPartyPK());
163    }
164    
165    public Party getParty() {
166        return getParty(EntityPermission.READ_ONLY);
167    }
168    
169    public Party getPartyForUpdate() {
170        return getParty(EntityPermission.READ_WRITE);
171    }
172    
173    public void setPartyPK(PartyPK partyPK)
174            throws PersistenceNotNullException, PersistenceReadOnlyException {
175        checkReadWrite();
176        _value.setPartyPK(partyPK);
177    }
178    
179    public void setParty(Party entity) {
180        setPartyPK(entity == null? null: entity.getPrimaryKey());
181    }
182    
183    public boolean getPartyPKHasBeenModified() {
184        return _value.getPartyPKHasBeenModified();
185    }
186    
187    public String getVendorName() {
188        return _value.getVendorName();
189    }
190    
191    public void setVendorName(String vendorName)
192            throws PersistenceNotNullException, PersistenceReadOnlyException {
193        checkReadWrite();
194        _value.setVendorName(vendorName);
195    }
196    
197    public boolean getVendorNameHasBeenModified() {
198        return _value.getVendorNameHasBeenModified();
199    }
200    
201    public VendorTypePK getVendorTypePK() {
202        return _value.getVendorTypePK();
203    }
204    
205    public VendorType getVendorType(EntityPermission entityPermission) {
206        return VendorTypeFactory.getInstance().getEntityFromPK(entityPermission, getVendorTypePK());
207    }
208    
209    public VendorType getVendorType() {
210        return getVendorType(EntityPermission.READ_ONLY);
211    }
212    
213    public VendorType getVendorTypeForUpdate() {
214        return getVendorType(EntityPermission.READ_WRITE);
215    }
216    
217    public void setVendorTypePK(VendorTypePK vendorTypePK)
218            throws PersistenceNotNullException, PersistenceReadOnlyException {
219        checkReadWrite();
220        _value.setVendorTypePK(vendorTypePK);
221    }
222    
223    public void setVendorType(VendorType entity) {
224        setVendorTypePK(entity == null? null: entity.getPrimaryKey());
225    }
226    
227    public boolean getVendorTypePKHasBeenModified() {
228        return _value.getVendorTypePKHasBeenModified();
229    }
230    
231    public Integer getMinimumPurchaseOrderLines() {
232        return _value.getMinimumPurchaseOrderLines();
233    }
234    
235    public void setMinimumPurchaseOrderLines(Integer minimumPurchaseOrderLines)
236            throws PersistenceNotNullException, PersistenceReadOnlyException {
237        checkReadWrite();
238        _value.setMinimumPurchaseOrderLines(minimumPurchaseOrderLines);
239    }
240    
241    public boolean getMinimumPurchaseOrderLinesHasBeenModified() {
242        return _value.getMinimumPurchaseOrderLinesHasBeenModified();
243    }
244    
245    public Integer getMaximumPurchaseOrderLines() {
246        return _value.getMaximumPurchaseOrderLines();
247    }
248    
249    public void setMaximumPurchaseOrderLines(Integer maximumPurchaseOrderLines)
250            throws PersistenceNotNullException, PersistenceReadOnlyException {
251        checkReadWrite();
252        _value.setMaximumPurchaseOrderLines(maximumPurchaseOrderLines);
253    }
254    
255    public boolean getMaximumPurchaseOrderLinesHasBeenModified() {
256        return _value.getMaximumPurchaseOrderLinesHasBeenModified();
257    }
258    
259    public Long getMinimumPurchaseOrderAmount() {
260        return _value.getMinimumPurchaseOrderAmount();
261    }
262    
263    public void setMinimumPurchaseOrderAmount(Long minimumPurchaseOrderAmount)
264            throws PersistenceNotNullException, PersistenceReadOnlyException {
265        checkReadWrite();
266        _value.setMinimumPurchaseOrderAmount(minimumPurchaseOrderAmount);
267    }
268    
269    public boolean getMinimumPurchaseOrderAmountHasBeenModified() {
270        return _value.getMinimumPurchaseOrderAmountHasBeenModified();
271    }
272    
273    public Long getMaximumPurchaseOrderAmount() {
274        return _value.getMaximumPurchaseOrderAmount();
275    }
276    
277    public void setMaximumPurchaseOrderAmount(Long maximumPurchaseOrderAmount)
278            throws PersistenceNotNullException, PersistenceReadOnlyException {
279        checkReadWrite();
280        _value.setMaximumPurchaseOrderAmount(maximumPurchaseOrderAmount);
281    }
282    
283    public boolean getMaximumPurchaseOrderAmountHasBeenModified() {
284        return _value.getMaximumPurchaseOrderAmountHasBeenModified();
285    }
286    
287    public Boolean getUseItemPurchasingCategories() {
288        return _value.getUseItemPurchasingCategories();
289    }
290    
291    public void setUseItemPurchasingCategories(Boolean useItemPurchasingCategories)
292            throws PersistenceNotNullException, PersistenceReadOnlyException {
293        checkReadWrite();
294        _value.setUseItemPurchasingCategories(useItemPurchasingCategories);
295    }
296    
297    public boolean getUseItemPurchasingCategoriesHasBeenModified() {
298        return _value.getUseItemPurchasingCategoriesHasBeenModified();
299    }
300    
301    public ItemAliasTypePK getDefaultItemAliasTypePK() {
302        return _value.getDefaultItemAliasTypePK();
303    }
304    
305    public ItemAliasType getDefaultItemAliasType(EntityPermission entityPermission) {
306        ItemAliasTypePK pk = getDefaultItemAliasTypePK();
307        ItemAliasType entity = pk == null? null: ItemAliasTypeFactory.getInstance().getEntityFromPK(entityPermission, pk);
308        
309        return entity;
310    }
311    
312    public ItemAliasType getDefaultItemAliasType() {
313        return getDefaultItemAliasType(EntityPermission.READ_ONLY);
314    }
315    
316    public ItemAliasType getDefaultItemAliasTypeForUpdate() {
317        return getDefaultItemAliasType(EntityPermission.READ_WRITE);
318    }
319    
320    public void setDefaultItemAliasTypePK(ItemAliasTypePK defaultItemAliasTypePK)
321            throws PersistenceNotNullException, PersistenceReadOnlyException {
322        checkReadWrite();
323        _value.setDefaultItemAliasTypePK(defaultItemAliasTypePK);
324    }
325    
326    public void setDefaultItemAliasType(ItemAliasType entity) {
327        setDefaultItemAliasTypePK(entity == null? null: entity.getPrimaryKey());
328    }
329    
330    public boolean getDefaultItemAliasTypePKHasBeenModified() {
331        return _value.getDefaultItemAliasTypePKHasBeenModified();
332    }
333    
334    public CancellationPolicyPK getCancellationPolicyPK() {
335        return _value.getCancellationPolicyPK();
336    }
337    
338    public CancellationPolicy getCancellationPolicy(EntityPermission entityPermission) {
339        CancellationPolicyPK pk = getCancellationPolicyPK();
340        CancellationPolicy entity = pk == null? null: CancellationPolicyFactory.getInstance().getEntityFromPK(entityPermission, pk);
341        
342        return entity;
343    }
344    
345    public CancellationPolicy getCancellationPolicy() {
346        return getCancellationPolicy(EntityPermission.READ_ONLY);
347    }
348    
349    public CancellationPolicy getCancellationPolicyForUpdate() {
350        return getCancellationPolicy(EntityPermission.READ_WRITE);
351    }
352    
353    public void setCancellationPolicyPK(CancellationPolicyPK cancellationPolicyPK)
354            throws PersistenceNotNullException, PersistenceReadOnlyException {
355        checkReadWrite();
356        _value.setCancellationPolicyPK(cancellationPolicyPK);
357    }
358    
359    public void setCancellationPolicy(CancellationPolicy entity) {
360        setCancellationPolicyPK(entity == null? null: entity.getPrimaryKey());
361    }
362    
363    public boolean getCancellationPolicyPKHasBeenModified() {
364        return _value.getCancellationPolicyPKHasBeenModified();
365    }
366    
367    public ReturnPolicyPK getReturnPolicyPK() {
368        return _value.getReturnPolicyPK();
369    }
370    
371    public ReturnPolicy getReturnPolicy(EntityPermission entityPermission) {
372        ReturnPolicyPK pk = getReturnPolicyPK();
373        ReturnPolicy entity = pk == null? null: ReturnPolicyFactory.getInstance().getEntityFromPK(entityPermission, pk);
374        
375        return entity;
376    }
377    
378    public ReturnPolicy getReturnPolicy() {
379        return getReturnPolicy(EntityPermission.READ_ONLY);
380    }
381    
382    public ReturnPolicy getReturnPolicyForUpdate() {
383        return getReturnPolicy(EntityPermission.READ_WRITE);
384    }
385    
386    public void setReturnPolicyPK(ReturnPolicyPK returnPolicyPK)
387            throws PersistenceNotNullException, PersistenceReadOnlyException {
388        checkReadWrite();
389        _value.setReturnPolicyPK(returnPolicyPK);
390    }
391    
392    public void setReturnPolicy(ReturnPolicy entity) {
393        setReturnPolicyPK(entity == null? null: entity.getPrimaryKey());
394    }
395    
396    public boolean getReturnPolicyPKHasBeenModified() {
397        return _value.getReturnPolicyPKHasBeenModified();
398    }
399    
400    public GlAccountPK getApGlAccountPK() {
401        return _value.getApGlAccountPK();
402    }
403    
404    public GlAccount getApGlAccount(EntityPermission entityPermission) {
405        GlAccountPK pk = getApGlAccountPK();
406        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk);
407        
408        return entity;
409    }
410    
411    public GlAccount getApGlAccount() {
412        return getApGlAccount(EntityPermission.READ_ONLY);
413    }
414    
415    public GlAccount getApGlAccountForUpdate() {
416        return getApGlAccount(EntityPermission.READ_WRITE);
417    }
418    
419    public void setApGlAccountPK(GlAccountPK apGlAccountPK)
420            throws PersistenceNotNullException, PersistenceReadOnlyException {
421        checkReadWrite();
422        _value.setApGlAccountPK(apGlAccountPK);
423    }
424    
425    public void setApGlAccount(GlAccount entity) {
426        setApGlAccountPK(entity == null? null: entity.getPrimaryKey());
427    }
428    
429    public boolean getApGlAccountPKHasBeenModified() {
430        return _value.getApGlAccountPKHasBeenModified();
431    }
432    
433    public Boolean getHoldUntilComplete() {
434        return _value.getHoldUntilComplete();
435    }
436    
437    public void setHoldUntilComplete(Boolean holdUntilComplete)
438            throws PersistenceNotNullException, PersistenceReadOnlyException {
439        checkReadWrite();
440        _value.setHoldUntilComplete(holdUntilComplete);
441    }
442    
443    public boolean getHoldUntilCompleteHasBeenModified() {
444        return _value.getHoldUntilCompleteHasBeenModified();
445    }
446    
447    public Boolean getAllowBackorders() {
448        return _value.getAllowBackorders();
449    }
450    
451    public void setAllowBackorders(Boolean allowBackorders)
452            throws PersistenceNotNullException, PersistenceReadOnlyException {
453        checkReadWrite();
454        _value.setAllowBackorders(allowBackorders);
455    }
456    
457    public boolean getAllowBackordersHasBeenModified() {
458        return _value.getAllowBackordersHasBeenModified();
459    }
460    
461    public Boolean getAllowSubstitutions() {
462        return _value.getAllowSubstitutions();
463    }
464    
465    public void setAllowSubstitutions(Boolean allowSubstitutions)
466            throws PersistenceNotNullException, PersistenceReadOnlyException {
467        checkReadWrite();
468        _value.setAllowSubstitutions(allowSubstitutions);
469    }
470    
471    public boolean getAllowSubstitutionsHasBeenModified() {
472        return _value.getAllowSubstitutionsHasBeenModified();
473    }
474    
475    public Boolean getAllowCombiningShipments() {
476        return _value.getAllowCombiningShipments();
477    }
478    
479    public void setAllowCombiningShipments(Boolean allowCombiningShipments)
480            throws PersistenceNotNullException, PersistenceReadOnlyException {
481        checkReadWrite();
482        _value.setAllowCombiningShipments(allowCombiningShipments);
483    }
484    
485    public boolean getAllowCombiningShipmentsHasBeenModified() {
486        return _value.getAllowCombiningShipmentsHasBeenModified();
487    }
488    
489    public Boolean getRequireReference() {
490        return _value.getRequireReference();
491    }
492    
493    public void setRequireReference(Boolean requireReference)
494            throws PersistenceNotNullException, PersistenceReadOnlyException {
495        checkReadWrite();
496        _value.setRequireReference(requireReference);
497    }
498    
499    public boolean getRequireReferenceHasBeenModified() {
500        return _value.getRequireReferenceHasBeenModified();
501    }
502    
503    public Boolean getAllowReferenceDuplicates() {
504        return _value.getAllowReferenceDuplicates();
505    }
506    
507    public void setAllowReferenceDuplicates(Boolean allowReferenceDuplicates)
508            throws PersistenceNotNullException, PersistenceReadOnlyException {
509        checkReadWrite();
510        _value.setAllowReferenceDuplicates(allowReferenceDuplicates);
511    }
512    
513    public boolean getAllowReferenceDuplicatesHasBeenModified() {
514        return _value.getAllowReferenceDuplicatesHasBeenModified();
515    }
516    
517    public String getReferenceValidationPattern() {
518        return _value.getReferenceValidationPattern();
519    }
520    
521    public void setReferenceValidationPattern(String referenceValidationPattern)
522            throws PersistenceNotNullException, PersistenceReadOnlyException {
523        checkReadWrite();
524        _value.setReferenceValidationPattern(referenceValidationPattern);
525    }
526    
527    public boolean getReferenceValidationPatternHasBeenModified() {
528        return _value.getReferenceValidationPatternHasBeenModified();
529    }
530    
531    public SelectorPK getVendorItemSelectorPK() {
532        return _value.getVendorItemSelectorPK();
533    }
534    
535    public Selector getVendorItemSelector(EntityPermission entityPermission) {
536        SelectorPK pk = getVendorItemSelectorPK();
537        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
538        
539        return entity;
540    }
541    
542    public Selector getVendorItemSelector() {
543        return getVendorItemSelector(EntityPermission.READ_ONLY);
544    }
545    
546    public Selector getVendorItemSelectorForUpdate() {
547        return getVendorItemSelector(EntityPermission.READ_WRITE);
548    }
549    
550    public void setVendorItemSelectorPK(SelectorPK vendorItemSelectorPK)
551            throws PersistenceNotNullException, PersistenceReadOnlyException {
552        checkReadWrite();
553        _value.setVendorItemSelectorPK(vendorItemSelectorPK);
554    }
555    
556    public void setVendorItemSelector(Selector entity) {
557        setVendorItemSelectorPK(entity == null? null: entity.getPrimaryKey());
558    }
559    
560    public boolean getVendorItemSelectorPKHasBeenModified() {
561        return _value.getVendorItemSelectorPKHasBeenModified();
562    }
563    
564    public FilterPK getVendorItemCostFilterPK() {
565        return _value.getVendorItemCostFilterPK();
566    }
567    
568    public Filter getVendorItemCostFilter(EntityPermission entityPermission) {
569        FilterPK pk = getVendorItemCostFilterPK();
570        Filter entity = pk == null? null: FilterFactory.getInstance().getEntityFromPK(entityPermission, pk);
571        
572        return entity;
573    }
574    
575    public Filter getVendorItemCostFilter() {
576        return getVendorItemCostFilter(EntityPermission.READ_ONLY);
577    }
578    
579    public Filter getVendorItemCostFilterForUpdate() {
580        return getVendorItemCostFilter(EntityPermission.READ_WRITE);
581    }
582    
583    public void setVendorItemCostFilterPK(FilterPK vendorItemCostFilterPK)
584            throws PersistenceNotNullException, PersistenceReadOnlyException {
585        checkReadWrite();
586        _value.setVendorItemCostFilterPK(vendorItemCostFilterPK);
587    }
588    
589    public void setVendorItemCostFilter(Filter entity) {
590        setVendorItemCostFilterPK(entity == null? null: entity.getPrimaryKey());
591    }
592    
593    public boolean getVendorItemCostFilterPKHasBeenModified() {
594        return _value.getVendorItemCostFilterPKHasBeenModified();
595    }
596    
597    public Long getFromTime() {
598        return _value.getFromTime();
599    }
600    
601    public void setFromTime(Long fromTime)
602            throws PersistenceNotNullException, PersistenceReadOnlyException {
603        checkReadWrite();
604        _value.setFromTime(fromTime);
605    }
606    
607    public boolean getFromTimeHasBeenModified() {
608        return _value.getFromTimeHasBeenModified();
609    }
610    
611    public Long getThruTime() {
612        return _value.getThruTime();
613    }
614    
615    public void setThruTime(Long thruTime)
616            throws PersistenceNotNullException, PersistenceReadOnlyException {
617        checkReadWrite();
618        _value.setThruTime(thruTime);
619    }
620    
621    public boolean getThruTimeHasBeenModified() {
622        return _value.getThruTimeHasBeenModified();
623    }
624    
625}