001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 Echo Three, LLC 003// 004// Licensed under the Apache License, Version 2.0 (the "License"); 005// you may not use this file except in compliance with the License. 006// You may obtain a copy of the License at 007// 008// http://www.apache.org/licenses/LICENSE-2.0 009// 010// Unless required by applicable law or agreed to in writing, software 011// distributed under the License is distributed on an "AS IS" BASIS, 012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013// See the License for the specific language governing permissions and 014// limitations under the License. 015// -------------------------------------------------------------------------------- 016// Generated File -- DO NOT EDIT BY HAND 017// -------------------------------------------------------------------------------- 018 019/** 020 * TransactionGlEntry.java 021 */ 022 023package com.echothree.model.data.accounting.server.entity; 024 025import com.echothree.model.data.accounting.common.pk.TransactionGlEntryPK; 026 027import com.echothree.model.data.accounting.common.pk.TransactionPK; 028import com.echothree.model.data.party.common.pk.PartyPK; 029import com.echothree.model.data.accounting.common.pk.TransactionGlAccountCategoryPK; 030import com.echothree.model.data.accounting.common.pk.GlAccountPK; 031import com.echothree.model.data.accounting.common.pk.CurrencyPK; 032 033import com.echothree.model.data.accounting.server.entity.Transaction; 034import com.echothree.model.data.party.server.entity.Party; 035import com.echothree.model.data.accounting.server.entity.TransactionGlAccountCategory; 036import com.echothree.model.data.accounting.server.entity.GlAccount; 037import com.echothree.model.data.accounting.server.entity.Currency; 038 039import com.echothree.model.data.accounting.server.factory.TransactionFactory; 040import com.echothree.model.data.party.server.factory.PartyFactory; 041import com.echothree.model.data.accounting.server.factory.TransactionGlAccountCategoryFactory; 042import com.echothree.model.data.accounting.server.factory.GlAccountFactory; 043import com.echothree.model.data.accounting.server.factory.CurrencyFactory; 044 045import com.echothree.model.data.accounting.common.pk.TransactionGlEntryPK; 046 047import com.echothree.model.data.accounting.server.value.TransactionGlEntryValue; 048 049import com.echothree.model.data.accounting.server.factory.TransactionGlEntryFactory; 050 051import com.echothree.util.common.exception.PersistenceException; 052import com.echothree.util.common.exception.PersistenceDatabaseException; 053import com.echothree.util.common.exception.PersistenceNotNullException; 054import com.echothree.util.common.exception.PersistenceReadOnlyException; 055 056import com.echothree.util.common.persistence.BasePK; 057 058import com.echothree.util.common.persistence.type.ByteArray; 059 060import com.echothree.util.server.persistence.BaseEntity; 061import com.echothree.util.server.persistence.EntityPermission; 062import com.echothree.util.server.persistence.Session; 063import com.echothree.util.server.persistence.ThreadSession; 064 065import java.io.Serializable; 066 067public class TransactionGlEntry 068 extends BaseEntity 069 implements Serializable { 070 071 private TransactionGlEntryPK _pk; 072 private TransactionGlEntryValue _value; 073 074 /** Creates a new instance of TransactionGlEntry */ 075 public TransactionGlEntry() 076 throws PersistenceException { 077 super(); 078 } 079 080 /** Creates a new instance of TransactionGlEntry */ 081 public TransactionGlEntry(TransactionGlEntryValue value, EntityPermission entityPermission) { 082 super(entityPermission); 083 084 _value = value; 085 _pk = value.getPrimaryKey(); 086 } 087 088 @Override 089 public TransactionGlEntryFactory getBaseFactoryInstance() { 090 return TransactionGlEntryFactory.getInstance(); 091 } 092 093 @Override 094 public boolean hasBeenModified() { 095 return _value.hasBeenModified(); 096 } 097 098 @Override 099 public int hashCode() { 100 return _pk.hashCode(); 101 } 102 103 @Override 104 public String toString() { 105 return _pk.toString(); 106 } 107 108 @Override 109 public boolean equals(Object other) { 110 if(this == other) 111 return true; 112 113 if(other instanceof TransactionGlEntry) { 114 TransactionGlEntry that = (TransactionGlEntry)other; 115 116 TransactionGlEntryValue thatValue = that.getTransactionGlEntryValue(); 117 return _value.equals(thatValue); 118 } else { 119 return false; 120 } 121 } 122 123 @Override 124 public void store(Session session) 125 throws PersistenceDatabaseException { 126 getBaseFactoryInstance().store(session, this); 127 } 128 129 @Override 130 public void remove(Session session) 131 throws PersistenceDatabaseException { 132 getBaseFactoryInstance().remove(session, this); 133 } 134 135 @Override 136 public void remove() 137 throws PersistenceDatabaseException { 138 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 139 } 140 141 public TransactionGlEntryValue getTransactionGlEntryValue() { 142 return _value; 143 } 144 145 public void setTransactionGlEntryValue(TransactionGlEntryValue value) 146 throws PersistenceReadOnlyException { 147 checkReadWrite(); 148 _value = value; 149 } 150 151 @Override 152 public TransactionGlEntryPK getPrimaryKey() { 153 return _pk; 154 } 155 156 public TransactionPK getTransactionPK() { 157 return _value.getTransactionPK(); 158 } 159 160 public Transaction getTransaction(Session session, EntityPermission entityPermission) { 161 return TransactionFactory.getInstance().getEntityFromPK(session, entityPermission, getTransactionPK()); 162 } 163 164 public Transaction getTransaction(EntityPermission entityPermission) { 165 return getTransaction(ThreadSession.currentSession(), entityPermission); 166 } 167 168 public Transaction getTransaction(Session session) { 169 return getTransaction(session, EntityPermission.READ_ONLY); 170 } 171 172 public Transaction getTransaction() { 173 return getTransaction(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 174 } 175 176 public Transaction getTransactionForUpdate(Session session) { 177 return getTransaction(session, EntityPermission.READ_WRITE); 178 } 179 180 public Transaction getTransactionForUpdate() { 181 return getTransaction(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 182 } 183 184 public void setTransactionPK(TransactionPK transactionPK) 185 throws PersistenceNotNullException, PersistenceReadOnlyException { 186 checkReadWrite(); 187 _value.setTransactionPK(transactionPK); 188 } 189 190 public void setTransaction(Transaction entity) { 191 setTransactionPK(entity == null? null: entity.getPrimaryKey()); 192 } 193 194 public boolean getTransactionPKHasBeenModified() { 195 return _value.getTransactionPKHasBeenModified(); 196 } 197 198 public Integer getTransactionGlEntrySequence() { 199 return _value.getTransactionGlEntrySequence(); 200 } 201 202 public void setTransactionGlEntrySequence(Integer transactionGlEntrySequence) 203 throws PersistenceNotNullException, PersistenceReadOnlyException { 204 checkReadWrite(); 205 _value.setTransactionGlEntrySequence(transactionGlEntrySequence); 206 } 207 208 public boolean getTransactionGlEntrySequenceHasBeenModified() { 209 return _value.getTransactionGlEntrySequenceHasBeenModified(); 210 } 211 212 public TransactionGlEntryPK getParentTransactionGlEntryPK() { 213 return _value.getParentTransactionGlEntryPK(); 214 } 215 216 public TransactionGlEntry getParentTransactionGlEntry(Session session, EntityPermission entityPermission) { 217 TransactionGlEntryPK pk = getParentTransactionGlEntryPK(); 218 TransactionGlEntry entity = pk == null? null: TransactionGlEntryFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 219 220 return entity; 221 } 222 223 public TransactionGlEntry getParentTransactionGlEntry(EntityPermission entityPermission) { 224 return getParentTransactionGlEntry(ThreadSession.currentSession(), entityPermission); 225 } 226 227 public TransactionGlEntry getParentTransactionGlEntry(Session session) { 228 return getParentTransactionGlEntry(session, EntityPermission.READ_ONLY); 229 } 230 231 public TransactionGlEntry getParentTransactionGlEntry() { 232 return getParentTransactionGlEntry(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 233 } 234 235 public TransactionGlEntry getParentTransactionGlEntryForUpdate(Session session) { 236 return getParentTransactionGlEntry(session, EntityPermission.READ_WRITE); 237 } 238 239 public TransactionGlEntry getParentTransactionGlEntryForUpdate() { 240 return getParentTransactionGlEntry(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 241 } 242 243 public void setParentTransactionGlEntryPK(TransactionGlEntryPK parentTransactionGlEntryPK) 244 throws PersistenceNotNullException, PersistenceReadOnlyException { 245 checkReadWrite(); 246 _value.setParentTransactionGlEntryPK(parentTransactionGlEntryPK); 247 } 248 249 public void setParentTransactionGlEntry(TransactionGlEntry entity) { 250 setParentTransactionGlEntryPK(entity == null? null: entity.getPrimaryKey()); 251 } 252 253 public boolean getParentTransactionGlEntryPKHasBeenModified() { 254 return _value.getParentTransactionGlEntryPKHasBeenModified(); 255 } 256 257 public PartyPK getGroupPartyPK() { 258 return _value.getGroupPartyPK(); 259 } 260 261 public Party getGroupParty(Session session, EntityPermission entityPermission) { 262 return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getGroupPartyPK()); 263 } 264 265 public Party getGroupParty(EntityPermission entityPermission) { 266 return getGroupParty(ThreadSession.currentSession(), entityPermission); 267 } 268 269 public Party getGroupParty(Session session) { 270 return getGroupParty(session, EntityPermission.READ_ONLY); 271 } 272 273 public Party getGroupParty() { 274 return getGroupParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 275 } 276 277 public Party getGroupPartyForUpdate(Session session) { 278 return getGroupParty(session, EntityPermission.READ_WRITE); 279 } 280 281 public Party getGroupPartyForUpdate() { 282 return getGroupParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 283 } 284 285 public void setGroupPartyPK(PartyPK groupPartyPK) 286 throws PersistenceNotNullException, PersistenceReadOnlyException { 287 checkReadWrite(); 288 _value.setGroupPartyPK(groupPartyPK); 289 } 290 291 public void setGroupParty(Party entity) { 292 setGroupPartyPK(entity == null? null: entity.getPrimaryKey()); 293 } 294 295 public boolean getGroupPartyPKHasBeenModified() { 296 return _value.getGroupPartyPKHasBeenModified(); 297 } 298 299 public TransactionGlAccountCategoryPK getTransactionGlAccountCategoryPK() { 300 return _value.getTransactionGlAccountCategoryPK(); 301 } 302 303 public TransactionGlAccountCategory getTransactionGlAccountCategory(Session session, EntityPermission entityPermission) { 304 TransactionGlAccountCategoryPK pk = getTransactionGlAccountCategoryPK(); 305 TransactionGlAccountCategory entity = pk == null? null: TransactionGlAccountCategoryFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 306 307 return entity; 308 } 309 310 public TransactionGlAccountCategory getTransactionGlAccountCategory(EntityPermission entityPermission) { 311 return getTransactionGlAccountCategory(ThreadSession.currentSession(), entityPermission); 312 } 313 314 public TransactionGlAccountCategory getTransactionGlAccountCategory(Session session) { 315 return getTransactionGlAccountCategory(session, EntityPermission.READ_ONLY); 316 } 317 318 public TransactionGlAccountCategory getTransactionGlAccountCategory() { 319 return getTransactionGlAccountCategory(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 320 } 321 322 public TransactionGlAccountCategory getTransactionGlAccountCategoryForUpdate(Session session) { 323 return getTransactionGlAccountCategory(session, EntityPermission.READ_WRITE); 324 } 325 326 public TransactionGlAccountCategory getTransactionGlAccountCategoryForUpdate() { 327 return getTransactionGlAccountCategory(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 328 } 329 330 public void setTransactionGlAccountCategoryPK(TransactionGlAccountCategoryPK transactionGlAccountCategoryPK) 331 throws PersistenceNotNullException, PersistenceReadOnlyException { 332 checkReadWrite(); 333 _value.setTransactionGlAccountCategoryPK(transactionGlAccountCategoryPK); 334 } 335 336 public void setTransactionGlAccountCategory(TransactionGlAccountCategory entity) { 337 setTransactionGlAccountCategoryPK(entity == null? null: entity.getPrimaryKey()); 338 } 339 340 public boolean getTransactionGlAccountCategoryPKHasBeenModified() { 341 return _value.getTransactionGlAccountCategoryPKHasBeenModified(); 342 } 343 344 public GlAccountPK getGlAccountPK() { 345 return _value.getGlAccountPK(); 346 } 347 348 public GlAccount getGlAccount(Session session, EntityPermission entityPermission) { 349 return GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, getGlAccountPK()); 350 } 351 352 public GlAccount getGlAccount(EntityPermission entityPermission) { 353 return getGlAccount(ThreadSession.currentSession(), entityPermission); 354 } 355 356 public GlAccount getGlAccount(Session session) { 357 return getGlAccount(session, EntityPermission.READ_ONLY); 358 } 359 360 public GlAccount getGlAccount() { 361 return getGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 362 } 363 364 public GlAccount getGlAccountForUpdate(Session session) { 365 return getGlAccount(session, EntityPermission.READ_WRITE); 366 } 367 368 public GlAccount getGlAccountForUpdate() { 369 return getGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 370 } 371 372 public void setGlAccountPK(GlAccountPK glAccountPK) 373 throws PersistenceNotNullException, PersistenceReadOnlyException { 374 checkReadWrite(); 375 _value.setGlAccountPK(glAccountPK); 376 } 377 378 public void setGlAccount(GlAccount entity) { 379 setGlAccountPK(entity == null? null: entity.getPrimaryKey()); 380 } 381 382 public boolean getGlAccountPKHasBeenModified() { 383 return _value.getGlAccountPKHasBeenModified(); 384 } 385 386 public CurrencyPK getOriginalCurrencyPK() { 387 return _value.getOriginalCurrencyPK(); 388 } 389 390 public Currency getOriginalCurrency(Session session, EntityPermission entityPermission) { 391 CurrencyPK pk = getOriginalCurrencyPK(); 392 Currency entity = pk == null? null: CurrencyFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 393 394 return entity; 395 } 396 397 public Currency getOriginalCurrency(EntityPermission entityPermission) { 398 return getOriginalCurrency(ThreadSession.currentSession(), entityPermission); 399 } 400 401 public Currency getOriginalCurrency(Session session) { 402 return getOriginalCurrency(session, EntityPermission.READ_ONLY); 403 } 404 405 public Currency getOriginalCurrency() { 406 return getOriginalCurrency(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 407 } 408 409 public Currency getOriginalCurrencyForUpdate(Session session) { 410 return getOriginalCurrency(session, EntityPermission.READ_WRITE); 411 } 412 413 public Currency getOriginalCurrencyForUpdate() { 414 return getOriginalCurrency(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 415 } 416 417 public void setOriginalCurrencyPK(CurrencyPK originalCurrencyPK) 418 throws PersistenceNotNullException, PersistenceReadOnlyException { 419 checkReadWrite(); 420 _value.setOriginalCurrencyPK(originalCurrencyPK); 421 } 422 423 public void setOriginalCurrency(Currency entity) { 424 setOriginalCurrencyPK(entity == null? null: entity.getPrimaryKey()); 425 } 426 427 public boolean getOriginalCurrencyPKHasBeenModified() { 428 return _value.getOriginalCurrencyPKHasBeenModified(); 429 } 430 431 public Long getOriginalAmount() { 432 return _value.getOriginalAmount(); 433 } 434 435 public void setOriginalAmount(Long originalAmount) 436 throws PersistenceNotNullException, PersistenceReadOnlyException { 437 checkReadWrite(); 438 _value.setOriginalAmount(originalAmount); 439 } 440 441 public boolean getOriginalAmountHasBeenModified() { 442 return _value.getOriginalAmountHasBeenModified(); 443 } 444 445 public Long getAmount() { 446 return _value.getAmount(); 447 } 448 449 public void setAmount(Long amount) 450 throws PersistenceNotNullException, PersistenceReadOnlyException { 451 checkReadWrite(); 452 _value.setAmount(amount); 453 } 454 455 public boolean getAmountHasBeenModified() { 456 return _value.getAmountHasBeenModified(); 457 } 458 459 public Long getFromTime() { 460 return _value.getFromTime(); 461 } 462 463 public void setFromTime(Long fromTime) 464 throws PersistenceNotNullException, PersistenceReadOnlyException { 465 checkReadWrite(); 466 _value.setFromTime(fromTime); 467 } 468 469 public boolean getFromTimeHasBeenModified() { 470 return _value.getFromTimeHasBeenModified(); 471 } 472 473 public Long getThruTime() { 474 return _value.getThruTime(); 475 } 476 477 public void setThruTime(Long thruTime) 478 throws PersistenceNotNullException, PersistenceReadOnlyException { 479 checkReadWrite(); 480 _value.setThruTime(thruTime); 481 } 482 483 public boolean getThruTimeHasBeenModified() { 484 return _value.getThruTimeHasBeenModified(); 485 } 486 487}