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