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 * PartyDetail.java 021 */ 022 023package com.echothree.model.data.party.server.entity; 024 025import com.echothree.model.data.party.common.pk.PartyDetailPK; 026 027import com.echothree.model.data.party.common.pk.PartyPK; 028import com.echothree.model.data.party.common.pk.PartyTypePK; 029import com.echothree.model.data.party.common.pk.LanguagePK; 030import com.echothree.model.data.accounting.common.pk.CurrencyPK; 031import com.echothree.model.data.party.common.pk.TimeZonePK; 032import com.echothree.model.data.party.common.pk.DateTimeFormatPK; 033 034import com.echothree.model.data.party.server.entity.Party; 035import com.echothree.model.data.party.server.entity.PartyType; 036import com.echothree.model.data.party.server.entity.Language; 037import com.echothree.model.data.accounting.server.entity.Currency; 038import com.echothree.model.data.party.server.entity.TimeZone; 039import com.echothree.model.data.party.server.entity.DateTimeFormat; 040 041import com.echothree.model.data.party.server.factory.PartyFactory; 042import com.echothree.model.data.party.server.factory.PartyTypeFactory; 043import com.echothree.model.data.party.server.factory.LanguageFactory; 044import com.echothree.model.data.accounting.server.factory.CurrencyFactory; 045import com.echothree.model.data.party.server.factory.TimeZoneFactory; 046import com.echothree.model.data.party.server.factory.DateTimeFormatFactory; 047 048import com.echothree.model.data.party.common.pk.PartyDetailPK; 049 050import com.echothree.model.data.party.server.value.PartyDetailValue; 051 052import com.echothree.model.data.party.server.factory.PartyDetailFactory; 053 054import com.echothree.util.common.exception.PersistenceException; 055import com.echothree.util.common.exception.PersistenceDatabaseException; 056import com.echothree.util.common.exception.PersistenceNotNullException; 057import com.echothree.util.common.exception.PersistenceReadOnlyException; 058 059import com.echothree.util.common.persistence.BasePK; 060 061import com.echothree.util.common.persistence.type.ByteArray; 062 063import com.echothree.util.server.persistence.BaseEntity; 064import com.echothree.util.server.persistence.EntityPermission; 065import com.echothree.util.server.persistence.Session; 066import com.echothree.util.server.persistence.ThreadSession; 067 068import java.io.Serializable; 069 070public class PartyDetail 071 extends BaseEntity 072 implements Serializable { 073 074 private PartyDetailPK _pk; 075 private PartyDetailValue _value; 076 077 /** Creates a new instance of PartyDetail */ 078 public PartyDetail() 079 throws PersistenceException { 080 super(); 081 } 082 083 /** Creates a new instance of PartyDetail */ 084 public PartyDetail(PartyDetailValue value, EntityPermission entityPermission) { 085 super(entityPermission); 086 087 _value = value; 088 _pk = value.getPrimaryKey(); 089 } 090 091 @Override 092 public PartyDetailFactory getBaseFactoryInstance() { 093 return PartyDetailFactory.getInstance(); 094 } 095 096 @Override 097 public boolean hasBeenModified() { 098 return _value.hasBeenModified(); 099 } 100 101 @Override 102 public int hashCode() { 103 return _pk.hashCode(); 104 } 105 106 @Override 107 public String toString() { 108 return _pk.toString(); 109 } 110 111 @Override 112 public boolean equals(Object other) { 113 if(this == other) 114 return true; 115 116 if(other instanceof PartyDetail that) { 117 PartyDetailValue thatValue = that.getPartyDetailValue(); 118 return _value.equals(thatValue); 119 } else { 120 return false; 121 } 122 } 123 124 @Override 125 public void store(Session session) 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().store(session, this); 128 } 129 130 @Override 131 public void remove(Session session) 132 throws PersistenceDatabaseException { 133 getBaseFactoryInstance().remove(session, this); 134 } 135 136 @Override 137 public void remove() 138 throws PersistenceDatabaseException { 139 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 140 } 141 142 public PartyDetailValue getPartyDetailValue() { 143 return _value; 144 } 145 146 public void setPartyDetailValue(PartyDetailValue value) 147 throws PersistenceReadOnlyException { 148 checkReadWrite(); 149 _value = value; 150 } 151 152 @Override 153 public PartyDetailPK getPrimaryKey() { 154 return _pk; 155 } 156 157 public PartyPK getPartyPK() { 158 return _value.getPartyPK(); 159 } 160 161 public Party getParty(Session session, EntityPermission entityPermission) { 162 return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyPK()); 163 } 164 165 public Party getParty(EntityPermission entityPermission) { 166 return getParty(ThreadSession.currentSession(), entityPermission); 167 } 168 169 public Party getParty(Session session) { 170 return getParty(session, EntityPermission.READ_ONLY); 171 } 172 173 public Party getParty() { 174 return getParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 175 } 176 177 public Party getPartyForUpdate(Session session) { 178 return getParty(session, EntityPermission.READ_WRITE); 179 } 180 181 public Party getPartyForUpdate() { 182 return getParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 183 } 184 185 public void setPartyPK(PartyPK partyPK) 186 throws PersistenceNotNullException, PersistenceReadOnlyException { 187 checkReadWrite(); 188 _value.setPartyPK(partyPK); 189 } 190 191 public void setParty(Party entity) { 192 setPartyPK(entity == null? null: entity.getPrimaryKey()); 193 } 194 195 public boolean getPartyPKHasBeenModified() { 196 return _value.getPartyPKHasBeenModified(); 197 } 198 199 public String getPartyName() { 200 return _value.getPartyName(); 201 } 202 203 public void setPartyName(String partyName) 204 throws PersistenceNotNullException, PersistenceReadOnlyException { 205 checkReadWrite(); 206 _value.setPartyName(partyName); 207 } 208 209 public boolean getPartyNameHasBeenModified() { 210 return _value.getPartyNameHasBeenModified(); 211 } 212 213 public PartyTypePK getPartyTypePK() { 214 return _value.getPartyTypePK(); 215 } 216 217 public PartyType getPartyType(Session session, EntityPermission entityPermission) { 218 return PartyTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyTypePK()); 219 } 220 221 public PartyType getPartyType(EntityPermission entityPermission) { 222 return getPartyType(ThreadSession.currentSession(), entityPermission); 223 } 224 225 public PartyType getPartyType(Session session) { 226 return getPartyType(session, EntityPermission.READ_ONLY); 227 } 228 229 public PartyType getPartyType() { 230 return getPartyType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 231 } 232 233 public PartyType getPartyTypeForUpdate(Session session) { 234 return getPartyType(session, EntityPermission.READ_WRITE); 235 } 236 237 public PartyType getPartyTypeForUpdate() { 238 return getPartyType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 239 } 240 241 public void setPartyTypePK(PartyTypePK partyTypePK) 242 throws PersistenceNotNullException, PersistenceReadOnlyException { 243 checkReadWrite(); 244 _value.setPartyTypePK(partyTypePK); 245 } 246 247 public void setPartyType(PartyType entity) { 248 setPartyTypePK(entity == null? null: entity.getPrimaryKey()); 249 } 250 251 public boolean getPartyTypePKHasBeenModified() { 252 return _value.getPartyTypePKHasBeenModified(); 253 } 254 255 public LanguagePK getPreferredLanguagePK() { 256 return _value.getPreferredLanguagePK(); 257 } 258 259 public Language getPreferredLanguage(Session session, EntityPermission entityPermission) { 260 LanguagePK pk = getPreferredLanguagePK(); 261 Language entity = pk == null? null: LanguageFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 262 263 return entity; 264 } 265 266 public Language getPreferredLanguage(EntityPermission entityPermission) { 267 return getPreferredLanguage(ThreadSession.currentSession(), entityPermission); 268 } 269 270 public Language getPreferredLanguage(Session session) { 271 return getPreferredLanguage(session, EntityPermission.READ_ONLY); 272 } 273 274 public Language getPreferredLanguage() { 275 return getPreferredLanguage(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 276 } 277 278 public Language getPreferredLanguageForUpdate(Session session) { 279 return getPreferredLanguage(session, EntityPermission.READ_WRITE); 280 } 281 282 public Language getPreferredLanguageForUpdate() { 283 return getPreferredLanguage(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 284 } 285 286 public void setPreferredLanguagePK(LanguagePK preferredLanguagePK) 287 throws PersistenceNotNullException, PersistenceReadOnlyException { 288 checkReadWrite(); 289 _value.setPreferredLanguagePK(preferredLanguagePK); 290 } 291 292 public void setPreferredLanguage(Language entity) { 293 setPreferredLanguagePK(entity == null? null: entity.getPrimaryKey()); 294 } 295 296 public boolean getPreferredLanguagePKHasBeenModified() { 297 return _value.getPreferredLanguagePKHasBeenModified(); 298 } 299 300 public CurrencyPK getPreferredCurrencyPK() { 301 return _value.getPreferredCurrencyPK(); 302 } 303 304 public Currency getPreferredCurrency(Session session, EntityPermission entityPermission) { 305 CurrencyPK pk = getPreferredCurrencyPK(); 306 Currency entity = pk == null? null: CurrencyFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 307 308 return entity; 309 } 310 311 public Currency getPreferredCurrency(EntityPermission entityPermission) { 312 return getPreferredCurrency(ThreadSession.currentSession(), entityPermission); 313 } 314 315 public Currency getPreferredCurrency(Session session) { 316 return getPreferredCurrency(session, EntityPermission.READ_ONLY); 317 } 318 319 public Currency getPreferredCurrency() { 320 return getPreferredCurrency(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 321 } 322 323 public Currency getPreferredCurrencyForUpdate(Session session) { 324 return getPreferredCurrency(session, EntityPermission.READ_WRITE); 325 } 326 327 public Currency getPreferredCurrencyForUpdate() { 328 return getPreferredCurrency(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 329 } 330 331 public void setPreferredCurrencyPK(CurrencyPK preferredCurrencyPK) 332 throws PersistenceNotNullException, PersistenceReadOnlyException { 333 checkReadWrite(); 334 _value.setPreferredCurrencyPK(preferredCurrencyPK); 335 } 336 337 public void setPreferredCurrency(Currency entity) { 338 setPreferredCurrencyPK(entity == null? null: entity.getPrimaryKey()); 339 } 340 341 public boolean getPreferredCurrencyPKHasBeenModified() { 342 return _value.getPreferredCurrencyPKHasBeenModified(); 343 } 344 345 public TimeZonePK getPreferredTimeZonePK() { 346 return _value.getPreferredTimeZonePK(); 347 } 348 349 public TimeZone getPreferredTimeZone(Session session, EntityPermission entityPermission) { 350 TimeZonePK pk = getPreferredTimeZonePK(); 351 TimeZone entity = pk == null? null: TimeZoneFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 352 353 return entity; 354 } 355 356 public TimeZone getPreferredTimeZone(EntityPermission entityPermission) { 357 return getPreferredTimeZone(ThreadSession.currentSession(), entityPermission); 358 } 359 360 public TimeZone getPreferredTimeZone(Session session) { 361 return getPreferredTimeZone(session, EntityPermission.READ_ONLY); 362 } 363 364 public TimeZone getPreferredTimeZone() { 365 return getPreferredTimeZone(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 366 } 367 368 public TimeZone getPreferredTimeZoneForUpdate(Session session) { 369 return getPreferredTimeZone(session, EntityPermission.READ_WRITE); 370 } 371 372 public TimeZone getPreferredTimeZoneForUpdate() { 373 return getPreferredTimeZone(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 374 } 375 376 public void setPreferredTimeZonePK(TimeZonePK preferredTimeZonePK) 377 throws PersistenceNotNullException, PersistenceReadOnlyException { 378 checkReadWrite(); 379 _value.setPreferredTimeZonePK(preferredTimeZonePK); 380 } 381 382 public void setPreferredTimeZone(TimeZone entity) { 383 setPreferredTimeZonePK(entity == null? null: entity.getPrimaryKey()); 384 } 385 386 public boolean getPreferredTimeZonePKHasBeenModified() { 387 return _value.getPreferredTimeZonePKHasBeenModified(); 388 } 389 390 public DateTimeFormatPK getPreferredDateTimeFormatPK() { 391 return _value.getPreferredDateTimeFormatPK(); 392 } 393 394 public DateTimeFormat getPreferredDateTimeFormat(Session session, EntityPermission entityPermission) { 395 DateTimeFormatPK pk = getPreferredDateTimeFormatPK(); 396 DateTimeFormat entity = pk == null? null: DateTimeFormatFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 397 398 return entity; 399 } 400 401 public DateTimeFormat getPreferredDateTimeFormat(EntityPermission entityPermission) { 402 return getPreferredDateTimeFormat(ThreadSession.currentSession(), entityPermission); 403 } 404 405 public DateTimeFormat getPreferredDateTimeFormat(Session session) { 406 return getPreferredDateTimeFormat(session, EntityPermission.READ_ONLY); 407 } 408 409 public DateTimeFormat getPreferredDateTimeFormat() { 410 return getPreferredDateTimeFormat(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 411 } 412 413 public DateTimeFormat getPreferredDateTimeFormatForUpdate(Session session) { 414 return getPreferredDateTimeFormat(session, EntityPermission.READ_WRITE); 415 } 416 417 public DateTimeFormat getPreferredDateTimeFormatForUpdate() { 418 return getPreferredDateTimeFormat(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 419 } 420 421 public void setPreferredDateTimeFormatPK(DateTimeFormatPK preferredDateTimeFormatPK) 422 throws PersistenceNotNullException, PersistenceReadOnlyException { 423 checkReadWrite(); 424 _value.setPreferredDateTimeFormatPK(preferredDateTimeFormatPK); 425 } 426 427 public void setPreferredDateTimeFormat(DateTimeFormat entity) { 428 setPreferredDateTimeFormatPK(entity == null? null: entity.getPrimaryKey()); 429 } 430 431 public boolean getPreferredDateTimeFormatPKHasBeenModified() { 432 return _value.getPreferredDateTimeFormatPKHasBeenModified(); 433 } 434 435 public Long getFromTime() { 436 return _value.getFromTime(); 437 } 438 439 public void setFromTime(Long fromTime) 440 throws PersistenceNotNullException, PersistenceReadOnlyException { 441 checkReadWrite(); 442 _value.setFromTime(fromTime); 443 } 444 445 public boolean getFromTimeHasBeenModified() { 446 return _value.getFromTimeHasBeenModified(); 447 } 448 449 public Long getThruTime() { 450 return _value.getThruTime(); 451 } 452 453 public void setThruTime(Long thruTime) 454 throws PersistenceNotNullException, PersistenceReadOnlyException { 455 checkReadWrite(); 456 _value.setThruTime(thruTime); 457 } 458 459 public boolean getThruTimeHasBeenModified() { 460 return _value.getThruTimeHasBeenModified(); 461 } 462 463}