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 * InventoryConditionGlAccount.java 021 */ 022 023package com.echothree.model.data.inventory.server.entity; 024 025import com.echothree.model.data.inventory.common.pk.InventoryConditionGlAccountPK; 026 027import com.echothree.model.data.inventory.common.pk.InventoryConditionPK; 028import com.echothree.model.data.accounting.common.pk.ItemAccountingCategoryPK; 029import com.echothree.model.data.accounting.common.pk.GlAccountPK; 030 031import com.echothree.model.data.inventory.server.entity.InventoryCondition; 032import com.echothree.model.data.accounting.server.entity.ItemAccountingCategory; 033import com.echothree.model.data.accounting.server.entity.GlAccount; 034 035import com.echothree.model.data.inventory.server.factory.InventoryConditionFactory; 036import com.echothree.model.data.accounting.server.factory.ItemAccountingCategoryFactory; 037import com.echothree.model.data.accounting.server.factory.GlAccountFactory; 038 039import com.echothree.model.data.inventory.common.pk.InventoryConditionGlAccountPK; 040 041import com.echothree.model.data.inventory.server.value.InventoryConditionGlAccountValue; 042 043import com.echothree.model.data.inventory.server.factory.InventoryConditionGlAccountFactory; 044 045import com.echothree.util.common.exception.PersistenceException; 046import com.echothree.util.common.exception.PersistenceDatabaseException; 047import com.echothree.util.common.exception.PersistenceNotNullException; 048import com.echothree.util.common.exception.PersistenceReadOnlyException; 049 050import com.echothree.util.common.persistence.BasePK; 051 052import com.echothree.util.common.persistence.type.ByteArray; 053 054import com.echothree.util.server.persistence.BaseEntity; 055import com.echothree.util.server.persistence.EntityPermission; 056import com.echothree.util.server.persistence.Session; 057import com.echothree.util.server.persistence.ThreadSession; 058 059import java.io.Serializable; 060 061import javax.annotation.Nonnull; 062import javax.annotation.Nullable; 063 064public class InventoryConditionGlAccount 065 extends BaseEntity 066 implements Serializable { 067 068 private InventoryConditionGlAccountPK _pk; 069 private InventoryConditionGlAccountValue _value; 070 071 /** Creates a new instance of InventoryConditionGlAccount */ 072 public InventoryConditionGlAccount() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of InventoryConditionGlAccount */ 078 public InventoryConditionGlAccount(InventoryConditionGlAccountValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 @Nonnull 087 public InventoryConditionGlAccountFactory getBaseFactoryInstance() { 088 return InventoryConditionGlAccountFactory.getInstance(); 089 } 090 091 @Override 092 public boolean hasBeenModified() { 093 return _value.hasBeenModified(); 094 } 095 096 @Override 097 public int hashCode() { 098 return _pk.hashCode(); 099 } 100 101 @Override 102 @Nonnull 103 public String toString() { 104 return _pk.toString(); 105 } 106 107 @Override 108 public boolean equals(Object other) { 109 if(this == other) 110 return true; 111 112 if(other instanceof InventoryConditionGlAccount that) { 113 InventoryConditionGlAccountValue thatValue = that.getInventoryConditionGlAccountValue(); 114 return _value.equals(thatValue); 115 } else { 116 return false; 117 } 118 } 119 120 @Override 121 public void store() 122 throws PersistenceDatabaseException { 123 getBaseFactoryInstance().store(this); 124 } 125 126 @Override 127 public void remove() 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().remove(this); 130 } 131 132 @Nonnull 133 public InventoryConditionGlAccountValue getInventoryConditionGlAccountValue() { 134 return _value; 135 } 136 137 public void setInventoryConditionGlAccountValue(@Nonnull InventoryConditionGlAccountValue value) 138 throws PersistenceReadOnlyException { 139 checkReadWrite(); 140 _value = value; 141 } 142 143 @Override 144 @Nonnull 145 public InventoryConditionGlAccountPK getPrimaryKey() { 146 return _pk; 147 } 148 149 @Nonnull 150 public InventoryConditionPK getInventoryConditionPK() { 151 return _value.getInventoryConditionPK(); 152 } 153 154 @Nonnull 155 public InventoryCondition getInventoryCondition(EntityPermission entityPermission) { 156 return InventoryConditionFactory.getInstance().getEntityFromPK(entityPermission, getInventoryConditionPK()); 157 } 158 159 @Nonnull 160 public InventoryCondition getInventoryCondition() { 161 return getInventoryCondition(EntityPermission.READ_ONLY); 162 } 163 164 @Nonnull 165 public InventoryCondition getInventoryConditionForUpdate() { 166 return getInventoryCondition(EntityPermission.READ_WRITE); 167 } 168 169 public void setInventoryConditionPK(@Nonnull InventoryConditionPK inventoryConditionPK) 170 throws PersistenceNotNullException, PersistenceReadOnlyException { 171 checkReadWrite(); 172 _value.setInventoryConditionPK(inventoryConditionPK); 173 } 174 175 public void setInventoryCondition(@Nonnull InventoryCondition entity) { 176 setInventoryConditionPK(entity == null ? null : entity.getPrimaryKey()); 177 } 178 179 public boolean getInventoryConditionPKHasBeenModified() { 180 return _value.getInventoryConditionPKHasBeenModified(); 181 } 182 183 @Nonnull 184 public ItemAccountingCategoryPK getItemAccountingCategoryPK() { 185 return _value.getItemAccountingCategoryPK(); 186 } 187 188 @Nonnull 189 public ItemAccountingCategory getItemAccountingCategory(EntityPermission entityPermission) { 190 return ItemAccountingCategoryFactory.getInstance().getEntityFromPK(entityPermission, getItemAccountingCategoryPK()); 191 } 192 193 @Nonnull 194 public ItemAccountingCategory getItemAccountingCategory() { 195 return getItemAccountingCategory(EntityPermission.READ_ONLY); 196 } 197 198 @Nonnull 199 public ItemAccountingCategory getItemAccountingCategoryForUpdate() { 200 return getItemAccountingCategory(EntityPermission.READ_WRITE); 201 } 202 203 public void setItemAccountingCategoryPK(@Nonnull ItemAccountingCategoryPK itemAccountingCategoryPK) 204 throws PersistenceNotNullException, PersistenceReadOnlyException { 205 checkReadWrite(); 206 _value.setItemAccountingCategoryPK(itemAccountingCategoryPK); 207 } 208 209 public void setItemAccountingCategory(@Nonnull ItemAccountingCategory entity) { 210 setItemAccountingCategoryPK(entity == null ? null : entity.getPrimaryKey()); 211 } 212 213 public boolean getItemAccountingCategoryPKHasBeenModified() { 214 return _value.getItemAccountingCategoryPKHasBeenModified(); 215 } 216 217 @Nullable 218 public GlAccountPK getInventoryGlAccountPK() { 219 return _value.getInventoryGlAccountPK(); 220 } 221 222 @Nullable 223 public GlAccount getInventoryGlAccount(EntityPermission entityPermission) { 224 GlAccountPK pk = getInventoryGlAccountPK(); 225 GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk); 226 227 return entity; 228 } 229 230 @Nullable 231 public GlAccount getInventoryGlAccount() { 232 return getInventoryGlAccount(EntityPermission.READ_ONLY); 233 } 234 235 @Nullable 236 public GlAccount getInventoryGlAccountForUpdate() { 237 return getInventoryGlAccount(EntityPermission.READ_WRITE); 238 } 239 240 public void setInventoryGlAccountPK(@Nullable GlAccountPK inventoryGlAccountPK) 241 throws PersistenceNotNullException, PersistenceReadOnlyException { 242 checkReadWrite(); 243 _value.setInventoryGlAccountPK(inventoryGlAccountPK); 244 } 245 246 public void setInventoryGlAccount(@Nullable GlAccount entity) { 247 setInventoryGlAccountPK(entity == null ? null : entity.getPrimaryKey()); 248 } 249 250 public boolean getInventoryGlAccountPKHasBeenModified() { 251 return _value.getInventoryGlAccountPKHasBeenModified(); 252 } 253 254 @Nullable 255 public GlAccountPK getSalesGlAccountPK() { 256 return _value.getSalesGlAccountPK(); 257 } 258 259 @Nullable 260 public GlAccount getSalesGlAccount(EntityPermission entityPermission) { 261 GlAccountPK pk = getSalesGlAccountPK(); 262 GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk); 263 264 return entity; 265 } 266 267 @Nullable 268 public GlAccount getSalesGlAccount() { 269 return getSalesGlAccount(EntityPermission.READ_ONLY); 270 } 271 272 @Nullable 273 public GlAccount getSalesGlAccountForUpdate() { 274 return getSalesGlAccount(EntityPermission.READ_WRITE); 275 } 276 277 public void setSalesGlAccountPK(@Nullable GlAccountPK salesGlAccountPK) 278 throws PersistenceNotNullException, PersistenceReadOnlyException { 279 checkReadWrite(); 280 _value.setSalesGlAccountPK(salesGlAccountPK); 281 } 282 283 public void setSalesGlAccount(@Nullable GlAccount entity) { 284 setSalesGlAccountPK(entity == null ? null : entity.getPrimaryKey()); 285 } 286 287 public boolean getSalesGlAccountPKHasBeenModified() { 288 return _value.getSalesGlAccountPKHasBeenModified(); 289 } 290 291 @Nullable 292 public GlAccountPK getReturnsGlAccountPK() { 293 return _value.getReturnsGlAccountPK(); 294 } 295 296 @Nullable 297 public GlAccount getReturnsGlAccount(EntityPermission entityPermission) { 298 GlAccountPK pk = getReturnsGlAccountPK(); 299 GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk); 300 301 return entity; 302 } 303 304 @Nullable 305 public GlAccount getReturnsGlAccount() { 306 return getReturnsGlAccount(EntityPermission.READ_ONLY); 307 } 308 309 @Nullable 310 public GlAccount getReturnsGlAccountForUpdate() { 311 return getReturnsGlAccount(EntityPermission.READ_WRITE); 312 } 313 314 public void setReturnsGlAccountPK(@Nullable GlAccountPK returnsGlAccountPK) 315 throws PersistenceNotNullException, PersistenceReadOnlyException { 316 checkReadWrite(); 317 _value.setReturnsGlAccountPK(returnsGlAccountPK); 318 } 319 320 public void setReturnsGlAccount(@Nullable GlAccount entity) { 321 setReturnsGlAccountPK(entity == null ? null : entity.getPrimaryKey()); 322 } 323 324 public boolean getReturnsGlAccountPKHasBeenModified() { 325 return _value.getReturnsGlAccountPKHasBeenModified(); 326 } 327 328 @Nullable 329 public GlAccountPK getCogsGlAccountPK() { 330 return _value.getCogsGlAccountPK(); 331 } 332 333 @Nullable 334 public GlAccount getCogsGlAccount(EntityPermission entityPermission) { 335 GlAccountPK pk = getCogsGlAccountPK(); 336 GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk); 337 338 return entity; 339 } 340 341 @Nullable 342 public GlAccount getCogsGlAccount() { 343 return getCogsGlAccount(EntityPermission.READ_ONLY); 344 } 345 346 @Nullable 347 public GlAccount getCogsGlAccountForUpdate() { 348 return getCogsGlAccount(EntityPermission.READ_WRITE); 349 } 350 351 public void setCogsGlAccountPK(@Nullable GlAccountPK cogsGlAccountPK) 352 throws PersistenceNotNullException, PersistenceReadOnlyException { 353 checkReadWrite(); 354 _value.setCogsGlAccountPK(cogsGlAccountPK); 355 } 356 357 public void setCogsGlAccount(@Nullable GlAccount entity) { 358 setCogsGlAccountPK(entity == null ? null : entity.getPrimaryKey()); 359 } 360 361 public boolean getCogsGlAccountPKHasBeenModified() { 362 return _value.getCogsGlAccountPKHasBeenModified(); 363 } 364 365 @Nullable 366 public GlAccountPK getReturnsCogsGlAccountPK() { 367 return _value.getReturnsCogsGlAccountPK(); 368 } 369 370 @Nullable 371 public GlAccount getReturnsCogsGlAccount(EntityPermission entityPermission) { 372 GlAccountPK pk = getReturnsCogsGlAccountPK(); 373 GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk); 374 375 return entity; 376 } 377 378 @Nullable 379 public GlAccount getReturnsCogsGlAccount() { 380 return getReturnsCogsGlAccount(EntityPermission.READ_ONLY); 381 } 382 383 @Nullable 384 public GlAccount getReturnsCogsGlAccountForUpdate() { 385 return getReturnsCogsGlAccount(EntityPermission.READ_WRITE); 386 } 387 388 public void setReturnsCogsGlAccountPK(@Nullable GlAccountPK returnsCogsGlAccountPK) 389 throws PersistenceNotNullException, PersistenceReadOnlyException { 390 checkReadWrite(); 391 _value.setReturnsCogsGlAccountPK(returnsCogsGlAccountPK); 392 } 393 394 public void setReturnsCogsGlAccount(@Nullable GlAccount entity) { 395 setReturnsCogsGlAccountPK(entity == null ? null : entity.getPrimaryKey()); 396 } 397 398 public boolean getReturnsCogsGlAccountPKHasBeenModified() { 399 return _value.getReturnsCogsGlAccountPKHasBeenModified(); 400 } 401 402 @Nonnull 403 public Long getFromTime() { 404 return _value.getFromTime(); 405 } 406 407 public void setFromTime(@Nonnull Long fromTime) 408 throws PersistenceNotNullException, PersistenceReadOnlyException { 409 checkReadWrite(); 410 _value.setFromTime(fromTime); 411 } 412 413 public boolean getFromTimeHasBeenModified() { 414 return _value.getFromTimeHasBeenModified(); 415 } 416 417 @Nonnull 418 public Long getThruTime() { 419 return _value.getThruTime(); 420 } 421 422 public void setThruTime(@Nonnull Long thruTime) 423 throws PersistenceNotNullException, PersistenceReadOnlyException { 424 checkReadWrite(); 425 _value.setThruTime(thruTime); 426 } 427 428 public boolean getThruTimeHasBeenModified() { 429 return _value.getThruTimeHasBeenModified(); 430 } 431 432}