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 * PaymentMethodDetail.java 021 */ 022 023package com.echothree.model.data.payment.server.entity; 024 025import com.echothree.model.data.payment.common.pk.PaymentMethodDetailPK; 026 027import com.echothree.model.data.payment.common.pk.PaymentMethodPK; 028import com.echothree.model.data.payment.common.pk.PaymentMethodTypePK; 029import com.echothree.model.data.payment.common.pk.PaymentProcessorPK; 030import com.echothree.model.data.selector.common.pk.SelectorPK; 031 032import com.echothree.model.data.payment.server.entity.PaymentMethod; 033import com.echothree.model.data.payment.server.entity.PaymentMethodType; 034import com.echothree.model.data.payment.server.entity.PaymentProcessor; 035import com.echothree.model.data.selector.server.entity.Selector; 036 037import com.echothree.model.data.payment.server.factory.PaymentMethodFactory; 038import com.echothree.model.data.payment.server.factory.PaymentMethodTypeFactory; 039import com.echothree.model.data.payment.server.factory.PaymentProcessorFactory; 040import com.echothree.model.data.selector.server.factory.SelectorFactory; 041 042import com.echothree.model.data.payment.common.pk.PaymentMethodDetailPK; 043 044import com.echothree.model.data.payment.server.value.PaymentMethodDetailValue; 045 046import com.echothree.model.data.payment.server.factory.PaymentMethodDetailFactory; 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 PaymentMethodDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private PaymentMethodDetailPK _pk; 069 private PaymentMethodDetailValue _value; 070 071 /** Creates a new instance of PaymentMethodDetail */ 072 public PaymentMethodDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of PaymentMethodDetail */ 078 public PaymentMethodDetail(PaymentMethodDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public PaymentMethodDetailFactory getBaseFactoryInstance() { 087 return PaymentMethodDetailFactory.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 PaymentMethodDetail that) { 111 PaymentMethodDetailValue thatValue = that.getPaymentMethodDetailValue(); 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 PaymentMethodDetailValue getPaymentMethodDetailValue() { 137 return _value; 138 } 139 140 public void setPaymentMethodDetailValue(PaymentMethodDetailValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public PaymentMethodDetailPK getPrimaryKey() { 148 return _pk; 149 } 150 151 public PaymentMethodPK getPaymentMethodPK() { 152 return _value.getPaymentMethodPK(); 153 } 154 155 public PaymentMethod getPaymentMethod(Session session, EntityPermission entityPermission) { 156 return PaymentMethodFactory.getInstance().getEntityFromPK(session, entityPermission, getPaymentMethodPK()); 157 } 158 159 public PaymentMethod getPaymentMethod(EntityPermission entityPermission) { 160 return getPaymentMethod(ThreadSession.currentSession(), entityPermission); 161 } 162 163 public PaymentMethod getPaymentMethod(Session session) { 164 return getPaymentMethod(session, EntityPermission.READ_ONLY); 165 } 166 167 public PaymentMethod getPaymentMethod() { 168 return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 169 } 170 171 public PaymentMethod getPaymentMethodForUpdate(Session session) { 172 return getPaymentMethod(session, EntityPermission.READ_WRITE); 173 } 174 175 public PaymentMethod getPaymentMethodForUpdate() { 176 return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 177 } 178 179 public void setPaymentMethodPK(PaymentMethodPK paymentMethodPK) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setPaymentMethodPK(paymentMethodPK); 183 } 184 185 public void setPaymentMethod(PaymentMethod entity) { 186 setPaymentMethodPK(entity == null? null: entity.getPrimaryKey()); 187 } 188 189 public boolean getPaymentMethodPKHasBeenModified() { 190 return _value.getPaymentMethodPKHasBeenModified(); 191 } 192 193 public String getPaymentMethodName() { 194 return _value.getPaymentMethodName(); 195 } 196 197 public void setPaymentMethodName(String paymentMethodName) 198 throws PersistenceNotNullException, PersistenceReadOnlyException { 199 checkReadWrite(); 200 _value.setPaymentMethodName(paymentMethodName); 201 } 202 203 public boolean getPaymentMethodNameHasBeenModified() { 204 return _value.getPaymentMethodNameHasBeenModified(); 205 } 206 207 public PaymentMethodTypePK getPaymentMethodTypePK() { 208 return _value.getPaymentMethodTypePK(); 209 } 210 211 public PaymentMethodType getPaymentMethodType(Session session, EntityPermission entityPermission) { 212 return PaymentMethodTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getPaymentMethodTypePK()); 213 } 214 215 public PaymentMethodType getPaymentMethodType(EntityPermission entityPermission) { 216 return getPaymentMethodType(ThreadSession.currentSession(), entityPermission); 217 } 218 219 public PaymentMethodType getPaymentMethodType(Session session) { 220 return getPaymentMethodType(session, EntityPermission.READ_ONLY); 221 } 222 223 public PaymentMethodType getPaymentMethodType() { 224 return getPaymentMethodType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 225 } 226 227 public PaymentMethodType getPaymentMethodTypeForUpdate(Session session) { 228 return getPaymentMethodType(session, EntityPermission.READ_WRITE); 229 } 230 231 public PaymentMethodType getPaymentMethodTypeForUpdate() { 232 return getPaymentMethodType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 233 } 234 235 public void setPaymentMethodTypePK(PaymentMethodTypePK paymentMethodTypePK) 236 throws PersistenceNotNullException, PersistenceReadOnlyException { 237 checkReadWrite(); 238 _value.setPaymentMethodTypePK(paymentMethodTypePK); 239 } 240 241 public void setPaymentMethodType(PaymentMethodType entity) { 242 setPaymentMethodTypePK(entity == null? null: entity.getPrimaryKey()); 243 } 244 245 public boolean getPaymentMethodTypePKHasBeenModified() { 246 return _value.getPaymentMethodTypePKHasBeenModified(); 247 } 248 249 public PaymentProcessorPK getPaymentProcessorPK() { 250 return _value.getPaymentProcessorPK(); 251 } 252 253 public PaymentProcessor getPaymentProcessor(Session session, EntityPermission entityPermission) { 254 PaymentProcessorPK pk = getPaymentProcessorPK(); 255 PaymentProcessor entity = pk == null? null: PaymentProcessorFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 256 257 return entity; 258 } 259 260 public PaymentProcessor getPaymentProcessor(EntityPermission entityPermission) { 261 return getPaymentProcessor(ThreadSession.currentSession(), entityPermission); 262 } 263 264 public PaymentProcessor getPaymentProcessor(Session session) { 265 return getPaymentProcessor(session, EntityPermission.READ_ONLY); 266 } 267 268 public PaymentProcessor getPaymentProcessor() { 269 return getPaymentProcessor(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 270 } 271 272 public PaymentProcessor getPaymentProcessorForUpdate(Session session) { 273 return getPaymentProcessor(session, EntityPermission.READ_WRITE); 274 } 275 276 public PaymentProcessor getPaymentProcessorForUpdate() { 277 return getPaymentProcessor(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 278 } 279 280 public void setPaymentProcessorPK(PaymentProcessorPK paymentProcessorPK) 281 throws PersistenceNotNullException, PersistenceReadOnlyException { 282 checkReadWrite(); 283 _value.setPaymentProcessorPK(paymentProcessorPK); 284 } 285 286 public void setPaymentProcessor(PaymentProcessor entity) { 287 setPaymentProcessorPK(entity == null? null: entity.getPrimaryKey()); 288 } 289 290 public boolean getPaymentProcessorPKHasBeenModified() { 291 return _value.getPaymentProcessorPKHasBeenModified(); 292 } 293 294 public SelectorPK getItemSelectorPK() { 295 return _value.getItemSelectorPK(); 296 } 297 298 public Selector getItemSelector(Session session, EntityPermission entityPermission) { 299 SelectorPK pk = getItemSelectorPK(); 300 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 301 302 return entity; 303 } 304 305 public Selector getItemSelector(EntityPermission entityPermission) { 306 return getItemSelector(ThreadSession.currentSession(), entityPermission); 307 } 308 309 public Selector getItemSelector(Session session) { 310 return getItemSelector(session, EntityPermission.READ_ONLY); 311 } 312 313 public Selector getItemSelector() { 314 return getItemSelector(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 315 } 316 317 public Selector getItemSelectorForUpdate(Session session) { 318 return getItemSelector(session, EntityPermission.READ_WRITE); 319 } 320 321 public Selector getItemSelectorForUpdate() { 322 return getItemSelector(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 323 } 324 325 public void setItemSelectorPK(SelectorPK itemSelectorPK) 326 throws PersistenceNotNullException, PersistenceReadOnlyException { 327 checkReadWrite(); 328 _value.setItemSelectorPK(itemSelectorPK); 329 } 330 331 public void setItemSelector(Selector entity) { 332 setItemSelectorPK(entity == null? null: entity.getPrimaryKey()); 333 } 334 335 public boolean getItemSelectorPKHasBeenModified() { 336 return _value.getItemSelectorPKHasBeenModified(); 337 } 338 339 public SelectorPK getSalesOrderItemSelectorPK() { 340 return _value.getSalesOrderItemSelectorPK(); 341 } 342 343 public Selector getSalesOrderItemSelector(Session session, EntityPermission entityPermission) { 344 SelectorPK pk = getSalesOrderItemSelectorPK(); 345 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 346 347 return entity; 348 } 349 350 public Selector getSalesOrderItemSelector(EntityPermission entityPermission) { 351 return getSalesOrderItemSelector(ThreadSession.currentSession(), entityPermission); 352 } 353 354 public Selector getSalesOrderItemSelector(Session session) { 355 return getSalesOrderItemSelector(session, EntityPermission.READ_ONLY); 356 } 357 358 public Selector getSalesOrderItemSelector() { 359 return getSalesOrderItemSelector(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 360 } 361 362 public Selector getSalesOrderItemSelectorForUpdate(Session session) { 363 return getSalesOrderItemSelector(session, EntityPermission.READ_WRITE); 364 } 365 366 public Selector getSalesOrderItemSelectorForUpdate() { 367 return getSalesOrderItemSelector(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 368 } 369 370 public void setSalesOrderItemSelectorPK(SelectorPK salesOrderItemSelectorPK) 371 throws PersistenceNotNullException, PersistenceReadOnlyException { 372 checkReadWrite(); 373 _value.setSalesOrderItemSelectorPK(salesOrderItemSelectorPK); 374 } 375 376 public void setSalesOrderItemSelector(Selector entity) { 377 setSalesOrderItemSelectorPK(entity == null? null: entity.getPrimaryKey()); 378 } 379 380 public boolean getSalesOrderItemSelectorPKHasBeenModified() { 381 return _value.getSalesOrderItemSelectorPKHasBeenModified(); 382 } 383 384 public Boolean getIsDefault() { 385 return _value.getIsDefault(); 386 } 387 388 public void setIsDefault(Boolean isDefault) 389 throws PersistenceNotNullException, PersistenceReadOnlyException { 390 checkReadWrite(); 391 _value.setIsDefault(isDefault); 392 } 393 394 public boolean getIsDefaultHasBeenModified() { 395 return _value.getIsDefaultHasBeenModified(); 396 } 397 398 public Integer getSortOrder() { 399 return _value.getSortOrder(); 400 } 401 402 public void setSortOrder(Integer sortOrder) 403 throws PersistenceNotNullException, PersistenceReadOnlyException { 404 checkReadWrite(); 405 _value.setSortOrder(sortOrder); 406 } 407 408 public boolean getSortOrderHasBeenModified() { 409 return _value.getSortOrderHasBeenModified(); 410 } 411 412 public Long getFromTime() { 413 return _value.getFromTime(); 414 } 415 416 public void setFromTime(Long fromTime) 417 throws PersistenceNotNullException, PersistenceReadOnlyException { 418 checkReadWrite(); 419 _value.setFromTime(fromTime); 420 } 421 422 public boolean getFromTimeHasBeenModified() { 423 return _value.getFromTimeHasBeenModified(); 424 } 425 426 public Long getThruTime() { 427 return _value.getThruTime(); 428 } 429 430 public void setThruTime(Long thruTime) 431 throws PersistenceNotNullException, PersistenceReadOnlyException { 432 checkReadWrite(); 433 _value.setThruTime(thruTime); 434 } 435 436 public boolean getThruTimeHasBeenModified() { 437 return _value.getThruTimeHasBeenModified(); 438 } 439 440}