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 * GlAccountDetail.java 021 */ 022 023package com.echothree.model.data.accounting.server.entity; 024 025import com.echothree.model.data.accounting.common.pk.GlAccountDetailPK; 026 027import com.echothree.model.data.accounting.common.pk.GlAccountPK; 028import com.echothree.model.data.accounting.common.pk.GlAccountTypePK; 029import com.echothree.model.data.accounting.common.pk.GlAccountClassPK; 030import com.echothree.model.data.accounting.common.pk.GlAccountCategoryPK; 031import com.echothree.model.data.accounting.common.pk.GlResourceTypePK; 032import com.echothree.model.data.accounting.common.pk.CurrencyPK; 033 034import com.echothree.model.data.accounting.server.entity.GlAccount; 035import com.echothree.model.data.accounting.server.entity.GlAccountType; 036import com.echothree.model.data.accounting.server.entity.GlAccountClass; 037import com.echothree.model.data.accounting.server.entity.GlAccountCategory; 038import com.echothree.model.data.accounting.server.entity.GlResourceType; 039import com.echothree.model.data.accounting.server.entity.Currency; 040 041import com.echothree.model.data.accounting.server.factory.GlAccountFactory; 042import com.echothree.model.data.accounting.server.factory.GlAccountTypeFactory; 043import com.echothree.model.data.accounting.server.factory.GlAccountClassFactory; 044import com.echothree.model.data.accounting.server.factory.GlAccountCategoryFactory; 045import com.echothree.model.data.accounting.server.factory.GlResourceTypeFactory; 046import com.echothree.model.data.accounting.server.factory.CurrencyFactory; 047 048import com.echothree.model.data.accounting.common.pk.GlAccountDetailPK; 049 050import com.echothree.model.data.accounting.server.value.GlAccountDetailValue; 051 052import com.echothree.model.data.accounting.server.factory.GlAccountDetailFactory; 053 054import com.echothree.util.common.exception.PersistenceException; 055import com.echothree.util.common.exception.PersistenceDatabaseException; 056import com.echothree.util.common.exception.PersistenceNotNullException; 057import com.echothree.util.common.exception.PersistenceReadOnlyException; 058 059import com.echothree.util.common.persistence.BasePK; 060 061import com.echothree.util.common.persistence.type.ByteArray; 062 063import com.echothree.util.server.persistence.BaseEntity; 064import com.echothree.util.server.persistence.EntityPermission; 065import com.echothree.util.server.persistence.Session; 066import com.echothree.util.server.persistence.ThreadSession; 067 068import java.io.Serializable; 069 070public class GlAccountDetail 071 extends BaseEntity 072 implements Serializable { 073 074 private GlAccountDetailPK _pk; 075 private GlAccountDetailValue _value; 076 077 /** Creates a new instance of GlAccountDetail */ 078 public GlAccountDetail() 079 throws PersistenceException { 080 super(); 081 } 082 083 /** Creates a new instance of GlAccountDetail */ 084 public GlAccountDetail(GlAccountDetailValue value, EntityPermission entityPermission) { 085 super(entityPermission); 086 087 _value = value; 088 _pk = value.getPrimaryKey(); 089 } 090 091 @Override 092 public GlAccountDetailFactory getBaseFactoryInstance() { 093 return GlAccountDetailFactory.getInstance(); 094 } 095 096 @Override 097 public boolean hasBeenModified() { 098 return _value.hasBeenModified(); 099 } 100 101 @Override 102 public int hashCode() { 103 return _pk.hashCode(); 104 } 105 106 @Override 107 public String toString() { 108 return _pk.toString(); 109 } 110 111 @Override 112 public boolean equals(Object other) { 113 if(this == other) 114 return true; 115 116 if(other instanceof GlAccountDetail) { 117 GlAccountDetail that = (GlAccountDetail)other; 118 119 GlAccountDetailValue thatValue = that.getGlAccountDetailValue(); 120 return _value.equals(thatValue); 121 } else { 122 return false; 123 } 124 } 125 126 @Override 127 public void store(Session session) 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().store(session, this); 130 } 131 132 @Override 133 public void remove(Session session) 134 throws PersistenceDatabaseException { 135 getBaseFactoryInstance().remove(session, this); 136 } 137 138 @Override 139 public void remove() 140 throws PersistenceDatabaseException { 141 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 142 } 143 144 public GlAccountDetailValue getGlAccountDetailValue() { 145 return _value; 146 } 147 148 public void setGlAccountDetailValue(GlAccountDetailValue value) 149 throws PersistenceReadOnlyException { 150 checkReadWrite(); 151 _value = value; 152 } 153 154 @Override 155 public GlAccountDetailPK getPrimaryKey() { 156 return _pk; 157 } 158 159 public GlAccountPK getGlAccountPK() { 160 return _value.getGlAccountPK(); 161 } 162 163 public GlAccount getGlAccount(Session session, EntityPermission entityPermission) { 164 return GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, getGlAccountPK()); 165 } 166 167 public GlAccount getGlAccount(EntityPermission entityPermission) { 168 return getGlAccount(ThreadSession.currentSession(), entityPermission); 169 } 170 171 public GlAccount getGlAccount(Session session) { 172 return getGlAccount(session, EntityPermission.READ_ONLY); 173 } 174 175 public GlAccount getGlAccount() { 176 return getGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 177 } 178 179 public GlAccount getGlAccountForUpdate(Session session) { 180 return getGlAccount(session, EntityPermission.READ_WRITE); 181 } 182 183 public GlAccount getGlAccountForUpdate() { 184 return getGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 185 } 186 187 public void setGlAccountPK(GlAccountPK glAccountPK) 188 throws PersistenceNotNullException, PersistenceReadOnlyException { 189 checkReadWrite(); 190 _value.setGlAccountPK(glAccountPK); 191 } 192 193 public void setGlAccount(GlAccount entity) { 194 setGlAccountPK(entity == null? null: entity.getPrimaryKey()); 195 } 196 197 public boolean getGlAccountPKHasBeenModified() { 198 return _value.getGlAccountPKHasBeenModified(); 199 } 200 201 public String getGlAccountName() { 202 return _value.getGlAccountName(); 203 } 204 205 public void setGlAccountName(String glAccountName) 206 throws PersistenceNotNullException, PersistenceReadOnlyException { 207 checkReadWrite(); 208 _value.setGlAccountName(glAccountName); 209 } 210 211 public boolean getGlAccountNameHasBeenModified() { 212 return _value.getGlAccountNameHasBeenModified(); 213 } 214 215 public GlAccountPK getParentGlAccountPK() { 216 return _value.getParentGlAccountPK(); 217 } 218 219 public GlAccount getParentGlAccount(Session session, EntityPermission entityPermission) { 220 GlAccountPK pk = getParentGlAccountPK(); 221 GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 222 223 return entity; 224 } 225 226 public GlAccount getParentGlAccount(EntityPermission entityPermission) { 227 return getParentGlAccount(ThreadSession.currentSession(), entityPermission); 228 } 229 230 public GlAccount getParentGlAccount(Session session) { 231 return getParentGlAccount(session, EntityPermission.READ_ONLY); 232 } 233 234 public GlAccount getParentGlAccount() { 235 return getParentGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 236 } 237 238 public GlAccount getParentGlAccountForUpdate(Session session) { 239 return getParentGlAccount(session, EntityPermission.READ_WRITE); 240 } 241 242 public GlAccount getParentGlAccountForUpdate() { 243 return getParentGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 244 } 245 246 public void setParentGlAccountPK(GlAccountPK parentGlAccountPK) 247 throws PersistenceNotNullException, PersistenceReadOnlyException { 248 checkReadWrite(); 249 _value.setParentGlAccountPK(parentGlAccountPK); 250 } 251 252 public void setParentGlAccount(GlAccount entity) { 253 setParentGlAccountPK(entity == null? null: entity.getPrimaryKey()); 254 } 255 256 public boolean getParentGlAccountPKHasBeenModified() { 257 return _value.getParentGlAccountPKHasBeenModified(); 258 } 259 260 public GlAccountTypePK getGlAccountTypePK() { 261 return _value.getGlAccountTypePK(); 262 } 263 264 public GlAccountType getGlAccountType(Session session, EntityPermission entityPermission) { 265 return GlAccountTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getGlAccountTypePK()); 266 } 267 268 public GlAccountType getGlAccountType(EntityPermission entityPermission) { 269 return getGlAccountType(ThreadSession.currentSession(), entityPermission); 270 } 271 272 public GlAccountType getGlAccountType(Session session) { 273 return getGlAccountType(session, EntityPermission.READ_ONLY); 274 } 275 276 public GlAccountType getGlAccountType() { 277 return getGlAccountType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 278 } 279 280 public GlAccountType getGlAccountTypeForUpdate(Session session) { 281 return getGlAccountType(session, EntityPermission.READ_WRITE); 282 } 283 284 public GlAccountType getGlAccountTypeForUpdate() { 285 return getGlAccountType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 286 } 287 288 public void setGlAccountTypePK(GlAccountTypePK glAccountTypePK) 289 throws PersistenceNotNullException, PersistenceReadOnlyException { 290 checkReadWrite(); 291 _value.setGlAccountTypePK(glAccountTypePK); 292 } 293 294 public void setGlAccountType(GlAccountType entity) { 295 setGlAccountTypePK(entity == null? null: entity.getPrimaryKey()); 296 } 297 298 public boolean getGlAccountTypePKHasBeenModified() { 299 return _value.getGlAccountTypePKHasBeenModified(); 300 } 301 302 public GlAccountClassPK getGlAccountClassPK() { 303 return _value.getGlAccountClassPK(); 304 } 305 306 public GlAccountClass getGlAccountClass(Session session, EntityPermission entityPermission) { 307 return GlAccountClassFactory.getInstance().getEntityFromPK(session, entityPermission, getGlAccountClassPK()); 308 } 309 310 public GlAccountClass getGlAccountClass(EntityPermission entityPermission) { 311 return getGlAccountClass(ThreadSession.currentSession(), entityPermission); 312 } 313 314 public GlAccountClass getGlAccountClass(Session session) { 315 return getGlAccountClass(session, EntityPermission.READ_ONLY); 316 } 317 318 public GlAccountClass getGlAccountClass() { 319 return getGlAccountClass(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 320 } 321 322 public GlAccountClass getGlAccountClassForUpdate(Session session) { 323 return getGlAccountClass(session, EntityPermission.READ_WRITE); 324 } 325 326 public GlAccountClass getGlAccountClassForUpdate() { 327 return getGlAccountClass(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 328 } 329 330 public void setGlAccountClassPK(GlAccountClassPK glAccountClassPK) 331 throws PersistenceNotNullException, PersistenceReadOnlyException { 332 checkReadWrite(); 333 _value.setGlAccountClassPK(glAccountClassPK); 334 } 335 336 public void setGlAccountClass(GlAccountClass entity) { 337 setGlAccountClassPK(entity == null? null: entity.getPrimaryKey()); 338 } 339 340 public boolean getGlAccountClassPKHasBeenModified() { 341 return _value.getGlAccountClassPKHasBeenModified(); 342 } 343 344 public GlAccountCategoryPK getGlAccountCategoryPK() { 345 return _value.getGlAccountCategoryPK(); 346 } 347 348 public GlAccountCategory getGlAccountCategory(Session session, EntityPermission entityPermission) { 349 GlAccountCategoryPK pk = getGlAccountCategoryPK(); 350 GlAccountCategory entity = pk == null? null: GlAccountCategoryFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 351 352 return entity; 353 } 354 355 public GlAccountCategory getGlAccountCategory(EntityPermission entityPermission) { 356 return getGlAccountCategory(ThreadSession.currentSession(), entityPermission); 357 } 358 359 public GlAccountCategory getGlAccountCategory(Session session) { 360 return getGlAccountCategory(session, EntityPermission.READ_ONLY); 361 } 362 363 public GlAccountCategory getGlAccountCategory() { 364 return getGlAccountCategory(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 365 } 366 367 public GlAccountCategory getGlAccountCategoryForUpdate(Session session) { 368 return getGlAccountCategory(session, EntityPermission.READ_WRITE); 369 } 370 371 public GlAccountCategory getGlAccountCategoryForUpdate() { 372 return getGlAccountCategory(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 373 } 374 375 public void setGlAccountCategoryPK(GlAccountCategoryPK glAccountCategoryPK) 376 throws PersistenceNotNullException, PersistenceReadOnlyException { 377 checkReadWrite(); 378 _value.setGlAccountCategoryPK(glAccountCategoryPK); 379 } 380 381 public void setGlAccountCategory(GlAccountCategory entity) { 382 setGlAccountCategoryPK(entity == null? null: entity.getPrimaryKey()); 383 } 384 385 public boolean getGlAccountCategoryPKHasBeenModified() { 386 return _value.getGlAccountCategoryPKHasBeenModified(); 387 } 388 389 public GlResourceTypePK getGlResourceTypePK() { 390 return _value.getGlResourceTypePK(); 391 } 392 393 public GlResourceType getGlResourceType(Session session, EntityPermission entityPermission) { 394 return GlResourceTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getGlResourceTypePK()); 395 } 396 397 public GlResourceType getGlResourceType(EntityPermission entityPermission) { 398 return getGlResourceType(ThreadSession.currentSession(), entityPermission); 399 } 400 401 public GlResourceType getGlResourceType(Session session) { 402 return getGlResourceType(session, EntityPermission.READ_ONLY); 403 } 404 405 public GlResourceType getGlResourceType() { 406 return getGlResourceType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 407 } 408 409 public GlResourceType getGlResourceTypeForUpdate(Session session) { 410 return getGlResourceType(session, EntityPermission.READ_WRITE); 411 } 412 413 public GlResourceType getGlResourceTypeForUpdate() { 414 return getGlResourceType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 415 } 416 417 public void setGlResourceTypePK(GlResourceTypePK glResourceTypePK) 418 throws PersistenceNotNullException, PersistenceReadOnlyException { 419 checkReadWrite(); 420 _value.setGlResourceTypePK(glResourceTypePK); 421 } 422 423 public void setGlResourceType(GlResourceType entity) { 424 setGlResourceTypePK(entity == null? null: entity.getPrimaryKey()); 425 } 426 427 public boolean getGlResourceTypePKHasBeenModified() { 428 return _value.getGlResourceTypePKHasBeenModified(); 429 } 430 431 public CurrencyPK getCurrencyPK() { 432 return _value.getCurrencyPK(); 433 } 434 435 public Currency getCurrency(Session session, EntityPermission entityPermission) { 436 return CurrencyFactory.getInstance().getEntityFromPK(session, entityPermission, getCurrencyPK()); 437 } 438 439 public Currency getCurrency(EntityPermission entityPermission) { 440 return getCurrency(ThreadSession.currentSession(), entityPermission); 441 } 442 443 public Currency getCurrency(Session session) { 444 return getCurrency(session, EntityPermission.READ_ONLY); 445 } 446 447 public Currency getCurrency() { 448 return getCurrency(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 449 } 450 451 public Currency getCurrencyForUpdate(Session session) { 452 return getCurrency(session, EntityPermission.READ_WRITE); 453 } 454 455 public Currency getCurrencyForUpdate() { 456 return getCurrency(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 457 } 458 459 public void setCurrencyPK(CurrencyPK currencyPK) 460 throws PersistenceNotNullException, PersistenceReadOnlyException { 461 checkReadWrite(); 462 _value.setCurrencyPK(currencyPK); 463 } 464 465 public void setCurrency(Currency entity) { 466 setCurrencyPK(entity == null? null: entity.getPrimaryKey()); 467 } 468 469 public boolean getCurrencyPKHasBeenModified() { 470 return _value.getCurrencyPKHasBeenModified(); 471 } 472 473 public Boolean getIsDefault() { 474 return _value.getIsDefault(); 475 } 476 477 public void setIsDefault(Boolean isDefault) 478 throws PersistenceNotNullException, PersistenceReadOnlyException { 479 checkReadWrite(); 480 _value.setIsDefault(isDefault); 481 } 482 483 public boolean getIsDefaultHasBeenModified() { 484 return _value.getIsDefaultHasBeenModified(); 485 } 486 487 public Long getFromTime() { 488 return _value.getFromTime(); 489 } 490 491 public void setFromTime(Long fromTime) 492 throws PersistenceNotNullException, PersistenceReadOnlyException { 493 checkReadWrite(); 494 _value.setFromTime(fromTime); 495 } 496 497 public boolean getFromTimeHasBeenModified() { 498 return _value.getFromTimeHasBeenModified(); 499 } 500 501 public Long getThruTime() { 502 return _value.getThruTime(); 503 } 504 505 public void setThruTime(Long thruTime) 506 throws PersistenceNotNullException, PersistenceReadOnlyException { 507 checkReadWrite(); 508 _value.setThruTime(thruTime); 509 } 510 511 public boolean getThruTimeHasBeenModified() { 512 return _value.getThruTimeHasBeenModified(); 513 } 514 515}