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