001// -------------------------------------------------------------------------------- 002// Copyright 2002-2025 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 * InvoiceLineDetail.java 021 */ 022 023package com.echothree.model.data.invoice.server.entity; 024 025import com.echothree.model.data.invoice.common.pk.InvoiceLineDetailPK; 026 027import com.echothree.model.data.invoice.common.pk.InvoiceLinePK; 028import com.echothree.model.data.invoice.common.pk.InvoicePK; 029import com.echothree.model.data.invoice.common.pk.InvoiceLineTypePK; 030import com.echothree.model.data.invoice.common.pk.InvoiceLineUseTypePK; 031 032import com.echothree.model.data.invoice.server.entity.InvoiceLine; 033import com.echothree.model.data.invoice.server.entity.Invoice; 034import com.echothree.model.data.invoice.server.entity.InvoiceLineType; 035import com.echothree.model.data.invoice.server.entity.InvoiceLineUseType; 036 037import com.echothree.model.data.invoice.server.factory.InvoiceLineFactory; 038import com.echothree.model.data.invoice.server.factory.InvoiceFactory; 039import com.echothree.model.data.invoice.server.factory.InvoiceLineTypeFactory; 040import com.echothree.model.data.invoice.server.factory.InvoiceLineUseTypeFactory; 041 042import com.echothree.model.data.invoice.common.pk.InvoiceLineDetailPK; 043 044import com.echothree.model.data.invoice.server.value.InvoiceLineDetailValue; 045 046import com.echothree.model.data.invoice.server.factory.InvoiceLineDetailFactory; 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 InvoiceLineDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private InvoiceLineDetailPK _pk; 069 private InvoiceLineDetailValue _value; 070 071 /** Creates a new instance of InvoiceLineDetail */ 072 public InvoiceLineDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of InvoiceLineDetail */ 078 public InvoiceLineDetail(InvoiceLineDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public InvoiceLineDetailFactory getBaseFactoryInstance() { 087 return InvoiceLineDetailFactory.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 InvoiceLineDetail that) { 111 InvoiceLineDetailValue thatValue = that.getInvoiceLineDetailValue(); 112 return _value.equals(thatValue); 113 } else { 114 return false; 115 } 116 } 117 118 @Override 119 public void store(Session session) 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().store(session, this); 122 } 123 124 @Override 125 public void remove(Session session) 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().remove(session, this); 128 } 129 130 @Override 131 public void remove() 132 throws PersistenceDatabaseException { 133 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 134 } 135 136 public InvoiceLineDetailValue getInvoiceLineDetailValue() { 137 return _value; 138 } 139 140 public void setInvoiceLineDetailValue(InvoiceLineDetailValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public InvoiceLineDetailPK getPrimaryKey() { 148 return _pk; 149 } 150 151 public InvoiceLinePK getInvoiceLinePK() { 152 return _value.getInvoiceLinePK(); 153 } 154 155 public InvoiceLine getInvoiceLine(Session session, EntityPermission entityPermission) { 156 return InvoiceLineFactory.getInstance().getEntityFromPK(session, entityPermission, getInvoiceLinePK()); 157 } 158 159 public InvoiceLine getInvoiceLine(EntityPermission entityPermission) { 160 return getInvoiceLine(ThreadSession.currentSession(), entityPermission); 161 } 162 163 public InvoiceLine getInvoiceLine(Session session) { 164 return getInvoiceLine(session, EntityPermission.READ_ONLY); 165 } 166 167 public InvoiceLine getInvoiceLine() { 168 return getInvoiceLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 169 } 170 171 public InvoiceLine getInvoiceLineForUpdate(Session session) { 172 return getInvoiceLine(session, EntityPermission.READ_WRITE); 173 } 174 175 public InvoiceLine getInvoiceLineForUpdate() { 176 return getInvoiceLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 177 } 178 179 public void setInvoiceLinePK(InvoiceLinePK invoiceLinePK) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setInvoiceLinePK(invoiceLinePK); 183 } 184 185 public void setInvoiceLine(InvoiceLine entity) { 186 setInvoiceLinePK(entity == null? null: entity.getPrimaryKey()); 187 } 188 189 public boolean getInvoiceLinePKHasBeenModified() { 190 return _value.getInvoiceLinePKHasBeenModified(); 191 } 192 193 public InvoicePK getInvoicePK() { 194 return _value.getInvoicePK(); 195 } 196 197 public Invoice getInvoice(Session session, EntityPermission entityPermission) { 198 return InvoiceFactory.getInstance().getEntityFromPK(session, entityPermission, getInvoicePK()); 199 } 200 201 public Invoice getInvoice(EntityPermission entityPermission) { 202 return getInvoice(ThreadSession.currentSession(), entityPermission); 203 } 204 205 public Invoice getInvoice(Session session) { 206 return getInvoice(session, EntityPermission.READ_ONLY); 207 } 208 209 public Invoice getInvoice() { 210 return getInvoice(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 211 } 212 213 public Invoice getInvoiceForUpdate(Session session) { 214 return getInvoice(session, EntityPermission.READ_WRITE); 215 } 216 217 public Invoice getInvoiceForUpdate() { 218 return getInvoice(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 219 } 220 221 public void setInvoicePK(InvoicePK invoicePK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setInvoicePK(invoicePK); 225 } 226 227 public void setInvoice(Invoice entity) { 228 setInvoicePK(entity == null? null: entity.getPrimaryKey()); 229 } 230 231 public boolean getInvoicePKHasBeenModified() { 232 return _value.getInvoicePKHasBeenModified(); 233 } 234 235 public Integer getInvoiceLineSequence() { 236 return _value.getInvoiceLineSequence(); 237 } 238 239 public void setInvoiceLineSequence(Integer invoiceLineSequence) 240 throws PersistenceNotNullException, PersistenceReadOnlyException { 241 checkReadWrite(); 242 _value.setInvoiceLineSequence(invoiceLineSequence); 243 } 244 245 public boolean getInvoiceLineSequenceHasBeenModified() { 246 return _value.getInvoiceLineSequenceHasBeenModified(); 247 } 248 249 public InvoiceLinePK getParentInvoiceLinePK() { 250 return _value.getParentInvoiceLinePK(); 251 } 252 253 public InvoiceLine getParentInvoiceLine(Session session, EntityPermission entityPermission) { 254 InvoiceLinePK pk = getParentInvoiceLinePK(); 255 InvoiceLine entity = pk == null? null: InvoiceLineFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 256 257 return entity; 258 } 259 260 public InvoiceLine getParentInvoiceLine(EntityPermission entityPermission) { 261 return getParentInvoiceLine(ThreadSession.currentSession(), entityPermission); 262 } 263 264 public InvoiceLine getParentInvoiceLine(Session session) { 265 return getParentInvoiceLine(session, EntityPermission.READ_ONLY); 266 } 267 268 public InvoiceLine getParentInvoiceLine() { 269 return getParentInvoiceLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 270 } 271 272 public InvoiceLine getParentInvoiceLineForUpdate(Session session) { 273 return getParentInvoiceLine(session, EntityPermission.READ_WRITE); 274 } 275 276 public InvoiceLine getParentInvoiceLineForUpdate() { 277 return getParentInvoiceLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 278 } 279 280 public void setParentInvoiceLinePK(InvoiceLinePK parentInvoiceLinePK) 281 throws PersistenceNotNullException, PersistenceReadOnlyException { 282 checkReadWrite(); 283 _value.setParentInvoiceLinePK(parentInvoiceLinePK); 284 } 285 286 public void setParentInvoiceLine(InvoiceLine entity) { 287 setParentInvoiceLinePK(entity == null? null: entity.getPrimaryKey()); 288 } 289 290 public boolean getParentInvoiceLinePKHasBeenModified() { 291 return _value.getParentInvoiceLinePKHasBeenModified(); 292 } 293 294 public InvoiceLineTypePK getInvoiceLineTypePK() { 295 return _value.getInvoiceLineTypePK(); 296 } 297 298 public InvoiceLineType getInvoiceLineType(Session session, EntityPermission entityPermission) { 299 return InvoiceLineTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getInvoiceLineTypePK()); 300 } 301 302 public InvoiceLineType getInvoiceLineType(EntityPermission entityPermission) { 303 return getInvoiceLineType(ThreadSession.currentSession(), entityPermission); 304 } 305 306 public InvoiceLineType getInvoiceLineType(Session session) { 307 return getInvoiceLineType(session, EntityPermission.READ_ONLY); 308 } 309 310 public InvoiceLineType getInvoiceLineType() { 311 return getInvoiceLineType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 312 } 313 314 public InvoiceLineType getInvoiceLineTypeForUpdate(Session session) { 315 return getInvoiceLineType(session, EntityPermission.READ_WRITE); 316 } 317 318 public InvoiceLineType getInvoiceLineTypeForUpdate() { 319 return getInvoiceLineType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 320 } 321 322 public void setInvoiceLineTypePK(InvoiceLineTypePK invoiceLineTypePK) 323 throws PersistenceNotNullException, PersistenceReadOnlyException { 324 checkReadWrite(); 325 _value.setInvoiceLineTypePK(invoiceLineTypePK); 326 } 327 328 public void setInvoiceLineType(InvoiceLineType entity) { 329 setInvoiceLineTypePK(entity == null? null: entity.getPrimaryKey()); 330 } 331 332 public boolean getInvoiceLineTypePKHasBeenModified() { 333 return _value.getInvoiceLineTypePKHasBeenModified(); 334 } 335 336 public InvoiceLineUseTypePK getInvoiceLineUseTypePK() { 337 return _value.getInvoiceLineUseTypePK(); 338 } 339 340 public InvoiceLineUseType getInvoiceLineUseType(Session session, EntityPermission entityPermission) { 341 return InvoiceLineUseTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getInvoiceLineUseTypePK()); 342 } 343 344 public InvoiceLineUseType getInvoiceLineUseType(EntityPermission entityPermission) { 345 return getInvoiceLineUseType(ThreadSession.currentSession(), entityPermission); 346 } 347 348 public InvoiceLineUseType getInvoiceLineUseType(Session session) { 349 return getInvoiceLineUseType(session, EntityPermission.READ_ONLY); 350 } 351 352 public InvoiceLineUseType getInvoiceLineUseType() { 353 return getInvoiceLineUseType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 354 } 355 356 public InvoiceLineUseType getInvoiceLineUseTypeForUpdate(Session session) { 357 return getInvoiceLineUseType(session, EntityPermission.READ_WRITE); 358 } 359 360 public InvoiceLineUseType getInvoiceLineUseTypeForUpdate() { 361 return getInvoiceLineUseType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 362 } 363 364 public void setInvoiceLineUseTypePK(InvoiceLineUseTypePK invoiceLineUseTypePK) 365 throws PersistenceNotNullException, PersistenceReadOnlyException { 366 checkReadWrite(); 367 _value.setInvoiceLineUseTypePK(invoiceLineUseTypePK); 368 } 369 370 public void setInvoiceLineUseType(InvoiceLineUseType entity) { 371 setInvoiceLineUseTypePK(entity == null? null: entity.getPrimaryKey()); 372 } 373 374 public boolean getInvoiceLineUseTypePKHasBeenModified() { 375 return _value.getInvoiceLineUseTypePKHasBeenModified(); 376 } 377 378 public Long getAmount() { 379 return _value.getAmount(); 380 } 381 382 public void setAmount(Long amount) 383 throws PersistenceNotNullException, PersistenceReadOnlyException { 384 checkReadWrite(); 385 _value.setAmount(amount); 386 } 387 388 public boolean getAmountHasBeenModified() { 389 return _value.getAmountHasBeenModified(); 390 } 391 392 public String getDescription() { 393 return _value.getDescription(); 394 } 395 396 public void setDescription(String description) 397 throws PersistenceNotNullException, PersistenceReadOnlyException { 398 checkReadWrite(); 399 _value.setDescription(description); 400 } 401 402 public boolean getDescriptionHasBeenModified() { 403 return _value.getDescriptionHasBeenModified(); 404 } 405 406 public Long getFromTime() { 407 return _value.getFromTime(); 408 } 409 410 public void setFromTime(Long fromTime) 411 throws PersistenceNotNullException, PersistenceReadOnlyException { 412 checkReadWrite(); 413 _value.setFromTime(fromTime); 414 } 415 416 public boolean getFromTimeHasBeenModified() { 417 return _value.getFromTimeHasBeenModified(); 418 } 419 420 public Long getThruTime() { 421 return _value.getThruTime(); 422 } 423 424 public void setThruTime(Long thruTime) 425 throws PersistenceNotNullException, PersistenceReadOnlyException { 426 checkReadWrite(); 427 _value.setThruTime(thruTime); 428 } 429 430 public boolean getThruTimeHasBeenModified() { 431 return _value.getThruTimeHasBeenModified(); 432 } 433 434}