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