001// -------------------------------------------------------------------------------- 002// Copyright 2002-2026 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 064import javax.annotation.Nonnull; 065import javax.annotation.Nullable; 066 067public class PaymentMethodDetail 068 extends BaseEntity 069 implements Serializable { 070 071 private PaymentMethodDetailPK _pk; 072 private PaymentMethodDetailValue _value; 073 074 /** Creates a new instance of PaymentMethodDetail */ 075 public PaymentMethodDetail() 076 throws PersistenceException { 077 super(); 078 } 079 080 /** Creates a new instance of PaymentMethodDetail */ 081 public PaymentMethodDetail(PaymentMethodDetailValue value, EntityPermission entityPermission) { 082 super(entityPermission); 083 084 _value = value; 085 _pk = value.getPrimaryKey(); 086 } 087 088 @Override 089 @Nonnull 090 public PaymentMethodDetailFactory getBaseFactoryInstance() { 091 return PaymentMethodDetailFactory.getInstance(); 092 } 093 094 @Override 095 public boolean hasBeenModified() { 096 return _value.hasBeenModified(); 097 } 098 099 @Override 100 public int hashCode() { 101 return _pk.hashCode(); 102 } 103 104 @Override 105 @Nonnull 106 public String toString() { 107 return _pk.toString(); 108 } 109 110 @Override 111 public boolean equals(Object other) { 112 if(this == other) 113 return true; 114 115 if(other instanceof PaymentMethodDetail that) { 116 PaymentMethodDetailValue thatValue = that.getPaymentMethodDetailValue(); 117 return _value.equals(thatValue); 118 } else { 119 return false; 120 } 121 } 122 123 @Override 124 public void store() 125 throws PersistenceDatabaseException { 126 getBaseFactoryInstance().store(this); 127 } 128 129 @Override 130 public void remove() 131 throws PersistenceDatabaseException { 132 getBaseFactoryInstance().remove(this); 133 } 134 135 @Nonnull 136 public PaymentMethodDetailValue getPaymentMethodDetailValue() { 137 return _value; 138 } 139 140 public void setPaymentMethodDetailValue(@Nonnull PaymentMethodDetailValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 @Nonnull 148 public PaymentMethodDetailPK getPrimaryKey() { 149 return _pk; 150 } 151 152 @Nonnull 153 public PaymentMethodPK getPaymentMethodPK() { 154 return _value.getPaymentMethodPK(); 155 } 156 157 @Nonnull 158 public PaymentMethod getPaymentMethod(EntityPermission entityPermission) { 159 return PaymentMethodFactory.getInstance().getEntityFromPK(entityPermission, getPaymentMethodPK()); 160 } 161 162 @Nonnull 163 public PaymentMethod getPaymentMethod() { 164 return getPaymentMethod(EntityPermission.READ_ONLY); 165 } 166 167 @Nonnull 168 public PaymentMethod getPaymentMethodForUpdate() { 169 return getPaymentMethod(EntityPermission.READ_WRITE); 170 } 171 172 public void setPaymentMethodPK(@Nonnull PaymentMethodPK paymentMethodPK) 173 throws PersistenceNotNullException, PersistenceReadOnlyException { 174 checkReadWrite(); 175 _value.setPaymentMethodPK(paymentMethodPK); 176 } 177 178 public void setPaymentMethod(@Nonnull PaymentMethod entity) { 179 setPaymentMethodPK(entity == null ? null : entity.getPrimaryKey()); 180 } 181 182 public boolean getPaymentMethodPKHasBeenModified() { 183 return _value.getPaymentMethodPKHasBeenModified(); 184 } 185 186 @Nonnull 187 public String getPaymentMethodName() { 188 return _value.getPaymentMethodName(); 189 } 190 191 public void setPaymentMethodName(@Nonnull String paymentMethodName) 192 throws PersistenceNotNullException, PersistenceReadOnlyException { 193 checkReadWrite(); 194 _value.setPaymentMethodName(paymentMethodName); 195 } 196 197 public boolean getPaymentMethodNameHasBeenModified() { 198 return _value.getPaymentMethodNameHasBeenModified(); 199 } 200 201 @Nonnull 202 public PaymentMethodTypePK getPaymentMethodTypePK() { 203 return _value.getPaymentMethodTypePK(); 204 } 205 206 @Nonnull 207 public PaymentMethodType getPaymentMethodType(EntityPermission entityPermission) { 208 return PaymentMethodTypeFactory.getInstance().getEntityFromPK(entityPermission, getPaymentMethodTypePK()); 209 } 210 211 @Nonnull 212 public PaymentMethodType getPaymentMethodType() { 213 return getPaymentMethodType(EntityPermission.READ_ONLY); 214 } 215 216 @Nonnull 217 public PaymentMethodType getPaymentMethodTypeForUpdate() { 218 return getPaymentMethodType(EntityPermission.READ_WRITE); 219 } 220 221 public void setPaymentMethodTypePK(@Nonnull PaymentMethodTypePK paymentMethodTypePK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setPaymentMethodTypePK(paymentMethodTypePK); 225 } 226 227 public void setPaymentMethodType(@Nonnull PaymentMethodType entity) { 228 setPaymentMethodTypePK(entity == null ? null : entity.getPrimaryKey()); 229 } 230 231 public boolean getPaymentMethodTypePKHasBeenModified() { 232 return _value.getPaymentMethodTypePKHasBeenModified(); 233 } 234 235 @Nullable 236 public PaymentProcessorPK getPaymentProcessorPK() { 237 return _value.getPaymentProcessorPK(); 238 } 239 240 @Nullable 241 public PaymentProcessor getPaymentProcessor(EntityPermission entityPermission) { 242 PaymentProcessorPK pk = getPaymentProcessorPK(); 243 PaymentProcessor entity = pk == null? null: PaymentProcessorFactory.getInstance().getEntityFromPK(entityPermission, pk); 244 245 return entity; 246 } 247 248 @Nullable 249 public PaymentProcessor getPaymentProcessor() { 250 return getPaymentProcessor(EntityPermission.READ_ONLY); 251 } 252 253 @Nullable 254 public PaymentProcessor getPaymentProcessorForUpdate() { 255 return getPaymentProcessor(EntityPermission.READ_WRITE); 256 } 257 258 public void setPaymentProcessorPK(@Nullable PaymentProcessorPK paymentProcessorPK) 259 throws PersistenceNotNullException, PersistenceReadOnlyException { 260 checkReadWrite(); 261 _value.setPaymentProcessorPK(paymentProcessorPK); 262 } 263 264 public void setPaymentProcessor(@Nullable PaymentProcessor entity) { 265 setPaymentProcessorPK(entity == null ? null : entity.getPrimaryKey()); 266 } 267 268 public boolean getPaymentProcessorPKHasBeenModified() { 269 return _value.getPaymentProcessorPKHasBeenModified(); 270 } 271 272 @Nullable 273 public SelectorPK getItemSelectorPK() { 274 return _value.getItemSelectorPK(); 275 } 276 277 @Nullable 278 public Selector getItemSelector(EntityPermission entityPermission) { 279 SelectorPK pk = getItemSelectorPK(); 280 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 281 282 return entity; 283 } 284 285 @Nullable 286 public Selector getItemSelector() { 287 return getItemSelector(EntityPermission.READ_ONLY); 288 } 289 290 @Nullable 291 public Selector getItemSelectorForUpdate() { 292 return getItemSelector(EntityPermission.READ_WRITE); 293 } 294 295 public void setItemSelectorPK(@Nullable SelectorPK itemSelectorPK) 296 throws PersistenceNotNullException, PersistenceReadOnlyException { 297 checkReadWrite(); 298 _value.setItemSelectorPK(itemSelectorPK); 299 } 300 301 public void setItemSelector(@Nullable Selector entity) { 302 setItemSelectorPK(entity == null ? null : entity.getPrimaryKey()); 303 } 304 305 public boolean getItemSelectorPKHasBeenModified() { 306 return _value.getItemSelectorPKHasBeenModified(); 307 } 308 309 @Nullable 310 public SelectorPK getSalesOrderItemSelectorPK() { 311 return _value.getSalesOrderItemSelectorPK(); 312 } 313 314 @Nullable 315 public Selector getSalesOrderItemSelector(EntityPermission entityPermission) { 316 SelectorPK pk = getSalesOrderItemSelectorPK(); 317 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 318 319 return entity; 320 } 321 322 @Nullable 323 public Selector getSalesOrderItemSelector() { 324 return getSalesOrderItemSelector(EntityPermission.READ_ONLY); 325 } 326 327 @Nullable 328 public Selector getSalesOrderItemSelectorForUpdate() { 329 return getSalesOrderItemSelector(EntityPermission.READ_WRITE); 330 } 331 332 public void setSalesOrderItemSelectorPK(@Nullable SelectorPK salesOrderItemSelectorPK) 333 throws PersistenceNotNullException, PersistenceReadOnlyException { 334 checkReadWrite(); 335 _value.setSalesOrderItemSelectorPK(salesOrderItemSelectorPK); 336 } 337 338 public void setSalesOrderItemSelector(@Nullable Selector entity) { 339 setSalesOrderItemSelectorPK(entity == null ? null : entity.getPrimaryKey()); 340 } 341 342 public boolean getSalesOrderItemSelectorPKHasBeenModified() { 343 return _value.getSalesOrderItemSelectorPKHasBeenModified(); 344 } 345 346 @Nonnull 347 public Boolean getIsDefault() { 348 return _value.getIsDefault(); 349 } 350 351 public void setIsDefault(@Nonnull Boolean isDefault) 352 throws PersistenceNotNullException, PersistenceReadOnlyException { 353 checkReadWrite(); 354 _value.setIsDefault(isDefault); 355 } 356 357 public boolean getIsDefaultHasBeenModified() { 358 return _value.getIsDefaultHasBeenModified(); 359 } 360 361 @Nonnull 362 public Integer getSortOrder() { 363 return _value.getSortOrder(); 364 } 365 366 public void setSortOrder(@Nonnull Integer sortOrder) 367 throws PersistenceNotNullException, PersistenceReadOnlyException { 368 checkReadWrite(); 369 _value.setSortOrder(sortOrder); 370 } 371 372 public boolean getSortOrderHasBeenModified() { 373 return _value.getSortOrderHasBeenModified(); 374 } 375 376 @Nonnull 377 public Long getFromTime() { 378 return _value.getFromTime(); 379 } 380 381 public void setFromTime(@Nonnull Long fromTime) 382 throws PersistenceNotNullException, PersistenceReadOnlyException { 383 checkReadWrite(); 384 _value.setFromTime(fromTime); 385 } 386 387 public boolean getFromTimeHasBeenModified() { 388 return _value.getFromTimeHasBeenModified(); 389 } 390 391 @Nonnull 392 public Long getThruTime() { 393 return _value.getThruTime(); 394 } 395 396 public void setThruTime(@Nonnull Long thruTime) 397 throws PersistenceNotNullException, PersistenceReadOnlyException { 398 checkReadWrite(); 399 _value.setThruTime(thruTime); 400 } 401 402 public boolean getThruTimeHasBeenModified() { 403 return _value.getThruTimeHasBeenModified(); 404 } 405 406}