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 * 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(Session session) 111 throws PersistenceDatabaseException { 112 getBaseFactoryInstance().store(session, this); 113 } 114 115 @Override 116 public void remove(Session session) 117 throws PersistenceDatabaseException { 118 getBaseFactoryInstance().remove(session, this); 119 } 120 121 @Override 122 public void remove() 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 125 } 126 127 public CurrencyValue getCurrencyValue() { 128 return _value; 129 } 130 131 public void setCurrencyValue(CurrencyValue value) 132 throws PersistenceReadOnlyException { 133 checkReadWrite(); 134 _value = value; 135 } 136 137 @Override 138 public CurrencyPK getPrimaryKey() { 139 return _pk; 140 } 141 142 public String getCurrencyIsoName() { 143 return _value.getCurrencyIsoName(); 144 } 145 146 public void setCurrencyIsoName(String currencyIsoName) 147 throws PersistenceNotNullException, PersistenceReadOnlyException { 148 checkReadWrite(); 149 _value.setCurrencyIsoName(currencyIsoName); 150 } 151 152 public boolean getCurrencyIsoNameHasBeenModified() { 153 return _value.getCurrencyIsoNameHasBeenModified(); 154 } 155 156 public String getSymbol() { 157 return _value.getSymbol(); 158 } 159 160 public void setSymbol(String symbol) 161 throws PersistenceNotNullException, PersistenceReadOnlyException { 162 checkReadWrite(); 163 _value.setSymbol(symbol); 164 } 165 166 public boolean getSymbolHasBeenModified() { 167 return _value.getSymbolHasBeenModified(); 168 } 169 170 public SymbolPositionPK getSymbolPositionPK() { 171 return _value.getSymbolPositionPK(); 172 } 173 174 public SymbolPosition getSymbolPosition(Session session, EntityPermission entityPermission) { 175 return SymbolPositionFactory.getInstance().getEntityFromPK(session, entityPermission, getSymbolPositionPK()); 176 } 177 178 public SymbolPosition getSymbolPosition(EntityPermission entityPermission) { 179 return getSymbolPosition(ThreadSession.currentSession(), entityPermission); 180 } 181 182 public SymbolPosition getSymbolPosition(Session session) { 183 return getSymbolPosition(session, EntityPermission.READ_ONLY); 184 } 185 186 public SymbolPosition getSymbolPosition() { 187 return getSymbolPosition(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 188 } 189 190 public SymbolPosition getSymbolPositionForUpdate(Session session) { 191 return getSymbolPosition(session, EntityPermission.READ_WRITE); 192 } 193 194 public SymbolPosition getSymbolPositionForUpdate() { 195 return getSymbolPosition(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 196 } 197 198 public void setSymbolPositionPK(SymbolPositionPK symbolPositionPK) 199 throws PersistenceNotNullException, PersistenceReadOnlyException { 200 checkReadWrite(); 201 _value.setSymbolPositionPK(symbolPositionPK); 202 } 203 204 public void setSymbolPosition(SymbolPosition entity) { 205 setSymbolPositionPK(entity == null? null: entity.getPrimaryKey()); 206 } 207 208 public boolean getSymbolPositionPKHasBeenModified() { 209 return _value.getSymbolPositionPKHasBeenModified(); 210 } 211 212 public Boolean getSymbolOnListStart() { 213 return _value.getSymbolOnListStart(); 214 } 215 216 public void setSymbolOnListStart(Boolean symbolOnListStart) 217 throws PersistenceNotNullException, PersistenceReadOnlyException { 218 checkReadWrite(); 219 _value.setSymbolOnListStart(symbolOnListStart); 220 } 221 222 public boolean getSymbolOnListStartHasBeenModified() { 223 return _value.getSymbolOnListStartHasBeenModified(); 224 } 225 226 public Boolean getSymbolOnListMember() { 227 return _value.getSymbolOnListMember(); 228 } 229 230 public void setSymbolOnListMember(Boolean symbolOnListMember) 231 throws PersistenceNotNullException, PersistenceReadOnlyException { 232 checkReadWrite(); 233 _value.setSymbolOnListMember(symbolOnListMember); 234 } 235 236 public boolean getSymbolOnListMemberHasBeenModified() { 237 return _value.getSymbolOnListMemberHasBeenModified(); 238 } 239 240 public Boolean getSymbolOnSubtotal() { 241 return _value.getSymbolOnSubtotal(); 242 } 243 244 public void setSymbolOnSubtotal(Boolean symbolOnSubtotal) 245 throws PersistenceNotNullException, PersistenceReadOnlyException { 246 checkReadWrite(); 247 _value.setSymbolOnSubtotal(symbolOnSubtotal); 248 } 249 250 public boolean getSymbolOnSubtotalHasBeenModified() { 251 return _value.getSymbolOnSubtotalHasBeenModified(); 252 } 253 254 public Boolean getSymbolOnTotal() { 255 return _value.getSymbolOnTotal(); 256 } 257 258 public void setSymbolOnTotal(Boolean symbolOnTotal) 259 throws PersistenceNotNullException, PersistenceReadOnlyException { 260 checkReadWrite(); 261 _value.setSymbolOnTotal(symbolOnTotal); 262 } 263 264 public boolean getSymbolOnTotalHasBeenModified() { 265 return _value.getSymbolOnTotalHasBeenModified(); 266 } 267 268 public String getGroupingSeparator() { 269 return _value.getGroupingSeparator(); 270 } 271 272 public void setGroupingSeparator(String groupingSeparator) 273 throws PersistenceNotNullException, PersistenceReadOnlyException { 274 checkReadWrite(); 275 _value.setGroupingSeparator(groupingSeparator); 276 } 277 278 public boolean getGroupingSeparatorHasBeenModified() { 279 return _value.getGroupingSeparatorHasBeenModified(); 280 } 281 282 public Integer getGroupingSize() { 283 return _value.getGroupingSize(); 284 } 285 286 public void setGroupingSize(Integer groupingSize) 287 throws PersistenceNotNullException, PersistenceReadOnlyException { 288 checkReadWrite(); 289 _value.setGroupingSize(groupingSize); 290 } 291 292 public boolean getGroupingSizeHasBeenModified() { 293 return _value.getGroupingSizeHasBeenModified(); 294 } 295 296 public String getFractionSeparator() { 297 return _value.getFractionSeparator(); 298 } 299 300 public void setFractionSeparator(String fractionSeparator) 301 throws PersistenceNotNullException, PersistenceReadOnlyException { 302 checkReadWrite(); 303 _value.setFractionSeparator(fractionSeparator); 304 } 305 306 public boolean getFractionSeparatorHasBeenModified() { 307 return _value.getFractionSeparatorHasBeenModified(); 308 } 309 310 public Integer getDefaultFractionDigits() { 311 return _value.getDefaultFractionDigits(); 312 } 313 314 public void setDefaultFractionDigits(Integer defaultFractionDigits) 315 throws PersistenceNotNullException, PersistenceReadOnlyException { 316 checkReadWrite(); 317 _value.setDefaultFractionDigits(defaultFractionDigits); 318 } 319 320 public boolean getDefaultFractionDigitsHasBeenModified() { 321 return _value.getDefaultFractionDigitsHasBeenModified(); 322 } 323 324 public Integer getPriceUnitFractionDigits() { 325 return _value.getPriceUnitFractionDigits(); 326 } 327 328 public void setPriceUnitFractionDigits(Integer priceUnitFractionDigits) 329 throws PersistenceNotNullException, PersistenceReadOnlyException { 330 checkReadWrite(); 331 _value.setPriceUnitFractionDigits(priceUnitFractionDigits); 332 } 333 334 public boolean getPriceUnitFractionDigitsHasBeenModified() { 335 return _value.getPriceUnitFractionDigitsHasBeenModified(); 336 } 337 338 public Integer getPriceLineFractionDigits() { 339 return _value.getPriceLineFractionDigits(); 340 } 341 342 public void setPriceLineFractionDigits(Integer priceLineFractionDigits) 343 throws PersistenceNotNullException, PersistenceReadOnlyException { 344 checkReadWrite(); 345 _value.setPriceLineFractionDigits(priceLineFractionDigits); 346 } 347 348 public boolean getPriceLineFractionDigitsHasBeenModified() { 349 return _value.getPriceLineFractionDigitsHasBeenModified(); 350 } 351 352 public Integer getCostUnitFractionDigits() { 353 return _value.getCostUnitFractionDigits(); 354 } 355 356 public void setCostUnitFractionDigits(Integer costUnitFractionDigits) 357 throws PersistenceNotNullException, PersistenceReadOnlyException { 358 checkReadWrite(); 359 _value.setCostUnitFractionDigits(costUnitFractionDigits); 360 } 361 362 public boolean getCostUnitFractionDigitsHasBeenModified() { 363 return _value.getCostUnitFractionDigitsHasBeenModified(); 364 } 365 366 public Integer getCostLineFractionDigits() { 367 return _value.getCostLineFractionDigits(); 368 } 369 370 public void setCostLineFractionDigits(Integer costLineFractionDigits) 371 throws PersistenceNotNullException, PersistenceReadOnlyException { 372 checkReadWrite(); 373 _value.setCostLineFractionDigits(costLineFractionDigits); 374 } 375 376 public boolean getCostLineFractionDigitsHasBeenModified() { 377 return _value.getCostLineFractionDigitsHasBeenModified(); 378 } 379 380 public String getMinusSign() { 381 return _value.getMinusSign(); 382 } 383 384 public void setMinusSign(String minusSign) 385 throws PersistenceNotNullException, PersistenceReadOnlyException { 386 checkReadWrite(); 387 _value.setMinusSign(minusSign); 388 } 389 390 public boolean getMinusSignHasBeenModified() { 391 return _value.getMinusSignHasBeenModified(); 392 } 393 394 public Boolean getIsDefault() { 395 return _value.getIsDefault(); 396 } 397 398 public void setIsDefault(Boolean isDefault) 399 throws PersistenceNotNullException, PersistenceReadOnlyException { 400 checkReadWrite(); 401 _value.setIsDefault(isDefault); 402 } 403 404 public boolean getIsDefaultHasBeenModified() { 405 return _value.getIsDefaultHasBeenModified(); 406 } 407 408 public Integer getSortOrder() { 409 return _value.getSortOrder(); 410 } 411 412 public void setSortOrder(Integer sortOrder) 413 throws PersistenceNotNullException, PersistenceReadOnlyException { 414 checkReadWrite(); 415 _value.setSortOrder(sortOrder); 416 } 417 418 public boolean getSortOrderHasBeenModified() { 419 return _value.getSortOrderHasBeenModified(); 420 } 421 422}