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 * VendorValue.java
021 */
022
023package com.echothree.model.data.vendor.server.value;
024
025import com.echothree.model.data.vendor.common.pk.VendorPK;
026
027import com.echothree.model.data.vendor.server.factory.VendorFactory;
028
029import com.echothree.model.data.party.common.pk.PartyPK;
030import com.echothree.model.data.vendor.common.pk.VendorTypePK;
031import com.echothree.model.data.item.common.pk.ItemAliasTypePK;
032import com.echothree.model.data.cancellationpolicy.common.pk.CancellationPolicyPK;
033import com.echothree.model.data.returnpolicy.common.pk.ReturnPolicyPK;
034import com.echothree.model.data.accounting.common.pk.GlAccountPK;
035import com.echothree.model.data.selector.common.pk.SelectorPK;
036import com.echothree.model.data.filter.common.pk.FilterPK;
037
038import com.echothree.util.common.exception.PersistenceCloneException;
039import com.echothree.util.common.exception.PersistenceNotNullException;
040
041import com.echothree.util.server.persistence.BaseValue;
042
043import java.io.Serializable;
044
045public class VendorValue
046        extends BaseValue<VendorPK>
047        implements Cloneable, Serializable {
048    
049    private PartyPK partyPK;
050    private boolean partyPKHasBeenModified = false;
051    private String vendorName;
052    private boolean vendorNameHasBeenModified = false;
053    private VendorTypePK vendorTypePK;
054    private boolean vendorTypePKHasBeenModified = false;
055    private Integer minimumPurchaseOrderLines;
056    private boolean minimumPurchaseOrderLinesHasBeenModified = false;
057    private Integer maximumPurchaseOrderLines;
058    private boolean maximumPurchaseOrderLinesHasBeenModified = false;
059    private Long minimumPurchaseOrderAmount;
060    private boolean minimumPurchaseOrderAmountHasBeenModified = false;
061    private Long maximumPurchaseOrderAmount;
062    private boolean maximumPurchaseOrderAmountHasBeenModified = false;
063    private Boolean useItemPurchasingCategories;
064    private boolean useItemPurchasingCategoriesHasBeenModified = false;
065    private ItemAliasTypePK defaultItemAliasTypePK;
066    private boolean defaultItemAliasTypePKHasBeenModified = false;
067    private CancellationPolicyPK cancellationPolicyPK;
068    private boolean cancellationPolicyPKHasBeenModified = false;
069    private ReturnPolicyPK returnPolicyPK;
070    private boolean returnPolicyPKHasBeenModified = false;
071    private GlAccountPK apGlAccountPK;
072    private boolean apGlAccountPKHasBeenModified = false;
073    private Boolean holdUntilComplete;
074    private boolean holdUntilCompleteHasBeenModified = false;
075    private Boolean allowBackorders;
076    private boolean allowBackordersHasBeenModified = false;
077    private Boolean allowSubstitutions;
078    private boolean allowSubstitutionsHasBeenModified = false;
079    private Boolean allowCombiningShipments;
080    private boolean allowCombiningShipmentsHasBeenModified = false;
081    private Boolean requireReference;
082    private boolean requireReferenceHasBeenModified = false;
083    private Boolean allowReferenceDuplicates;
084    private boolean allowReferenceDuplicatesHasBeenModified = false;
085    private String referenceValidationPattern;
086    private boolean referenceValidationPatternHasBeenModified = false;
087    private SelectorPK vendorItemSelectorPK;
088    private boolean vendorItemSelectorPKHasBeenModified = false;
089    private FilterPK vendorItemCostFilterPK;
090    private boolean vendorItemCostFilterPKHasBeenModified = false;
091    private Long fromTime;
092    private boolean fromTimeHasBeenModified = false;
093    private Long thruTime;
094    private boolean thruTimeHasBeenModified = false;
095    
096    private transient Integer _hashCode = null;
097    private transient String _stringValue = null;
098    
099    private void constructFields(PartyPK partyPK, String vendorName, VendorTypePK vendorTypePK, Integer minimumPurchaseOrderLines, Integer maximumPurchaseOrderLines, Long minimumPurchaseOrderAmount, Long maximumPurchaseOrderAmount, Boolean useItemPurchasingCategories, ItemAliasTypePK defaultItemAliasTypePK, CancellationPolicyPK cancellationPolicyPK, ReturnPolicyPK returnPolicyPK, GlAccountPK apGlAccountPK, Boolean holdUntilComplete, Boolean allowBackorders, Boolean allowSubstitutions, Boolean allowCombiningShipments, Boolean requireReference, Boolean allowReferenceDuplicates, String referenceValidationPattern, SelectorPK vendorItemSelectorPK, FilterPK vendorItemCostFilterPK, Long fromTime, Long thruTime)
100            throws PersistenceNotNullException {
101        checkForNull(partyPK);
102        this.partyPK = partyPK;
103        checkForNull(vendorName);
104        this.vendorName = vendorName;
105        checkForNull(vendorTypePK);
106        this.vendorTypePK = vendorTypePK;
107        this.minimumPurchaseOrderLines = minimumPurchaseOrderLines;
108        this.maximumPurchaseOrderLines = maximumPurchaseOrderLines;
109        this.minimumPurchaseOrderAmount = minimumPurchaseOrderAmount;
110        this.maximumPurchaseOrderAmount = maximumPurchaseOrderAmount;
111        checkForNull(useItemPurchasingCategories);
112        this.useItemPurchasingCategories = useItemPurchasingCategories;
113        this.defaultItemAliasTypePK = defaultItemAliasTypePK;
114        this.cancellationPolicyPK = cancellationPolicyPK;
115        this.returnPolicyPK = returnPolicyPK;
116        this.apGlAccountPK = apGlAccountPK;
117        checkForNull(holdUntilComplete);
118        this.holdUntilComplete = holdUntilComplete;
119        checkForNull(allowBackorders);
120        this.allowBackorders = allowBackorders;
121        checkForNull(allowSubstitutions);
122        this.allowSubstitutions = allowSubstitutions;
123        checkForNull(allowCombiningShipments);
124        this.allowCombiningShipments = allowCombiningShipments;
125        checkForNull(requireReference);
126        this.requireReference = requireReference;
127        checkForNull(allowReferenceDuplicates);
128        this.allowReferenceDuplicates = allowReferenceDuplicates;
129        this.referenceValidationPattern = referenceValidationPattern;
130        this.vendorItemSelectorPK = vendorItemSelectorPK;
131        this.vendorItemCostFilterPK = vendorItemCostFilterPK;
132        checkForNull(fromTime);
133        this.fromTime = fromTime;
134        checkForNull(thruTime);
135        this.thruTime = thruTime;
136    }
137    
138    /** Creates a new instance of VendorValue */
139    public VendorValue(VendorPK vendorPK, PartyPK partyPK, String vendorName, VendorTypePK vendorTypePK, Integer minimumPurchaseOrderLines, Integer maximumPurchaseOrderLines, Long minimumPurchaseOrderAmount, Long maximumPurchaseOrderAmount, Boolean useItemPurchasingCategories, ItemAliasTypePK defaultItemAliasTypePK, CancellationPolicyPK cancellationPolicyPK, ReturnPolicyPK returnPolicyPK, GlAccountPK apGlAccountPK, Boolean holdUntilComplete, Boolean allowBackorders, Boolean allowSubstitutions, Boolean allowCombiningShipments, Boolean requireReference, Boolean allowReferenceDuplicates, String referenceValidationPattern, SelectorPK vendorItemSelectorPK, FilterPK vendorItemCostFilterPK, Long fromTime, Long thruTime)
140            throws PersistenceNotNullException {
141        super(vendorPK);
142        constructFields(partyPK, vendorName, vendorTypePK, minimumPurchaseOrderLines, maximumPurchaseOrderLines, minimumPurchaseOrderAmount, maximumPurchaseOrderAmount, useItemPurchasingCategories, defaultItemAliasTypePK, cancellationPolicyPK, returnPolicyPK, apGlAccountPK, holdUntilComplete, allowBackorders, allowSubstitutions, allowCombiningShipments, requireReference, allowReferenceDuplicates, referenceValidationPattern, vendorItemSelectorPK, vendorItemCostFilterPK, fromTime, thruTime);
143    }
144    
145    /** Creates a new instance of VendorValue */
146    public VendorValue(PartyPK partyPK, String vendorName, VendorTypePK vendorTypePK, Integer minimumPurchaseOrderLines, Integer maximumPurchaseOrderLines, Long minimumPurchaseOrderAmount, Long maximumPurchaseOrderAmount, Boolean useItemPurchasingCategories, ItemAliasTypePK defaultItemAliasTypePK, CancellationPolicyPK cancellationPolicyPK, ReturnPolicyPK returnPolicyPK, GlAccountPK apGlAccountPK, Boolean holdUntilComplete, Boolean allowBackorders, Boolean allowSubstitutions, Boolean allowCombiningShipments, Boolean requireReference, Boolean allowReferenceDuplicates, String referenceValidationPattern, SelectorPK vendorItemSelectorPK, FilterPK vendorItemCostFilterPK, Long fromTime, Long thruTime)
147            throws PersistenceNotNullException {
148        super();
149        constructFields(partyPK, vendorName, vendorTypePK, minimumPurchaseOrderLines, maximumPurchaseOrderLines, minimumPurchaseOrderAmount, maximumPurchaseOrderAmount, useItemPurchasingCategories, defaultItemAliasTypePK, cancellationPolicyPK, returnPolicyPK, apGlAccountPK, holdUntilComplete, allowBackorders, allowSubstitutions, allowCombiningShipments, requireReference, allowReferenceDuplicates, referenceValidationPattern, vendorItemSelectorPK, vendorItemCostFilterPK, fromTime, thruTime);
150    }
151    
152   @Override
153   public VendorFactory getBaseFactoryInstance() {
154        return VendorFactory.getInstance();
155    }
156    
157    @Override
158    public VendorValue clone() {
159        Object result;
160        
161        try {
162            result = super.clone();
163        } catch (CloneNotSupportedException cnse) {
164            // This shouldn't happen, fail when it does.
165            throw new PersistenceCloneException(cnse);
166        }
167        
168        return (VendorValue)result;
169    }
170    
171   @Override
172    public VendorPK getPrimaryKey() {
173        if(_primaryKey == null) {
174            _primaryKey = new VendorPK(entityId);
175        }
176        
177        return _primaryKey;
178    }
179    
180    private void clearHashAndString() {
181        _hashCode = null;
182        _stringValue = null;
183    }
184    
185    @Override
186    public int hashCode() {
187        if(_hashCode == null) {
188            int hashCode = 17;
189            
190            hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0);
191            
192            hashCode = 37 * hashCode + ((partyPK != null) ? partyPK.hashCode() : 0);
193            hashCode = 37 * hashCode + ((vendorName != null) ? vendorName.hashCode() : 0);
194            hashCode = 37 * hashCode + ((vendorTypePK != null) ? vendorTypePK.hashCode() : 0);
195            hashCode = 37 * hashCode + ((minimumPurchaseOrderLines != null) ? minimumPurchaseOrderLines.hashCode() : 0);
196            hashCode = 37 * hashCode + ((maximumPurchaseOrderLines != null) ? maximumPurchaseOrderLines.hashCode() : 0);
197            hashCode = 37 * hashCode + ((minimumPurchaseOrderAmount != null) ? minimumPurchaseOrderAmount.hashCode() : 0);
198            hashCode = 37 * hashCode + ((maximumPurchaseOrderAmount != null) ? maximumPurchaseOrderAmount.hashCode() : 0);
199            hashCode = 37 * hashCode + ((useItemPurchasingCategories != null) ? useItemPurchasingCategories.hashCode() : 0);
200            hashCode = 37 * hashCode + ((defaultItemAliasTypePK != null) ? defaultItemAliasTypePK.hashCode() : 0);
201            hashCode = 37 * hashCode + ((cancellationPolicyPK != null) ? cancellationPolicyPK.hashCode() : 0);
202            hashCode = 37 * hashCode + ((returnPolicyPK != null) ? returnPolicyPK.hashCode() : 0);
203            hashCode = 37 * hashCode + ((apGlAccountPK != null) ? apGlAccountPK.hashCode() : 0);
204            hashCode = 37 * hashCode + ((holdUntilComplete != null) ? holdUntilComplete.hashCode() : 0);
205            hashCode = 37 * hashCode + ((allowBackorders != null) ? allowBackorders.hashCode() : 0);
206            hashCode = 37 * hashCode + ((allowSubstitutions != null) ? allowSubstitutions.hashCode() : 0);
207            hashCode = 37 * hashCode + ((allowCombiningShipments != null) ? allowCombiningShipments.hashCode() : 0);
208            hashCode = 37 * hashCode + ((requireReference != null) ? requireReference.hashCode() : 0);
209            hashCode = 37 * hashCode + ((allowReferenceDuplicates != null) ? allowReferenceDuplicates.hashCode() : 0);
210            hashCode = 37 * hashCode + ((referenceValidationPattern != null) ? referenceValidationPattern.hashCode() : 0);
211            hashCode = 37 * hashCode + ((vendorItemSelectorPK != null) ? vendorItemSelectorPK.hashCode() : 0);
212            hashCode = 37 * hashCode + ((vendorItemCostFilterPK != null) ? vendorItemCostFilterPK.hashCode() : 0);
213            hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0);
214            hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0);
215            
216            _hashCode = hashCode;
217        }
218        
219        return _hashCode;
220    }
221    
222    @Override
223    public String toString() {
224        if(_stringValue == null) {
225            _stringValue = "{" + 
226                    "entityId=" + getEntityId() +
227                    ", partyPK=" + getPartyPK() +
228                    ", vendorName=" + getVendorName() +
229                    ", vendorTypePK=" + getVendorTypePK() +
230                    ", minimumPurchaseOrderLines=" + getMinimumPurchaseOrderLines() +
231                    ", maximumPurchaseOrderLines=" + getMaximumPurchaseOrderLines() +
232                    ", minimumPurchaseOrderAmount=" + getMinimumPurchaseOrderAmount() +
233                    ", maximumPurchaseOrderAmount=" + getMaximumPurchaseOrderAmount() +
234                    ", useItemPurchasingCategories=" + getUseItemPurchasingCategories() +
235                    ", defaultItemAliasTypePK=" + getDefaultItemAliasTypePK() +
236                    ", cancellationPolicyPK=" + getCancellationPolicyPK() +
237                    ", returnPolicyPK=" + getReturnPolicyPK() +
238                    ", apGlAccountPK=" + getApGlAccountPK() +
239                    ", holdUntilComplete=" + getHoldUntilComplete() +
240                    ", allowBackorders=" + getAllowBackorders() +
241                    ", allowSubstitutions=" + getAllowSubstitutions() +
242                    ", allowCombiningShipments=" + getAllowCombiningShipments() +
243                    ", requireReference=" + getRequireReference() +
244                    ", allowReferenceDuplicates=" + getAllowReferenceDuplicates() +
245                    ", referenceValidationPattern=" + getReferenceValidationPattern() +
246                    ", vendorItemSelectorPK=" + getVendorItemSelectorPK() +
247                    ", vendorItemCostFilterPK=" + getVendorItemCostFilterPK() +
248                    ", fromTime=" + getFromTime() +
249                    ", thruTime=" + getThruTime() +
250                    "}";
251        }
252        return _stringValue;
253    }
254    
255    @Override
256    public boolean equals(Object other) {
257        if(this == other)
258            return true;
259        
260        if(!hasIdentity())
261            return false;
262        
263        if(other instanceof  VendorValue that) {
264            if(!that.hasIdentity())
265                return false;
266            
267            Long thisEntityId = getEntityId();
268            Long thatEntityId = that.getEntityId();
269            
270            boolean objectsEqual = thisEntityId.equals(thatEntityId);
271            if(objectsEqual)
272                objectsEqual = isIdentical(that);
273            
274            return objectsEqual;
275        } else {
276            return false;
277        }
278    }
279    
280    public boolean isIdentical(Object other) {
281        if(other instanceof VendorValue that) {
282            boolean objectsEqual = true;
283            
284            
285            if(objectsEqual) {
286                PartyPK thisPartyPK = getPartyPK();
287                PartyPK thatPartyPK = that.getPartyPK();
288                
289                if(thisPartyPK == null) {
290                    objectsEqual = objectsEqual && (thatPartyPK == null);
291                } else {
292                    objectsEqual = objectsEqual && thisPartyPK.equals(thatPartyPK);
293                }
294            }
295            
296            if(objectsEqual) {
297                String thisVendorName = getVendorName();
298                String thatVendorName = that.getVendorName();
299                
300                if(thisVendorName == null) {
301                    objectsEqual = objectsEqual && (thatVendorName == null);
302                } else {
303                    objectsEqual = objectsEqual && thisVendorName.equals(thatVendorName);
304                }
305            }
306            
307            if(objectsEqual) {
308                VendorTypePK thisVendorTypePK = getVendorTypePK();
309                VendorTypePK thatVendorTypePK = that.getVendorTypePK();
310                
311                if(thisVendorTypePK == null) {
312                    objectsEqual = objectsEqual && (thatVendorTypePK == null);
313                } else {
314                    objectsEqual = objectsEqual && thisVendorTypePK.equals(thatVendorTypePK);
315                }
316            }
317            
318            if(objectsEqual) {
319                Integer thisMinimumPurchaseOrderLines = getMinimumPurchaseOrderLines();
320                Integer thatMinimumPurchaseOrderLines = that.getMinimumPurchaseOrderLines();
321                
322                if(thisMinimumPurchaseOrderLines == null) {
323                    objectsEqual = objectsEqual && (thatMinimumPurchaseOrderLines == null);
324                } else {
325                    objectsEqual = objectsEqual && thisMinimumPurchaseOrderLines.equals(thatMinimumPurchaseOrderLines);
326                }
327            }
328            
329            if(objectsEqual) {
330                Integer thisMaximumPurchaseOrderLines = getMaximumPurchaseOrderLines();
331                Integer thatMaximumPurchaseOrderLines = that.getMaximumPurchaseOrderLines();
332                
333                if(thisMaximumPurchaseOrderLines == null) {
334                    objectsEqual = objectsEqual && (thatMaximumPurchaseOrderLines == null);
335                } else {
336                    objectsEqual = objectsEqual && thisMaximumPurchaseOrderLines.equals(thatMaximumPurchaseOrderLines);
337                }
338            }
339            
340            if(objectsEqual) {
341                Long thisMinimumPurchaseOrderAmount = getMinimumPurchaseOrderAmount();
342                Long thatMinimumPurchaseOrderAmount = that.getMinimumPurchaseOrderAmount();
343                
344                if(thisMinimumPurchaseOrderAmount == null) {
345                    objectsEqual = objectsEqual && (thatMinimumPurchaseOrderAmount == null);
346                } else {
347                    objectsEqual = objectsEqual && thisMinimumPurchaseOrderAmount.equals(thatMinimumPurchaseOrderAmount);
348                }
349            }
350            
351            if(objectsEqual) {
352                Long thisMaximumPurchaseOrderAmount = getMaximumPurchaseOrderAmount();
353                Long thatMaximumPurchaseOrderAmount = that.getMaximumPurchaseOrderAmount();
354                
355                if(thisMaximumPurchaseOrderAmount == null) {
356                    objectsEqual = objectsEqual && (thatMaximumPurchaseOrderAmount == null);
357                } else {
358                    objectsEqual = objectsEqual && thisMaximumPurchaseOrderAmount.equals(thatMaximumPurchaseOrderAmount);
359                }
360            }
361            
362            if(objectsEqual) {
363                Boolean thisUseItemPurchasingCategories = getUseItemPurchasingCategories();
364                Boolean thatUseItemPurchasingCategories = that.getUseItemPurchasingCategories();
365                
366                if(thisUseItemPurchasingCategories == null) {
367                    objectsEqual = objectsEqual && (thatUseItemPurchasingCategories == null);
368                } else {
369                    objectsEqual = objectsEqual && thisUseItemPurchasingCategories.equals(thatUseItemPurchasingCategories);
370                }
371            }
372            
373            if(objectsEqual) {
374                ItemAliasTypePK thisDefaultItemAliasTypePK = getDefaultItemAliasTypePK();
375                ItemAliasTypePK thatDefaultItemAliasTypePK = that.getDefaultItemAliasTypePK();
376                
377                if(thisDefaultItemAliasTypePK == null) {
378                    objectsEqual = objectsEqual && (thatDefaultItemAliasTypePK == null);
379                } else {
380                    objectsEqual = objectsEqual && thisDefaultItemAliasTypePK.equals(thatDefaultItemAliasTypePK);
381                }
382            }
383            
384            if(objectsEqual) {
385                CancellationPolicyPK thisCancellationPolicyPK = getCancellationPolicyPK();
386                CancellationPolicyPK thatCancellationPolicyPK = that.getCancellationPolicyPK();
387                
388                if(thisCancellationPolicyPK == null) {
389                    objectsEqual = objectsEqual && (thatCancellationPolicyPK == null);
390                } else {
391                    objectsEqual = objectsEqual && thisCancellationPolicyPK.equals(thatCancellationPolicyPK);
392                }
393            }
394            
395            if(objectsEqual) {
396                ReturnPolicyPK thisReturnPolicyPK = getReturnPolicyPK();
397                ReturnPolicyPK thatReturnPolicyPK = that.getReturnPolicyPK();
398                
399                if(thisReturnPolicyPK == null) {
400                    objectsEqual = objectsEqual && (thatReturnPolicyPK == null);
401                } else {
402                    objectsEqual = objectsEqual && thisReturnPolicyPK.equals(thatReturnPolicyPK);
403                }
404            }
405            
406            if(objectsEqual) {
407                GlAccountPK thisApGlAccountPK = getApGlAccountPK();
408                GlAccountPK thatApGlAccountPK = that.getApGlAccountPK();
409                
410                if(thisApGlAccountPK == null) {
411                    objectsEqual = objectsEqual && (thatApGlAccountPK == null);
412                } else {
413                    objectsEqual = objectsEqual && thisApGlAccountPK.equals(thatApGlAccountPK);
414                }
415            }
416            
417            if(objectsEqual) {
418                Boolean thisHoldUntilComplete = getHoldUntilComplete();
419                Boolean thatHoldUntilComplete = that.getHoldUntilComplete();
420                
421                if(thisHoldUntilComplete == null) {
422                    objectsEqual = objectsEqual && (thatHoldUntilComplete == null);
423                } else {
424                    objectsEqual = objectsEqual && thisHoldUntilComplete.equals(thatHoldUntilComplete);
425                }
426            }
427            
428            if(objectsEqual) {
429                Boolean thisAllowBackorders = getAllowBackorders();
430                Boolean thatAllowBackorders = that.getAllowBackorders();
431                
432                if(thisAllowBackorders == null) {
433                    objectsEqual = objectsEqual && (thatAllowBackorders == null);
434                } else {
435                    objectsEqual = objectsEqual && thisAllowBackorders.equals(thatAllowBackorders);
436                }
437            }
438            
439            if(objectsEqual) {
440                Boolean thisAllowSubstitutions = getAllowSubstitutions();
441                Boolean thatAllowSubstitutions = that.getAllowSubstitutions();
442                
443                if(thisAllowSubstitutions == null) {
444                    objectsEqual = objectsEqual && (thatAllowSubstitutions == null);
445                } else {
446                    objectsEqual = objectsEqual && thisAllowSubstitutions.equals(thatAllowSubstitutions);
447                }
448            }
449            
450            if(objectsEqual) {
451                Boolean thisAllowCombiningShipments = getAllowCombiningShipments();
452                Boolean thatAllowCombiningShipments = that.getAllowCombiningShipments();
453                
454                if(thisAllowCombiningShipments == null) {
455                    objectsEqual = objectsEqual && (thatAllowCombiningShipments == null);
456                } else {
457                    objectsEqual = objectsEqual && thisAllowCombiningShipments.equals(thatAllowCombiningShipments);
458                }
459            }
460            
461            if(objectsEqual) {
462                Boolean thisRequireReference = getRequireReference();
463                Boolean thatRequireReference = that.getRequireReference();
464                
465                if(thisRequireReference == null) {
466                    objectsEqual = objectsEqual && (thatRequireReference == null);
467                } else {
468                    objectsEqual = objectsEqual && thisRequireReference.equals(thatRequireReference);
469                }
470            }
471            
472            if(objectsEqual) {
473                Boolean thisAllowReferenceDuplicates = getAllowReferenceDuplicates();
474                Boolean thatAllowReferenceDuplicates = that.getAllowReferenceDuplicates();
475                
476                if(thisAllowReferenceDuplicates == null) {
477                    objectsEqual = objectsEqual && (thatAllowReferenceDuplicates == null);
478                } else {
479                    objectsEqual = objectsEqual && thisAllowReferenceDuplicates.equals(thatAllowReferenceDuplicates);
480                }
481            }
482            
483            if(objectsEqual) {
484                String thisReferenceValidationPattern = getReferenceValidationPattern();
485                String thatReferenceValidationPattern = that.getReferenceValidationPattern();
486                
487                if(thisReferenceValidationPattern == null) {
488                    objectsEqual = objectsEqual && (thatReferenceValidationPattern == null);
489                } else {
490                    objectsEqual = objectsEqual && thisReferenceValidationPattern.equals(thatReferenceValidationPattern);
491                }
492            }
493            
494            if(objectsEqual) {
495                SelectorPK thisVendorItemSelectorPK = getVendorItemSelectorPK();
496                SelectorPK thatVendorItemSelectorPK = that.getVendorItemSelectorPK();
497                
498                if(thisVendorItemSelectorPK == null) {
499                    objectsEqual = objectsEqual && (thatVendorItemSelectorPK == null);
500                } else {
501                    objectsEqual = objectsEqual && thisVendorItemSelectorPK.equals(thatVendorItemSelectorPK);
502                }
503            }
504            
505            if(objectsEqual) {
506                FilterPK thisVendorItemCostFilterPK = getVendorItemCostFilterPK();
507                FilterPK thatVendorItemCostFilterPK = that.getVendorItemCostFilterPK();
508                
509                if(thisVendorItemCostFilterPK == null) {
510                    objectsEqual = objectsEqual && (thatVendorItemCostFilterPK == null);
511                } else {
512                    objectsEqual = objectsEqual && thisVendorItemCostFilterPK.equals(thatVendorItemCostFilterPK);
513                }
514            }
515            
516            if(objectsEqual) {
517                Long thisFromTime = getFromTime();
518                Long thatFromTime = that.getFromTime();
519                
520                if(thisFromTime == null) {
521                    objectsEqual = objectsEqual && (thatFromTime == null);
522                } else {
523                    objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime);
524                }
525            }
526            
527            if(objectsEqual) {
528                Long thisThruTime = getThruTime();
529                Long thatThruTime = that.getThruTime();
530                
531                if(thisThruTime == null) {
532                    objectsEqual = objectsEqual && (thatThruTime == null);
533                } else {
534                    objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime);
535                }
536            }
537            
538            return objectsEqual;
539        } else {
540            return false;
541        }
542    }
543    
544    @Override
545    public boolean hasBeenModified() {
546        return partyPKHasBeenModified || vendorNameHasBeenModified || vendorTypePKHasBeenModified || minimumPurchaseOrderLinesHasBeenModified || maximumPurchaseOrderLinesHasBeenModified || minimumPurchaseOrderAmountHasBeenModified || maximumPurchaseOrderAmountHasBeenModified || useItemPurchasingCategoriesHasBeenModified || defaultItemAliasTypePKHasBeenModified || cancellationPolicyPKHasBeenModified || returnPolicyPKHasBeenModified || apGlAccountPKHasBeenModified || holdUntilCompleteHasBeenModified || allowBackordersHasBeenModified || allowSubstitutionsHasBeenModified || allowCombiningShipmentsHasBeenModified || requireReferenceHasBeenModified || allowReferenceDuplicatesHasBeenModified || referenceValidationPatternHasBeenModified || vendorItemSelectorPKHasBeenModified || vendorItemCostFilterPKHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified;
547    }
548    
549    @Override
550    public void clearHasBeenModified() {
551        partyPKHasBeenModified = false;
552        vendorNameHasBeenModified = false;
553        vendorTypePKHasBeenModified = false;
554        minimumPurchaseOrderLinesHasBeenModified = false;
555        maximumPurchaseOrderLinesHasBeenModified = false;
556        minimumPurchaseOrderAmountHasBeenModified = false;
557        maximumPurchaseOrderAmountHasBeenModified = false;
558        useItemPurchasingCategoriesHasBeenModified = false;
559        defaultItemAliasTypePKHasBeenModified = false;
560        cancellationPolicyPKHasBeenModified = false;
561        returnPolicyPKHasBeenModified = false;
562        apGlAccountPKHasBeenModified = false;
563        holdUntilCompleteHasBeenModified = false;
564        allowBackordersHasBeenModified = false;
565        allowSubstitutionsHasBeenModified = false;
566        allowCombiningShipmentsHasBeenModified = false;
567        requireReferenceHasBeenModified = false;
568        allowReferenceDuplicatesHasBeenModified = false;
569        referenceValidationPatternHasBeenModified = false;
570        vendorItemSelectorPKHasBeenModified = false;
571        vendorItemCostFilterPKHasBeenModified = false;
572        fromTimeHasBeenModified = false;
573        thruTimeHasBeenModified = false;
574    }
575    
576    public PartyPK getPartyPK() {
577        return partyPK;
578    }
579    
580    public void setPartyPK(PartyPK partyPK)
581            throws PersistenceNotNullException {
582        checkForNull(partyPK);
583        
584        boolean update = true;
585        
586        if(this.partyPK != null) {
587            if(this.partyPK.equals(partyPK)) {
588                update = false;
589            }
590        } else if(partyPK == null) {
591            update = false;
592        }
593        
594        if(update) {
595            this.partyPK = partyPK;
596            partyPKHasBeenModified = true;
597            clearHashAndString();
598        }
599    }
600    
601    public boolean getPartyPKHasBeenModified() {
602        return partyPKHasBeenModified;
603    }
604    
605    public String getVendorName() {
606        return vendorName;
607    }
608    
609    public void setVendorName(String vendorName)
610            throws PersistenceNotNullException {
611        checkForNull(vendorName);
612        
613        boolean update = true;
614        
615        if(this.vendorName != null) {
616            if(this.vendorName.equals(vendorName)) {
617                update = false;
618            }
619        } else if(vendorName == null) {
620            update = false;
621        }
622        
623        if(update) {
624            this.vendorName = vendorName;
625            vendorNameHasBeenModified = true;
626            clearHashAndString();
627        }
628    }
629    
630    public boolean getVendorNameHasBeenModified() {
631        return vendorNameHasBeenModified;
632    }
633    
634    public VendorTypePK getVendorTypePK() {
635        return vendorTypePK;
636    }
637    
638    public void setVendorTypePK(VendorTypePK vendorTypePK)
639            throws PersistenceNotNullException {
640        checkForNull(vendorTypePK);
641        
642        boolean update = true;
643        
644        if(this.vendorTypePK != null) {
645            if(this.vendorTypePK.equals(vendorTypePK)) {
646                update = false;
647            }
648        } else if(vendorTypePK == null) {
649            update = false;
650        }
651        
652        if(update) {
653            this.vendorTypePK = vendorTypePK;
654            vendorTypePKHasBeenModified = true;
655            clearHashAndString();
656        }
657    }
658    
659    public boolean getVendorTypePKHasBeenModified() {
660        return vendorTypePKHasBeenModified;
661    }
662    
663    public Integer getMinimumPurchaseOrderLines() {
664        return minimumPurchaseOrderLines;
665    }
666    
667    public void setMinimumPurchaseOrderLines(Integer minimumPurchaseOrderLines) {
668        boolean update = true;
669        
670        if(this.minimumPurchaseOrderLines != null) {
671            if(this.minimumPurchaseOrderLines.equals(minimumPurchaseOrderLines)) {
672                update = false;
673            }
674        } else if(minimumPurchaseOrderLines == null) {
675            update = false;
676        }
677        
678        if(update) {
679            this.minimumPurchaseOrderLines = minimumPurchaseOrderLines;
680            minimumPurchaseOrderLinesHasBeenModified = true;
681            clearHashAndString();
682        }
683    }
684    
685    public boolean getMinimumPurchaseOrderLinesHasBeenModified() {
686        return minimumPurchaseOrderLinesHasBeenModified;
687    }
688    
689    public Integer getMaximumPurchaseOrderLines() {
690        return maximumPurchaseOrderLines;
691    }
692    
693    public void setMaximumPurchaseOrderLines(Integer maximumPurchaseOrderLines) {
694        boolean update = true;
695        
696        if(this.maximumPurchaseOrderLines != null) {
697            if(this.maximumPurchaseOrderLines.equals(maximumPurchaseOrderLines)) {
698                update = false;
699            }
700        } else if(maximumPurchaseOrderLines == null) {
701            update = false;
702        }
703        
704        if(update) {
705            this.maximumPurchaseOrderLines = maximumPurchaseOrderLines;
706            maximumPurchaseOrderLinesHasBeenModified = true;
707            clearHashAndString();
708        }
709    }
710    
711    public boolean getMaximumPurchaseOrderLinesHasBeenModified() {
712        return maximumPurchaseOrderLinesHasBeenModified;
713    }
714    
715    public Long getMinimumPurchaseOrderAmount() {
716        return minimumPurchaseOrderAmount;
717    }
718    
719    public void setMinimumPurchaseOrderAmount(Long minimumPurchaseOrderAmount) {
720        boolean update = true;
721        
722        if(this.minimumPurchaseOrderAmount != null) {
723            if(this.minimumPurchaseOrderAmount.equals(minimumPurchaseOrderAmount)) {
724                update = false;
725            }
726        } else if(minimumPurchaseOrderAmount == null) {
727            update = false;
728        }
729        
730        if(update) {
731            this.minimumPurchaseOrderAmount = minimumPurchaseOrderAmount;
732            minimumPurchaseOrderAmountHasBeenModified = true;
733            clearHashAndString();
734        }
735    }
736    
737    public boolean getMinimumPurchaseOrderAmountHasBeenModified() {
738        return minimumPurchaseOrderAmountHasBeenModified;
739    }
740    
741    public Long getMaximumPurchaseOrderAmount() {
742        return maximumPurchaseOrderAmount;
743    }
744    
745    public void setMaximumPurchaseOrderAmount(Long maximumPurchaseOrderAmount) {
746        boolean update = true;
747        
748        if(this.maximumPurchaseOrderAmount != null) {
749            if(this.maximumPurchaseOrderAmount.equals(maximumPurchaseOrderAmount)) {
750                update = false;
751            }
752        } else if(maximumPurchaseOrderAmount == null) {
753            update = false;
754        }
755        
756        if(update) {
757            this.maximumPurchaseOrderAmount = maximumPurchaseOrderAmount;
758            maximumPurchaseOrderAmountHasBeenModified = true;
759            clearHashAndString();
760        }
761    }
762    
763    public boolean getMaximumPurchaseOrderAmountHasBeenModified() {
764        return maximumPurchaseOrderAmountHasBeenModified;
765    }
766    
767    public Boolean getUseItemPurchasingCategories() {
768        return useItemPurchasingCategories;
769    }
770    
771    public void setUseItemPurchasingCategories(Boolean useItemPurchasingCategories)
772            throws PersistenceNotNullException {
773        checkForNull(useItemPurchasingCategories);
774        
775        boolean update = true;
776        
777        if(this.useItemPurchasingCategories != null) {
778            if(this.useItemPurchasingCategories.equals(useItemPurchasingCategories)) {
779                update = false;
780            }
781        } else if(useItemPurchasingCategories == null) {
782            update = false;
783        }
784        
785        if(update) {
786            this.useItemPurchasingCategories = useItemPurchasingCategories;
787            useItemPurchasingCategoriesHasBeenModified = true;
788            clearHashAndString();
789        }
790    }
791    
792    public boolean getUseItemPurchasingCategoriesHasBeenModified() {
793        return useItemPurchasingCategoriesHasBeenModified;
794    }
795    
796    public ItemAliasTypePK getDefaultItemAliasTypePK() {
797        return defaultItemAliasTypePK;
798    }
799    
800    public void setDefaultItemAliasTypePK(ItemAliasTypePK defaultItemAliasTypePK) {
801        boolean update = true;
802        
803        if(this.defaultItemAliasTypePK != null) {
804            if(this.defaultItemAliasTypePK.equals(defaultItemAliasTypePK)) {
805                update = false;
806            }
807        } else if(defaultItemAliasTypePK == null) {
808            update = false;
809        }
810        
811        if(update) {
812            this.defaultItemAliasTypePK = defaultItemAliasTypePK;
813            defaultItemAliasTypePKHasBeenModified = true;
814            clearHashAndString();
815        }
816    }
817    
818    public boolean getDefaultItemAliasTypePKHasBeenModified() {
819        return defaultItemAliasTypePKHasBeenModified;
820    }
821    
822    public CancellationPolicyPK getCancellationPolicyPK() {
823        return cancellationPolicyPK;
824    }
825    
826    public void setCancellationPolicyPK(CancellationPolicyPK cancellationPolicyPK) {
827        boolean update = true;
828        
829        if(this.cancellationPolicyPK != null) {
830            if(this.cancellationPolicyPK.equals(cancellationPolicyPK)) {
831                update = false;
832            }
833        } else if(cancellationPolicyPK == null) {
834            update = false;
835        }
836        
837        if(update) {
838            this.cancellationPolicyPK = cancellationPolicyPK;
839            cancellationPolicyPKHasBeenModified = true;
840            clearHashAndString();
841        }
842    }
843    
844    public boolean getCancellationPolicyPKHasBeenModified() {
845        return cancellationPolicyPKHasBeenModified;
846    }
847    
848    public ReturnPolicyPK getReturnPolicyPK() {
849        return returnPolicyPK;
850    }
851    
852    public void setReturnPolicyPK(ReturnPolicyPK returnPolicyPK) {
853        boolean update = true;
854        
855        if(this.returnPolicyPK != null) {
856            if(this.returnPolicyPK.equals(returnPolicyPK)) {
857                update = false;
858            }
859        } else if(returnPolicyPK == null) {
860            update = false;
861        }
862        
863        if(update) {
864            this.returnPolicyPK = returnPolicyPK;
865            returnPolicyPKHasBeenModified = true;
866            clearHashAndString();
867        }
868    }
869    
870    public boolean getReturnPolicyPKHasBeenModified() {
871        return returnPolicyPKHasBeenModified;
872    }
873    
874    public GlAccountPK getApGlAccountPK() {
875        return apGlAccountPK;
876    }
877    
878    public void setApGlAccountPK(GlAccountPK apGlAccountPK) {
879        boolean update = true;
880        
881        if(this.apGlAccountPK != null) {
882            if(this.apGlAccountPK.equals(apGlAccountPK)) {
883                update = false;
884            }
885        } else if(apGlAccountPK == null) {
886            update = false;
887        }
888        
889        if(update) {
890            this.apGlAccountPK = apGlAccountPK;
891            apGlAccountPKHasBeenModified = true;
892            clearHashAndString();
893        }
894    }
895    
896    public boolean getApGlAccountPKHasBeenModified() {
897        return apGlAccountPKHasBeenModified;
898    }
899    
900    public Boolean getHoldUntilComplete() {
901        return holdUntilComplete;
902    }
903    
904    public void setHoldUntilComplete(Boolean holdUntilComplete)
905            throws PersistenceNotNullException {
906        checkForNull(holdUntilComplete);
907        
908        boolean update = true;
909        
910        if(this.holdUntilComplete != null) {
911            if(this.holdUntilComplete.equals(holdUntilComplete)) {
912                update = false;
913            }
914        } else if(holdUntilComplete == null) {
915            update = false;
916        }
917        
918        if(update) {
919            this.holdUntilComplete = holdUntilComplete;
920            holdUntilCompleteHasBeenModified = true;
921            clearHashAndString();
922        }
923    }
924    
925    public boolean getHoldUntilCompleteHasBeenModified() {
926        return holdUntilCompleteHasBeenModified;
927    }
928    
929    public Boolean getAllowBackorders() {
930        return allowBackorders;
931    }
932    
933    public void setAllowBackorders(Boolean allowBackorders)
934            throws PersistenceNotNullException {
935        checkForNull(allowBackorders);
936        
937        boolean update = true;
938        
939        if(this.allowBackorders != null) {
940            if(this.allowBackorders.equals(allowBackorders)) {
941                update = false;
942            }
943        } else if(allowBackorders == null) {
944            update = false;
945        }
946        
947        if(update) {
948            this.allowBackorders = allowBackorders;
949            allowBackordersHasBeenModified = true;
950            clearHashAndString();
951        }
952    }
953    
954    public boolean getAllowBackordersHasBeenModified() {
955        return allowBackordersHasBeenModified;
956    }
957    
958    public Boolean getAllowSubstitutions() {
959        return allowSubstitutions;
960    }
961    
962    public void setAllowSubstitutions(Boolean allowSubstitutions)
963            throws PersistenceNotNullException {
964        checkForNull(allowSubstitutions);
965        
966        boolean update = true;
967        
968        if(this.allowSubstitutions != null) {
969            if(this.allowSubstitutions.equals(allowSubstitutions)) {
970                update = false;
971            }
972        } else if(allowSubstitutions == null) {
973            update = false;
974        }
975        
976        if(update) {
977            this.allowSubstitutions = allowSubstitutions;
978            allowSubstitutionsHasBeenModified = true;
979            clearHashAndString();
980        }
981    }
982    
983    public boolean getAllowSubstitutionsHasBeenModified() {
984        return allowSubstitutionsHasBeenModified;
985    }
986    
987    public Boolean getAllowCombiningShipments() {
988        return allowCombiningShipments;
989    }
990    
991    public void setAllowCombiningShipments(Boolean allowCombiningShipments)
992            throws PersistenceNotNullException {
993        checkForNull(allowCombiningShipments);
994        
995        boolean update = true;
996        
997        if(this.allowCombiningShipments != null) {
998            if(this.allowCombiningShipments.equals(allowCombiningShipments)) {
999                update = false;
1000            }
1001        } else if(allowCombiningShipments == null) {
1002            update = false;
1003        }
1004        
1005        if(update) {
1006            this.allowCombiningShipments = allowCombiningShipments;
1007            allowCombiningShipmentsHasBeenModified = true;
1008            clearHashAndString();
1009        }
1010    }
1011    
1012    public boolean getAllowCombiningShipmentsHasBeenModified() {
1013        return allowCombiningShipmentsHasBeenModified;
1014    }
1015    
1016    public Boolean getRequireReference() {
1017        return requireReference;
1018    }
1019    
1020    public void setRequireReference(Boolean requireReference)
1021            throws PersistenceNotNullException {
1022        checkForNull(requireReference);
1023        
1024        boolean update = true;
1025        
1026        if(this.requireReference != null) {
1027            if(this.requireReference.equals(requireReference)) {
1028                update = false;
1029            }
1030        } else if(requireReference == null) {
1031            update = false;
1032        }
1033        
1034        if(update) {
1035            this.requireReference = requireReference;
1036            requireReferenceHasBeenModified = true;
1037            clearHashAndString();
1038        }
1039    }
1040    
1041    public boolean getRequireReferenceHasBeenModified() {
1042        return requireReferenceHasBeenModified;
1043    }
1044    
1045    public Boolean getAllowReferenceDuplicates() {
1046        return allowReferenceDuplicates;
1047    }
1048    
1049    public void setAllowReferenceDuplicates(Boolean allowReferenceDuplicates)
1050            throws PersistenceNotNullException {
1051        checkForNull(allowReferenceDuplicates);
1052        
1053        boolean update = true;
1054        
1055        if(this.allowReferenceDuplicates != null) {
1056            if(this.allowReferenceDuplicates.equals(allowReferenceDuplicates)) {
1057                update = false;
1058            }
1059        } else if(allowReferenceDuplicates == null) {
1060            update = false;
1061        }
1062        
1063        if(update) {
1064            this.allowReferenceDuplicates = allowReferenceDuplicates;
1065            allowReferenceDuplicatesHasBeenModified = true;
1066            clearHashAndString();
1067        }
1068    }
1069    
1070    public boolean getAllowReferenceDuplicatesHasBeenModified() {
1071        return allowReferenceDuplicatesHasBeenModified;
1072    }
1073    
1074    public String getReferenceValidationPattern() {
1075        return referenceValidationPattern;
1076    }
1077    
1078    public void setReferenceValidationPattern(String referenceValidationPattern) {
1079        boolean update = true;
1080        
1081        if(this.referenceValidationPattern != null) {
1082            if(this.referenceValidationPattern.equals(referenceValidationPattern)) {
1083                update = false;
1084            }
1085        } else if(referenceValidationPattern == null) {
1086            update = false;
1087        }
1088        
1089        if(update) {
1090            this.referenceValidationPattern = referenceValidationPattern;
1091            referenceValidationPatternHasBeenModified = true;
1092            clearHashAndString();
1093        }
1094    }
1095    
1096    public boolean getReferenceValidationPatternHasBeenModified() {
1097        return referenceValidationPatternHasBeenModified;
1098    }
1099    
1100    public SelectorPK getVendorItemSelectorPK() {
1101        return vendorItemSelectorPK;
1102    }
1103    
1104    public void setVendorItemSelectorPK(SelectorPK vendorItemSelectorPK) {
1105        boolean update = true;
1106        
1107        if(this.vendorItemSelectorPK != null) {
1108            if(this.vendorItemSelectorPK.equals(vendorItemSelectorPK)) {
1109                update = false;
1110            }
1111        } else if(vendorItemSelectorPK == null) {
1112            update = false;
1113        }
1114        
1115        if(update) {
1116            this.vendorItemSelectorPK = vendorItemSelectorPK;
1117            vendorItemSelectorPKHasBeenModified = true;
1118            clearHashAndString();
1119        }
1120    }
1121    
1122    public boolean getVendorItemSelectorPKHasBeenModified() {
1123        return vendorItemSelectorPKHasBeenModified;
1124    }
1125    
1126    public FilterPK getVendorItemCostFilterPK() {
1127        return vendorItemCostFilterPK;
1128    }
1129    
1130    public void setVendorItemCostFilterPK(FilterPK vendorItemCostFilterPK) {
1131        boolean update = true;
1132        
1133        if(this.vendorItemCostFilterPK != null) {
1134            if(this.vendorItemCostFilterPK.equals(vendorItemCostFilterPK)) {
1135                update = false;
1136            }
1137        } else if(vendorItemCostFilterPK == null) {
1138            update = false;
1139        }
1140        
1141        if(update) {
1142            this.vendorItemCostFilterPK = vendorItemCostFilterPK;
1143            vendorItemCostFilterPKHasBeenModified = true;
1144            clearHashAndString();
1145        }
1146    }
1147    
1148    public boolean getVendorItemCostFilterPKHasBeenModified() {
1149        return vendorItemCostFilterPKHasBeenModified;
1150    }
1151    
1152    public Long getFromTime() {
1153        return fromTime;
1154    }
1155    
1156    public void setFromTime(Long fromTime)
1157            throws PersistenceNotNullException {
1158        checkForNull(fromTime);
1159        
1160        boolean update = true;
1161        
1162        if(this.fromTime != null) {
1163            if(this.fromTime.equals(fromTime)) {
1164                update = false;
1165            }
1166        } else if(fromTime == null) {
1167            update = false;
1168        }
1169        
1170        if(update) {
1171            this.fromTime = fromTime;
1172            fromTimeHasBeenModified = true;
1173            clearHashAndString();
1174        }
1175    }
1176    
1177    public boolean getFromTimeHasBeenModified() {
1178        return fromTimeHasBeenModified;
1179    }
1180    
1181    public Long getThruTime() {
1182        return thruTime;
1183    }
1184    
1185    public void setThruTime(Long thruTime)
1186            throws PersistenceNotNullException {
1187        checkForNull(thruTime);
1188        
1189        boolean update = true;
1190        
1191        if(this.thruTime != null) {
1192            if(this.thruTime.equals(thruTime)) {
1193                update = false;
1194            }
1195        } else if(thruTime == null) {
1196            update = false;
1197        }
1198        
1199        if(update) {
1200            this.thruTime = thruTime;
1201            thruTimeHasBeenModified = true;
1202            clearHashAndString();
1203        }
1204    }
1205    
1206    public boolean getThruTimeHasBeenModified() {
1207        return thruTimeHasBeenModified;
1208    }
1209    
1210}