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 * FinancialAccountDetail.java 021 */ 022 023package com.echothree.model.data.financial.server.entity; 024 025import com.echothree.model.data.financial.common.pk.FinancialAccountDetailPK; 026 027import com.echothree.model.data.financial.common.pk.FinancialAccountPK; 028import com.echothree.model.data.financial.common.pk.FinancialAccountTypePK; 029import com.echothree.model.data.accounting.common.pk.CurrencyPK; 030import com.echothree.model.data.accounting.common.pk.GlAccountPK; 031 032import com.echothree.model.data.financial.server.entity.FinancialAccount; 033import com.echothree.model.data.financial.server.entity.FinancialAccountType; 034import com.echothree.model.data.accounting.server.entity.Currency; 035import com.echothree.model.data.accounting.server.entity.GlAccount; 036 037import com.echothree.model.data.financial.server.factory.FinancialAccountFactory; 038import com.echothree.model.data.financial.server.factory.FinancialAccountTypeFactory; 039import com.echothree.model.data.accounting.server.factory.CurrencyFactory; 040import com.echothree.model.data.accounting.server.factory.GlAccountFactory; 041 042import com.echothree.model.data.financial.common.pk.FinancialAccountDetailPK; 043 044import com.echothree.model.data.financial.server.value.FinancialAccountDetailValue; 045 046import com.echothree.model.data.financial.server.factory.FinancialAccountDetailFactory; 047 048import com.echothree.util.common.exception.PersistenceException; 049import com.echothree.util.common.exception.PersistenceDatabaseException; 050import com.echothree.util.common.exception.PersistenceNotNullException; 051import com.echothree.util.common.exception.PersistenceReadOnlyException; 052 053import com.echothree.util.common.persistence.BasePK; 054 055import com.echothree.util.common.persistence.type.ByteArray; 056 057import com.echothree.util.server.persistence.BaseEntity; 058import com.echothree.util.server.persistence.EntityPermission; 059import com.echothree.util.server.persistence.Session; 060import com.echothree.util.server.persistence.ThreadSession; 061 062import java.io.Serializable; 063 064public class FinancialAccountDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private FinancialAccountDetailPK _pk; 069 private FinancialAccountDetailValue _value; 070 071 /** Creates a new instance of FinancialAccountDetail */ 072 public FinancialAccountDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of FinancialAccountDetail */ 078 public FinancialAccountDetail(FinancialAccountDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public FinancialAccountDetailFactory getBaseFactoryInstance() { 087 return FinancialAccountDetailFactory.getInstance(); 088 } 089 090 @Override 091 public boolean hasBeenModified() { 092 return _value.hasBeenModified(); 093 } 094 095 @Override 096 public int hashCode() { 097 return _pk.hashCode(); 098 } 099 100 @Override 101 public String toString() { 102 return _pk.toString(); 103 } 104 105 @Override 106 public boolean equals(Object other) { 107 if(this == other) 108 return true; 109 110 if(other instanceof FinancialAccountDetail that) { 111 FinancialAccountDetailValue thatValue = that.getFinancialAccountDetailValue(); 112 return _value.equals(thatValue); 113 } else { 114 return false; 115 } 116 } 117 118 @Override 119 public void store() 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().store(this); 122 } 123 124 @Override 125 public void remove() 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().remove(this); 128 } 129 130 public FinancialAccountDetailValue getFinancialAccountDetailValue() { 131 return _value; 132 } 133 134 public void setFinancialAccountDetailValue(FinancialAccountDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public FinancialAccountDetailPK getPrimaryKey() { 142 return _pk; 143 } 144 145 public FinancialAccountPK getFinancialAccountPK() { 146 return _value.getFinancialAccountPK(); 147 } 148 149 public FinancialAccount getFinancialAccount(EntityPermission entityPermission) { 150 return FinancialAccountFactory.getInstance().getEntityFromPK(entityPermission, getFinancialAccountPK()); 151 } 152 153 public FinancialAccount getFinancialAccount() { 154 return getFinancialAccount(EntityPermission.READ_ONLY); 155 } 156 157 public FinancialAccount getFinancialAccountForUpdate() { 158 return getFinancialAccount(EntityPermission.READ_WRITE); 159 } 160 161 public void setFinancialAccountPK(FinancialAccountPK financialAccountPK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setFinancialAccountPK(financialAccountPK); 165 } 166 167 public void setFinancialAccount(FinancialAccount entity) { 168 setFinancialAccountPK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getFinancialAccountPKHasBeenModified() { 172 return _value.getFinancialAccountPKHasBeenModified(); 173 } 174 175 public FinancialAccountTypePK getFinancialAccountTypePK() { 176 return _value.getFinancialAccountTypePK(); 177 } 178 179 public FinancialAccountType getFinancialAccountType(EntityPermission entityPermission) { 180 return FinancialAccountTypeFactory.getInstance().getEntityFromPK(entityPermission, getFinancialAccountTypePK()); 181 } 182 183 public FinancialAccountType getFinancialAccountType() { 184 return getFinancialAccountType(EntityPermission.READ_ONLY); 185 } 186 187 public FinancialAccountType getFinancialAccountTypeForUpdate() { 188 return getFinancialAccountType(EntityPermission.READ_WRITE); 189 } 190 191 public void setFinancialAccountTypePK(FinancialAccountTypePK financialAccountTypePK) 192 throws PersistenceNotNullException, PersistenceReadOnlyException { 193 checkReadWrite(); 194 _value.setFinancialAccountTypePK(financialAccountTypePK); 195 } 196 197 public void setFinancialAccountType(FinancialAccountType entity) { 198 setFinancialAccountTypePK(entity == null? null: entity.getPrimaryKey()); 199 } 200 201 public boolean getFinancialAccountTypePKHasBeenModified() { 202 return _value.getFinancialAccountTypePKHasBeenModified(); 203 } 204 205 public String getFinancialAccountName() { 206 return _value.getFinancialAccountName(); 207 } 208 209 public void setFinancialAccountName(String financialAccountName) 210 throws PersistenceNotNullException, PersistenceReadOnlyException { 211 checkReadWrite(); 212 _value.setFinancialAccountName(financialAccountName); 213 } 214 215 public boolean getFinancialAccountNameHasBeenModified() { 216 return _value.getFinancialAccountNameHasBeenModified(); 217 } 218 219 public CurrencyPK getCurrencyPK() { 220 return _value.getCurrencyPK(); 221 } 222 223 public Currency getCurrency(EntityPermission entityPermission) { 224 return CurrencyFactory.getInstance().getEntityFromPK(entityPermission, getCurrencyPK()); 225 } 226 227 public Currency getCurrency() { 228 return getCurrency(EntityPermission.READ_ONLY); 229 } 230 231 public Currency getCurrencyForUpdate() { 232 return getCurrency(EntityPermission.READ_WRITE); 233 } 234 235 public void setCurrencyPK(CurrencyPK currencyPK) 236 throws PersistenceNotNullException, PersistenceReadOnlyException { 237 checkReadWrite(); 238 _value.setCurrencyPK(currencyPK); 239 } 240 241 public void setCurrency(Currency entity) { 242 setCurrencyPK(entity == null? null: entity.getPrimaryKey()); 243 } 244 245 public boolean getCurrencyPKHasBeenModified() { 246 return _value.getCurrencyPKHasBeenModified(); 247 } 248 249 public GlAccountPK getGlAccountPK() { 250 return _value.getGlAccountPK(); 251 } 252 253 public GlAccount getGlAccount(EntityPermission entityPermission) { 254 return GlAccountFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountPK()); 255 } 256 257 public GlAccount getGlAccount() { 258 return getGlAccount(EntityPermission.READ_ONLY); 259 } 260 261 public GlAccount getGlAccountForUpdate() { 262 return getGlAccount(EntityPermission.READ_WRITE); 263 } 264 265 public void setGlAccountPK(GlAccountPK glAccountPK) 266 throws PersistenceNotNullException, PersistenceReadOnlyException { 267 checkReadWrite(); 268 _value.setGlAccountPK(glAccountPK); 269 } 270 271 public void setGlAccount(GlAccount entity) { 272 setGlAccountPK(entity == null? null: entity.getPrimaryKey()); 273 } 274 275 public boolean getGlAccountPKHasBeenModified() { 276 return _value.getGlAccountPKHasBeenModified(); 277 } 278 279 public String getReference() { 280 return _value.getReference(); 281 } 282 283 public void setReference(String reference) 284 throws PersistenceNotNullException, PersistenceReadOnlyException { 285 checkReadWrite(); 286 _value.setReference(reference); 287 } 288 289 public boolean getReferenceHasBeenModified() { 290 return _value.getReferenceHasBeenModified(); 291 } 292 293 public String getDescription() { 294 return _value.getDescription(); 295 } 296 297 public void setDescription(String description) 298 throws PersistenceNotNullException, PersistenceReadOnlyException { 299 checkReadWrite(); 300 _value.setDescription(description); 301 } 302 303 public boolean getDescriptionHasBeenModified() { 304 return _value.getDescriptionHasBeenModified(); 305 } 306 307 public Long getFromTime() { 308 return _value.getFromTime(); 309 } 310 311 public void setFromTime(Long fromTime) 312 throws PersistenceNotNullException, PersistenceReadOnlyException { 313 checkReadWrite(); 314 _value.setFromTime(fromTime); 315 } 316 317 public boolean getFromTimeHasBeenModified() { 318 return _value.getFromTimeHasBeenModified(); 319 } 320 321 public Long getThruTime() { 322 return _value.getThruTime(); 323 } 324 325 public void setThruTime(Long thruTime) 326 throws PersistenceNotNullException, PersistenceReadOnlyException { 327 checkReadWrite(); 328 _value.setThruTime(thruTime); 329 } 330 331 public boolean getThruTimeHasBeenModified() { 332 return _value.getThruTimeHasBeenModified(); 333 } 334 335}