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 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() 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().store(this); 122 } 123 124 @Override 125 public void remove() 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().remove(this); 128 } 129 130 public PaymentMethodDetailValue getPaymentMethodDetailValue() { 131 return _value; 132 } 133 134 public void setPaymentMethodDetailValue(PaymentMethodDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public PaymentMethodDetailPK getPrimaryKey() { 142 return _pk; 143 } 144 145 public PaymentMethodPK getPaymentMethodPK() { 146 return _value.getPaymentMethodPK(); 147 } 148 149 public PaymentMethod getPaymentMethod(EntityPermission entityPermission) { 150 return PaymentMethodFactory.getInstance().getEntityFromPK(entityPermission, getPaymentMethodPK()); 151 } 152 153 public PaymentMethod getPaymentMethod() { 154 return getPaymentMethod(EntityPermission.READ_ONLY); 155 } 156 157 public PaymentMethod getPaymentMethodForUpdate() { 158 return getPaymentMethod(EntityPermission.READ_WRITE); 159 } 160 161 public void setPaymentMethodPK(PaymentMethodPK paymentMethodPK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setPaymentMethodPK(paymentMethodPK); 165 } 166 167 public void setPaymentMethod(PaymentMethod entity) { 168 setPaymentMethodPK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getPaymentMethodPKHasBeenModified() { 172 return _value.getPaymentMethodPKHasBeenModified(); 173 } 174 175 public String getPaymentMethodName() { 176 return _value.getPaymentMethodName(); 177 } 178 179 public void setPaymentMethodName(String paymentMethodName) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setPaymentMethodName(paymentMethodName); 183 } 184 185 public boolean getPaymentMethodNameHasBeenModified() { 186 return _value.getPaymentMethodNameHasBeenModified(); 187 } 188 189 public PaymentMethodTypePK getPaymentMethodTypePK() { 190 return _value.getPaymentMethodTypePK(); 191 } 192 193 public PaymentMethodType getPaymentMethodType(EntityPermission entityPermission) { 194 return PaymentMethodTypeFactory.getInstance().getEntityFromPK(entityPermission, getPaymentMethodTypePK()); 195 } 196 197 public PaymentMethodType getPaymentMethodType() { 198 return getPaymentMethodType(EntityPermission.READ_ONLY); 199 } 200 201 public PaymentMethodType getPaymentMethodTypeForUpdate() { 202 return getPaymentMethodType(EntityPermission.READ_WRITE); 203 } 204 205 public void setPaymentMethodTypePK(PaymentMethodTypePK paymentMethodTypePK) 206 throws PersistenceNotNullException, PersistenceReadOnlyException { 207 checkReadWrite(); 208 _value.setPaymentMethodTypePK(paymentMethodTypePK); 209 } 210 211 public void setPaymentMethodType(PaymentMethodType entity) { 212 setPaymentMethodTypePK(entity == null? null: entity.getPrimaryKey()); 213 } 214 215 public boolean getPaymentMethodTypePKHasBeenModified() { 216 return _value.getPaymentMethodTypePKHasBeenModified(); 217 } 218 219 public PaymentProcessorPK getPaymentProcessorPK() { 220 return _value.getPaymentProcessorPK(); 221 } 222 223 public PaymentProcessor getPaymentProcessor(EntityPermission entityPermission) { 224 PaymentProcessorPK pk = getPaymentProcessorPK(); 225 PaymentProcessor entity = pk == null? null: PaymentProcessorFactory.getInstance().getEntityFromPK(entityPermission, pk); 226 227 return entity; 228 } 229 230 public PaymentProcessor getPaymentProcessor() { 231 return getPaymentProcessor(EntityPermission.READ_ONLY); 232 } 233 234 public PaymentProcessor getPaymentProcessorForUpdate() { 235 return getPaymentProcessor(EntityPermission.READ_WRITE); 236 } 237 238 public void setPaymentProcessorPK(PaymentProcessorPK paymentProcessorPK) 239 throws PersistenceNotNullException, PersistenceReadOnlyException { 240 checkReadWrite(); 241 _value.setPaymentProcessorPK(paymentProcessorPK); 242 } 243 244 public void setPaymentProcessor(PaymentProcessor entity) { 245 setPaymentProcessorPK(entity == null? null: entity.getPrimaryKey()); 246 } 247 248 public boolean getPaymentProcessorPKHasBeenModified() { 249 return _value.getPaymentProcessorPKHasBeenModified(); 250 } 251 252 public SelectorPK getItemSelectorPK() { 253 return _value.getItemSelectorPK(); 254 } 255 256 public Selector getItemSelector(EntityPermission entityPermission) { 257 SelectorPK pk = getItemSelectorPK(); 258 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 259 260 return entity; 261 } 262 263 public Selector getItemSelector() { 264 return getItemSelector(EntityPermission.READ_ONLY); 265 } 266 267 public Selector getItemSelectorForUpdate() { 268 return getItemSelector(EntityPermission.READ_WRITE); 269 } 270 271 public void setItemSelectorPK(SelectorPK itemSelectorPK) 272 throws PersistenceNotNullException, PersistenceReadOnlyException { 273 checkReadWrite(); 274 _value.setItemSelectorPK(itemSelectorPK); 275 } 276 277 public void setItemSelector(Selector entity) { 278 setItemSelectorPK(entity == null? null: entity.getPrimaryKey()); 279 } 280 281 public boolean getItemSelectorPKHasBeenModified() { 282 return _value.getItemSelectorPKHasBeenModified(); 283 } 284 285 public SelectorPK getSalesOrderItemSelectorPK() { 286 return _value.getSalesOrderItemSelectorPK(); 287 } 288 289 public Selector getSalesOrderItemSelector(EntityPermission entityPermission) { 290 SelectorPK pk = getSalesOrderItemSelectorPK(); 291 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 292 293 return entity; 294 } 295 296 public Selector getSalesOrderItemSelector() { 297 return getSalesOrderItemSelector(EntityPermission.READ_ONLY); 298 } 299 300 public Selector getSalesOrderItemSelectorForUpdate() { 301 return getSalesOrderItemSelector(EntityPermission.READ_WRITE); 302 } 303 304 public void setSalesOrderItemSelectorPK(SelectorPK salesOrderItemSelectorPK) 305 throws PersistenceNotNullException, PersistenceReadOnlyException { 306 checkReadWrite(); 307 _value.setSalesOrderItemSelectorPK(salesOrderItemSelectorPK); 308 } 309 310 public void setSalesOrderItemSelector(Selector entity) { 311 setSalesOrderItemSelectorPK(entity == null? null: entity.getPrimaryKey()); 312 } 313 314 public boolean getSalesOrderItemSelectorPKHasBeenModified() { 315 return _value.getSalesOrderItemSelectorPKHasBeenModified(); 316 } 317 318 public Boolean getIsDefault() { 319 return _value.getIsDefault(); 320 } 321 322 public void setIsDefault(Boolean isDefault) 323 throws PersistenceNotNullException, PersistenceReadOnlyException { 324 checkReadWrite(); 325 _value.setIsDefault(isDefault); 326 } 327 328 public boolean getIsDefaultHasBeenModified() { 329 return _value.getIsDefaultHasBeenModified(); 330 } 331 332 public Integer getSortOrder() { 333 return _value.getSortOrder(); 334 } 335 336 public void setSortOrder(Integer sortOrder) 337 throws PersistenceNotNullException, PersistenceReadOnlyException { 338 checkReadWrite(); 339 _value.setSortOrder(sortOrder); 340 } 341 342 public boolean getSortOrderHasBeenModified() { 343 return _value.getSortOrderHasBeenModified(); 344 } 345 346 public Long getFromTime() { 347 return _value.getFromTime(); 348 } 349 350 public void setFromTime(Long fromTime) 351 throws PersistenceNotNullException, PersistenceReadOnlyException { 352 checkReadWrite(); 353 _value.setFromTime(fromTime); 354 } 355 356 public boolean getFromTimeHasBeenModified() { 357 return _value.getFromTimeHasBeenModified(); 358 } 359 360 public Long getThruTime() { 361 return _value.getThruTime(); 362 } 363 364 public void setThruTime(Long thruTime) 365 throws PersistenceNotNullException, PersistenceReadOnlyException { 366 checkReadWrite(); 367 _value.setThruTime(thruTime); 368 } 369 370 public boolean getThruTimeHasBeenModified() { 371 return _value.getThruTimeHasBeenModified(); 372 } 373 374}