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 * TaxDetail.java 021 */ 022 023package com.echothree.model.data.tax.server.entity; 024 025import com.echothree.model.data.tax.common.pk.TaxDetailPK; 026 027import com.echothree.model.data.tax.common.pk.TaxPK; 028import com.echothree.model.data.contact.common.pk.ContactMechanismPurposePK; 029import com.echothree.model.data.accounting.common.pk.GlAccountPK; 030 031import com.echothree.model.data.tax.server.entity.Tax; 032import com.echothree.model.data.contact.server.entity.ContactMechanismPurpose; 033import com.echothree.model.data.accounting.server.entity.GlAccount; 034 035import com.echothree.model.data.tax.server.factory.TaxFactory; 036import com.echothree.model.data.contact.server.factory.ContactMechanismPurposeFactory; 037import com.echothree.model.data.accounting.server.factory.GlAccountFactory; 038 039import com.echothree.model.data.tax.common.pk.TaxDetailPK; 040 041import com.echothree.model.data.tax.server.value.TaxDetailValue; 042 043import com.echothree.model.data.tax.server.factory.TaxDetailFactory; 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 061public class TaxDetail 062 extends BaseEntity 063 implements Serializable { 064 065 private TaxDetailPK _pk; 066 private TaxDetailValue _value; 067 068 /** Creates a new instance of TaxDetail */ 069 public TaxDetail() 070 throws PersistenceException { 071 super(); 072 } 073 074 /** Creates a new instance of TaxDetail */ 075 public TaxDetail(TaxDetailValue value, EntityPermission entityPermission) { 076 super(entityPermission); 077 078 _value = value; 079 _pk = value.getPrimaryKey(); 080 } 081 082 @Override 083 public TaxDetailFactory getBaseFactoryInstance() { 084 return TaxDetailFactory.getInstance(); 085 } 086 087 @Override 088 public boolean hasBeenModified() { 089 return _value.hasBeenModified(); 090 } 091 092 @Override 093 public int hashCode() { 094 return _pk.hashCode(); 095 } 096 097 @Override 098 public String toString() { 099 return _pk.toString(); 100 } 101 102 @Override 103 public boolean equals(Object other) { 104 if(this == other) 105 return true; 106 107 if(other instanceof TaxDetail that) { 108 TaxDetailValue thatValue = that.getTaxDetailValue(); 109 return _value.equals(thatValue); 110 } else { 111 return false; 112 } 113 } 114 115 @Override 116 public void store(Session session) 117 throws PersistenceDatabaseException { 118 getBaseFactoryInstance().store(session, this); 119 } 120 121 @Override 122 public void remove(Session session) 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().remove(session, this); 125 } 126 127 @Override 128 public void remove() 129 throws PersistenceDatabaseException { 130 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 131 } 132 133 public TaxDetailValue getTaxDetailValue() { 134 return _value; 135 } 136 137 public void setTaxDetailValue(TaxDetailValue value) 138 throws PersistenceReadOnlyException { 139 checkReadWrite(); 140 _value = value; 141 } 142 143 @Override 144 public TaxDetailPK getPrimaryKey() { 145 return _pk; 146 } 147 148 public TaxPK getTaxPK() { 149 return _value.getTaxPK(); 150 } 151 152 public Tax getTax(Session session, EntityPermission entityPermission) { 153 return TaxFactory.getInstance().getEntityFromPK(session, entityPermission, getTaxPK()); 154 } 155 156 public Tax getTax(EntityPermission entityPermission) { 157 return getTax(ThreadSession.currentSession(), entityPermission); 158 } 159 160 public Tax getTax(Session session) { 161 return getTax(session, EntityPermission.READ_ONLY); 162 } 163 164 public Tax getTax() { 165 return getTax(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 166 } 167 168 public Tax getTaxForUpdate(Session session) { 169 return getTax(session, EntityPermission.READ_WRITE); 170 } 171 172 public Tax getTaxForUpdate() { 173 return getTax(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 174 } 175 176 public void setTaxPK(TaxPK taxPK) 177 throws PersistenceNotNullException, PersistenceReadOnlyException { 178 checkReadWrite(); 179 _value.setTaxPK(taxPK); 180 } 181 182 public void setTax(Tax entity) { 183 setTaxPK(entity == null? null: entity.getPrimaryKey()); 184 } 185 186 public boolean getTaxPKHasBeenModified() { 187 return _value.getTaxPKHasBeenModified(); 188 } 189 190 public String getTaxName() { 191 return _value.getTaxName(); 192 } 193 194 public void setTaxName(String taxName) 195 throws PersistenceNotNullException, PersistenceReadOnlyException { 196 checkReadWrite(); 197 _value.setTaxName(taxName); 198 } 199 200 public boolean getTaxNameHasBeenModified() { 201 return _value.getTaxNameHasBeenModified(); 202 } 203 204 public ContactMechanismPurposePK getContactMechanismPurposePK() { 205 return _value.getContactMechanismPurposePK(); 206 } 207 208 public ContactMechanismPurpose getContactMechanismPurpose(Session session, EntityPermission entityPermission) { 209 return ContactMechanismPurposeFactory.getInstance().getEntityFromPK(session, entityPermission, getContactMechanismPurposePK()); 210 } 211 212 public ContactMechanismPurpose getContactMechanismPurpose(EntityPermission entityPermission) { 213 return getContactMechanismPurpose(ThreadSession.currentSession(), entityPermission); 214 } 215 216 public ContactMechanismPurpose getContactMechanismPurpose(Session session) { 217 return getContactMechanismPurpose(session, EntityPermission.READ_ONLY); 218 } 219 220 public ContactMechanismPurpose getContactMechanismPurpose() { 221 return getContactMechanismPurpose(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 222 } 223 224 public ContactMechanismPurpose getContactMechanismPurposeForUpdate(Session session) { 225 return getContactMechanismPurpose(session, EntityPermission.READ_WRITE); 226 } 227 228 public ContactMechanismPurpose getContactMechanismPurposeForUpdate() { 229 return getContactMechanismPurpose(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 230 } 231 232 public void setContactMechanismPurposePK(ContactMechanismPurposePK contactMechanismPurposePK) 233 throws PersistenceNotNullException, PersistenceReadOnlyException { 234 checkReadWrite(); 235 _value.setContactMechanismPurposePK(contactMechanismPurposePK); 236 } 237 238 public void setContactMechanismPurpose(ContactMechanismPurpose entity) { 239 setContactMechanismPurposePK(entity == null? null: entity.getPrimaryKey()); 240 } 241 242 public boolean getContactMechanismPurposePKHasBeenModified() { 243 return _value.getContactMechanismPurposePKHasBeenModified(); 244 } 245 246 public GlAccountPK getGlAccountPK() { 247 return _value.getGlAccountPK(); 248 } 249 250 public GlAccount getGlAccount(Session session, EntityPermission entityPermission) { 251 return GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, getGlAccountPK()); 252 } 253 254 public GlAccount getGlAccount(EntityPermission entityPermission) { 255 return getGlAccount(ThreadSession.currentSession(), entityPermission); 256 } 257 258 public GlAccount getGlAccount(Session session) { 259 return getGlAccount(session, EntityPermission.READ_ONLY); 260 } 261 262 public GlAccount getGlAccount() { 263 return getGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 264 } 265 266 public GlAccount getGlAccountForUpdate(Session session) { 267 return getGlAccount(session, EntityPermission.READ_WRITE); 268 } 269 270 public GlAccount getGlAccountForUpdate() { 271 return getGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 272 } 273 274 public void setGlAccountPK(GlAccountPK glAccountPK) 275 throws PersistenceNotNullException, PersistenceReadOnlyException { 276 checkReadWrite(); 277 _value.setGlAccountPK(glAccountPK); 278 } 279 280 public void setGlAccount(GlAccount entity) { 281 setGlAccountPK(entity == null? null: entity.getPrimaryKey()); 282 } 283 284 public boolean getGlAccountPKHasBeenModified() { 285 return _value.getGlAccountPKHasBeenModified(); 286 } 287 288 public Boolean getIncludeShippingCharge() { 289 return _value.getIncludeShippingCharge(); 290 } 291 292 public void setIncludeShippingCharge(Boolean includeShippingCharge) 293 throws PersistenceNotNullException, PersistenceReadOnlyException { 294 checkReadWrite(); 295 _value.setIncludeShippingCharge(includeShippingCharge); 296 } 297 298 public boolean getIncludeShippingChargeHasBeenModified() { 299 return _value.getIncludeShippingChargeHasBeenModified(); 300 } 301 302 public Boolean getIncludeProcessingCharge() { 303 return _value.getIncludeProcessingCharge(); 304 } 305 306 public void setIncludeProcessingCharge(Boolean includeProcessingCharge) 307 throws PersistenceNotNullException, PersistenceReadOnlyException { 308 checkReadWrite(); 309 _value.setIncludeProcessingCharge(includeProcessingCharge); 310 } 311 312 public boolean getIncludeProcessingChargeHasBeenModified() { 313 return _value.getIncludeProcessingChargeHasBeenModified(); 314 } 315 316 public Boolean getIncludeInsuranceCharge() { 317 return _value.getIncludeInsuranceCharge(); 318 } 319 320 public void setIncludeInsuranceCharge(Boolean includeInsuranceCharge) 321 throws PersistenceNotNullException, PersistenceReadOnlyException { 322 checkReadWrite(); 323 _value.setIncludeInsuranceCharge(includeInsuranceCharge); 324 } 325 326 public boolean getIncludeInsuranceChargeHasBeenModified() { 327 return _value.getIncludeInsuranceChargeHasBeenModified(); 328 } 329 330 public Integer getPercent() { 331 return _value.getPercent(); 332 } 333 334 public void setPercent(Integer percent) 335 throws PersistenceNotNullException, PersistenceReadOnlyException { 336 checkReadWrite(); 337 _value.setPercent(percent); 338 } 339 340 public boolean getPercentHasBeenModified() { 341 return _value.getPercentHasBeenModified(); 342 } 343 344 public Boolean getIsDefault() { 345 return _value.getIsDefault(); 346 } 347 348 public void setIsDefault(Boolean isDefault) 349 throws PersistenceNotNullException, PersistenceReadOnlyException { 350 checkReadWrite(); 351 _value.setIsDefault(isDefault); 352 } 353 354 public boolean getIsDefaultHasBeenModified() { 355 return _value.getIsDefaultHasBeenModified(); 356 } 357 358 public Integer getSortOrder() { 359 return _value.getSortOrder(); 360 } 361 362 public void setSortOrder(Integer sortOrder) 363 throws PersistenceNotNullException, PersistenceReadOnlyException { 364 checkReadWrite(); 365 _value.setSortOrder(sortOrder); 366 } 367 368 public boolean getSortOrderHasBeenModified() { 369 return _value.getSortOrderHasBeenModified(); 370 } 371 372 public Long getFromTime() { 373 return _value.getFromTime(); 374 } 375 376 public void setFromTime(Long fromTime) 377 throws PersistenceNotNullException, PersistenceReadOnlyException { 378 checkReadWrite(); 379 _value.setFromTime(fromTime); 380 } 381 382 public boolean getFromTimeHasBeenModified() { 383 return _value.getFromTimeHasBeenModified(); 384 } 385 386 public Long getThruTime() { 387 return _value.getThruTime(); 388 } 389 390 public void setThruTime(Long thruTime) 391 throws PersistenceNotNullException, PersistenceReadOnlyException { 392 checkReadWrite(); 393 _value.setThruTime(thruTime); 394 } 395 396 public boolean getThruTimeHasBeenModified() { 397 return _value.getThruTimeHasBeenModified(); 398 } 399 400}