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 * Currency.java
021 */
022
023package com.echothree.model.data.accounting.server.entity;
024
025import com.echothree.model.data.accounting.common.pk.CurrencyPK;
026
027import com.echothree.model.data.accounting.common.pk.SymbolPositionPK;
028
029import com.echothree.model.data.accounting.server.entity.SymbolPosition;
030
031import com.echothree.model.data.accounting.server.factory.SymbolPositionFactory;
032
033import com.echothree.model.data.accounting.common.pk.CurrencyPK;
034
035import com.echothree.model.data.accounting.server.value.CurrencyValue;
036
037import com.echothree.model.data.accounting.server.factory.CurrencyFactory;
038
039import com.echothree.util.common.exception.PersistenceException;
040import com.echothree.util.common.exception.PersistenceDatabaseException;
041import com.echothree.util.common.exception.PersistenceNotNullException;
042import com.echothree.util.common.exception.PersistenceReadOnlyException;
043
044import com.echothree.util.common.persistence.BasePK;
045
046import com.echothree.util.common.persistence.type.ByteArray;
047
048import com.echothree.util.server.persistence.BaseEntity;
049import com.echothree.util.server.persistence.EntityPermission;
050import com.echothree.util.server.persistence.Session;
051import com.echothree.util.server.persistence.ThreadSession;
052
053import java.io.Serializable;
054
055public class Currency
056        extends BaseEntity
057        implements Serializable {
058    
059    private CurrencyPK _pk;
060    private CurrencyValue _value;
061    
062    /** Creates a new instance of Currency */
063    public Currency()
064            throws PersistenceException {
065        super();
066    }
067    
068    /** Creates a new instance of Currency */
069    public Currency(CurrencyValue value, EntityPermission entityPermission) {
070        super(entityPermission);
071        
072        _value = value;
073        _pk = value.getPrimaryKey();
074    }
075    
076    @Override
077    public CurrencyFactory getBaseFactoryInstance() {
078        return CurrencyFactory.getInstance();
079    }
080    
081    @Override
082    public boolean hasBeenModified() {
083        return _value.hasBeenModified();
084    }
085    
086    @Override
087    public int hashCode() {
088        return _pk.hashCode();
089    }
090    
091    @Override
092    public String toString() {
093        return _pk.toString();
094    }
095    
096    @Override
097    public boolean equals(Object other) {
098        if(this == other)
099            return true;
100        
101        if(other instanceof Currency that) {
102            CurrencyValue thatValue = that.getCurrencyValue();
103            return _value.equals(thatValue);
104        } else {
105            return false;
106        }
107    }
108    
109    @Override
110    public void store()
111            throws PersistenceDatabaseException {
112        getBaseFactoryInstance().store(this);
113    }
114    
115    @Override
116    public void remove()
117            throws PersistenceDatabaseException {
118        getBaseFactoryInstance().remove(this);
119    }
120    
121    public CurrencyValue getCurrencyValue() {
122        return _value;
123    }
124    
125    public void setCurrencyValue(CurrencyValue value)
126            throws PersistenceReadOnlyException {
127        checkReadWrite();
128        _value = value;
129    }
130    
131    @Override
132    public CurrencyPK getPrimaryKey() {
133        return _pk;
134    }
135    
136    public String getCurrencyIsoName() {
137        return _value.getCurrencyIsoName();
138    }
139    
140    public void setCurrencyIsoName(String currencyIsoName)
141            throws PersistenceNotNullException, PersistenceReadOnlyException {
142        checkReadWrite();
143        _value.setCurrencyIsoName(currencyIsoName);
144    }
145    
146    public boolean getCurrencyIsoNameHasBeenModified() {
147        return _value.getCurrencyIsoNameHasBeenModified();
148    }
149    
150    public String getSymbol() {
151        return _value.getSymbol();
152    }
153    
154    public void setSymbol(String symbol)
155            throws PersistenceNotNullException, PersistenceReadOnlyException {
156        checkReadWrite();
157        _value.setSymbol(symbol);
158    }
159    
160    public boolean getSymbolHasBeenModified() {
161        return _value.getSymbolHasBeenModified();
162    }
163    
164    public SymbolPositionPK getSymbolPositionPK() {
165        return _value.getSymbolPositionPK();
166    }
167    
168    public SymbolPosition getSymbolPosition(EntityPermission entityPermission) {
169        return SymbolPositionFactory.getInstance().getEntityFromPK(entityPermission, getSymbolPositionPK());
170    }
171    
172    public SymbolPosition getSymbolPosition() {
173        return getSymbolPosition(EntityPermission.READ_ONLY);
174    }
175    
176    public SymbolPosition getSymbolPositionForUpdate() {
177        return getSymbolPosition(EntityPermission.READ_WRITE);
178    }
179    
180    public void setSymbolPositionPK(SymbolPositionPK symbolPositionPK)
181            throws PersistenceNotNullException, PersistenceReadOnlyException {
182        checkReadWrite();
183        _value.setSymbolPositionPK(symbolPositionPK);
184    }
185    
186    public void setSymbolPosition(SymbolPosition entity) {
187        setSymbolPositionPK(entity == null? null: entity.getPrimaryKey());
188    }
189    
190    public boolean getSymbolPositionPKHasBeenModified() {
191        return _value.getSymbolPositionPKHasBeenModified();
192    }
193    
194    public Boolean getSymbolOnListStart() {
195        return _value.getSymbolOnListStart();
196    }
197    
198    public void setSymbolOnListStart(Boolean symbolOnListStart)
199            throws PersistenceNotNullException, PersistenceReadOnlyException {
200        checkReadWrite();
201        _value.setSymbolOnListStart(symbolOnListStart);
202    }
203    
204    public boolean getSymbolOnListStartHasBeenModified() {
205        return _value.getSymbolOnListStartHasBeenModified();
206    }
207    
208    public Boolean getSymbolOnListMember() {
209        return _value.getSymbolOnListMember();
210    }
211    
212    public void setSymbolOnListMember(Boolean symbolOnListMember)
213            throws PersistenceNotNullException, PersistenceReadOnlyException {
214        checkReadWrite();
215        _value.setSymbolOnListMember(symbolOnListMember);
216    }
217    
218    public boolean getSymbolOnListMemberHasBeenModified() {
219        return _value.getSymbolOnListMemberHasBeenModified();
220    }
221    
222    public Boolean getSymbolOnSubtotal() {
223        return _value.getSymbolOnSubtotal();
224    }
225    
226    public void setSymbolOnSubtotal(Boolean symbolOnSubtotal)
227            throws PersistenceNotNullException, PersistenceReadOnlyException {
228        checkReadWrite();
229        _value.setSymbolOnSubtotal(symbolOnSubtotal);
230    }
231    
232    public boolean getSymbolOnSubtotalHasBeenModified() {
233        return _value.getSymbolOnSubtotalHasBeenModified();
234    }
235    
236    public Boolean getSymbolOnTotal() {
237        return _value.getSymbolOnTotal();
238    }
239    
240    public void setSymbolOnTotal(Boolean symbolOnTotal)
241            throws PersistenceNotNullException, PersistenceReadOnlyException {
242        checkReadWrite();
243        _value.setSymbolOnTotal(symbolOnTotal);
244    }
245    
246    public boolean getSymbolOnTotalHasBeenModified() {
247        return _value.getSymbolOnTotalHasBeenModified();
248    }
249    
250    public String getGroupingSeparator() {
251        return _value.getGroupingSeparator();
252    }
253    
254    public void setGroupingSeparator(String groupingSeparator)
255            throws PersistenceNotNullException, PersistenceReadOnlyException {
256        checkReadWrite();
257        _value.setGroupingSeparator(groupingSeparator);
258    }
259    
260    public boolean getGroupingSeparatorHasBeenModified() {
261        return _value.getGroupingSeparatorHasBeenModified();
262    }
263    
264    public Integer getGroupingSize() {
265        return _value.getGroupingSize();
266    }
267    
268    public void setGroupingSize(Integer groupingSize)
269            throws PersistenceNotNullException, PersistenceReadOnlyException {
270        checkReadWrite();
271        _value.setGroupingSize(groupingSize);
272    }
273    
274    public boolean getGroupingSizeHasBeenModified() {
275        return _value.getGroupingSizeHasBeenModified();
276    }
277    
278    public String getFractionSeparator() {
279        return _value.getFractionSeparator();
280    }
281    
282    public void setFractionSeparator(String fractionSeparator)
283            throws PersistenceNotNullException, PersistenceReadOnlyException {
284        checkReadWrite();
285        _value.setFractionSeparator(fractionSeparator);
286    }
287    
288    public boolean getFractionSeparatorHasBeenModified() {
289        return _value.getFractionSeparatorHasBeenModified();
290    }
291    
292    public Integer getDefaultFractionDigits() {
293        return _value.getDefaultFractionDigits();
294    }
295    
296    public void setDefaultFractionDigits(Integer defaultFractionDigits)
297            throws PersistenceNotNullException, PersistenceReadOnlyException {
298        checkReadWrite();
299        _value.setDefaultFractionDigits(defaultFractionDigits);
300    }
301    
302    public boolean getDefaultFractionDigitsHasBeenModified() {
303        return _value.getDefaultFractionDigitsHasBeenModified();
304    }
305    
306    public Integer getPriceUnitFractionDigits() {
307        return _value.getPriceUnitFractionDigits();
308    }
309    
310    public void setPriceUnitFractionDigits(Integer priceUnitFractionDigits)
311            throws PersistenceNotNullException, PersistenceReadOnlyException {
312        checkReadWrite();
313        _value.setPriceUnitFractionDigits(priceUnitFractionDigits);
314    }
315    
316    public boolean getPriceUnitFractionDigitsHasBeenModified() {
317        return _value.getPriceUnitFractionDigitsHasBeenModified();
318    }
319    
320    public Integer getPriceLineFractionDigits() {
321        return _value.getPriceLineFractionDigits();
322    }
323    
324    public void setPriceLineFractionDigits(Integer priceLineFractionDigits)
325            throws PersistenceNotNullException, PersistenceReadOnlyException {
326        checkReadWrite();
327        _value.setPriceLineFractionDigits(priceLineFractionDigits);
328    }
329    
330    public boolean getPriceLineFractionDigitsHasBeenModified() {
331        return _value.getPriceLineFractionDigitsHasBeenModified();
332    }
333    
334    public Integer getCostUnitFractionDigits() {
335        return _value.getCostUnitFractionDigits();
336    }
337    
338    public void setCostUnitFractionDigits(Integer costUnitFractionDigits)
339            throws PersistenceNotNullException, PersistenceReadOnlyException {
340        checkReadWrite();
341        _value.setCostUnitFractionDigits(costUnitFractionDigits);
342    }
343    
344    public boolean getCostUnitFractionDigitsHasBeenModified() {
345        return _value.getCostUnitFractionDigitsHasBeenModified();
346    }
347    
348    public Integer getCostLineFractionDigits() {
349        return _value.getCostLineFractionDigits();
350    }
351    
352    public void setCostLineFractionDigits(Integer costLineFractionDigits)
353            throws PersistenceNotNullException, PersistenceReadOnlyException {
354        checkReadWrite();
355        _value.setCostLineFractionDigits(costLineFractionDigits);
356    }
357    
358    public boolean getCostLineFractionDigitsHasBeenModified() {
359        return _value.getCostLineFractionDigitsHasBeenModified();
360    }
361    
362    public String getMinusSign() {
363        return _value.getMinusSign();
364    }
365    
366    public void setMinusSign(String minusSign)
367            throws PersistenceNotNullException, PersistenceReadOnlyException {
368        checkReadWrite();
369        _value.setMinusSign(minusSign);
370    }
371    
372    public boolean getMinusSignHasBeenModified() {
373        return _value.getMinusSignHasBeenModified();
374    }
375    
376    public Boolean getIsDefault() {
377        return _value.getIsDefault();
378    }
379    
380    public void setIsDefault(Boolean isDefault)
381            throws PersistenceNotNullException, PersistenceReadOnlyException {
382        checkReadWrite();
383        _value.setIsDefault(isDefault);
384    }
385    
386    public boolean getIsDefaultHasBeenModified() {
387        return _value.getIsDefaultHasBeenModified();
388    }
389    
390    public Integer getSortOrder() {
391        return _value.getSortOrder();
392    }
393    
394    public void setSortOrder(Integer sortOrder)
395            throws PersistenceNotNullException, PersistenceReadOnlyException {
396        checkReadWrite();
397        _value.setSortOrder(sortOrder);
398    }
399    
400    public boolean getSortOrderHasBeenModified() {
401        return _value.getSortOrderHasBeenModified();
402    }
403    
404}