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 * OrderPaymentPreferenceDetail.java 021 */ 022 023package com.echothree.model.data.order.server.entity; 024 025import com.echothree.model.data.order.common.pk.OrderPaymentPreferenceDetailPK; 026 027import com.echothree.model.data.order.common.pk.OrderPaymentPreferencePK; 028import com.echothree.model.data.order.common.pk.OrderPK; 029import com.echothree.model.data.payment.common.pk.PaymentMethodPK; 030import com.echothree.model.data.payment.common.pk.PartyPaymentMethodPK; 031 032import com.echothree.model.data.order.server.entity.OrderPaymentPreference; 033import com.echothree.model.data.order.server.entity.Order; 034import com.echothree.model.data.payment.server.entity.PaymentMethod; 035import com.echothree.model.data.payment.server.entity.PartyPaymentMethod; 036 037import com.echothree.model.data.order.server.factory.OrderPaymentPreferenceFactory; 038import com.echothree.model.data.order.server.factory.OrderFactory; 039import com.echothree.model.data.payment.server.factory.PaymentMethodFactory; 040import com.echothree.model.data.payment.server.factory.PartyPaymentMethodFactory; 041 042import com.echothree.model.data.order.common.pk.OrderPaymentPreferenceDetailPK; 043 044import com.echothree.model.data.order.server.value.OrderPaymentPreferenceDetailValue; 045 046import com.echothree.model.data.order.server.factory.OrderPaymentPreferenceDetailFactory; 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 OrderPaymentPreferenceDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private OrderPaymentPreferenceDetailPK _pk; 069 private OrderPaymentPreferenceDetailValue _value; 070 071 /** Creates a new instance of OrderPaymentPreferenceDetail */ 072 public OrderPaymentPreferenceDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of OrderPaymentPreferenceDetail */ 078 public OrderPaymentPreferenceDetail(OrderPaymentPreferenceDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public OrderPaymentPreferenceDetailFactory getBaseFactoryInstance() { 087 return OrderPaymentPreferenceDetailFactory.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 OrderPaymentPreferenceDetail that) { 111 OrderPaymentPreferenceDetailValue thatValue = that.getOrderPaymentPreferenceDetailValue(); 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 OrderPaymentPreferenceDetailValue getOrderPaymentPreferenceDetailValue() { 137 return _value; 138 } 139 140 public void setOrderPaymentPreferenceDetailValue(OrderPaymentPreferenceDetailValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public OrderPaymentPreferenceDetailPK getPrimaryKey() { 148 return _pk; 149 } 150 151 public OrderPaymentPreferencePK getOrderPaymentPreferencePK() { 152 return _value.getOrderPaymentPreferencePK(); 153 } 154 155 public OrderPaymentPreference getOrderPaymentPreference(Session session, EntityPermission entityPermission) { 156 return OrderPaymentPreferenceFactory.getInstance().getEntityFromPK(session, entityPermission, getOrderPaymentPreferencePK()); 157 } 158 159 public OrderPaymentPreference getOrderPaymentPreference(EntityPermission entityPermission) { 160 return getOrderPaymentPreference(ThreadSession.currentSession(), entityPermission); 161 } 162 163 public OrderPaymentPreference getOrderPaymentPreference(Session session) { 164 return getOrderPaymentPreference(session, EntityPermission.READ_ONLY); 165 } 166 167 public OrderPaymentPreference getOrderPaymentPreference() { 168 return getOrderPaymentPreference(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 169 } 170 171 public OrderPaymentPreference getOrderPaymentPreferenceForUpdate(Session session) { 172 return getOrderPaymentPreference(session, EntityPermission.READ_WRITE); 173 } 174 175 public OrderPaymentPreference getOrderPaymentPreferenceForUpdate() { 176 return getOrderPaymentPreference(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 177 } 178 179 public void setOrderPaymentPreferencePK(OrderPaymentPreferencePK orderPaymentPreferencePK) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setOrderPaymentPreferencePK(orderPaymentPreferencePK); 183 } 184 185 public void setOrderPaymentPreference(OrderPaymentPreference entity) { 186 setOrderPaymentPreferencePK(entity == null? null: entity.getPrimaryKey()); 187 } 188 189 public boolean getOrderPaymentPreferencePKHasBeenModified() { 190 return _value.getOrderPaymentPreferencePKHasBeenModified(); 191 } 192 193 public OrderPK getOrderPK() { 194 return _value.getOrderPK(); 195 } 196 197 public Order getOrder(Session session, EntityPermission entityPermission) { 198 return OrderFactory.getInstance().getEntityFromPK(session, entityPermission, getOrderPK()); 199 } 200 201 public Order getOrder(EntityPermission entityPermission) { 202 return getOrder(ThreadSession.currentSession(), entityPermission); 203 } 204 205 public Order getOrder(Session session) { 206 return getOrder(session, EntityPermission.READ_ONLY); 207 } 208 209 public Order getOrder() { 210 return getOrder(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 211 } 212 213 public Order getOrderForUpdate(Session session) { 214 return getOrder(session, EntityPermission.READ_WRITE); 215 } 216 217 public Order getOrderForUpdate() { 218 return getOrder(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 219 } 220 221 public void setOrderPK(OrderPK orderPK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setOrderPK(orderPK); 225 } 226 227 public void setOrder(Order entity) { 228 setOrderPK(entity == null? null: entity.getPrimaryKey()); 229 } 230 231 public boolean getOrderPKHasBeenModified() { 232 return _value.getOrderPKHasBeenModified(); 233 } 234 235 public Integer getOrderPaymentPreferenceSequence() { 236 return _value.getOrderPaymentPreferenceSequence(); 237 } 238 239 public void setOrderPaymentPreferenceSequence(Integer orderPaymentPreferenceSequence) 240 throws PersistenceNotNullException, PersistenceReadOnlyException { 241 checkReadWrite(); 242 _value.setOrderPaymentPreferenceSequence(orderPaymentPreferenceSequence); 243 } 244 245 public boolean getOrderPaymentPreferenceSequenceHasBeenModified() { 246 return _value.getOrderPaymentPreferenceSequenceHasBeenModified(); 247 } 248 249 public PaymentMethodPK getPaymentMethodPK() { 250 return _value.getPaymentMethodPK(); 251 } 252 253 public PaymentMethod getPaymentMethod(Session session, EntityPermission entityPermission) { 254 return PaymentMethodFactory.getInstance().getEntityFromPK(session, entityPermission, getPaymentMethodPK()); 255 } 256 257 public PaymentMethod getPaymentMethod(EntityPermission entityPermission) { 258 return getPaymentMethod(ThreadSession.currentSession(), entityPermission); 259 } 260 261 public PaymentMethod getPaymentMethod(Session session) { 262 return getPaymentMethod(session, EntityPermission.READ_ONLY); 263 } 264 265 public PaymentMethod getPaymentMethod() { 266 return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 267 } 268 269 public PaymentMethod getPaymentMethodForUpdate(Session session) { 270 return getPaymentMethod(session, EntityPermission.READ_WRITE); 271 } 272 273 public PaymentMethod getPaymentMethodForUpdate() { 274 return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 275 } 276 277 public void setPaymentMethodPK(PaymentMethodPK paymentMethodPK) 278 throws PersistenceNotNullException, PersistenceReadOnlyException { 279 checkReadWrite(); 280 _value.setPaymentMethodPK(paymentMethodPK); 281 } 282 283 public void setPaymentMethod(PaymentMethod entity) { 284 setPaymentMethodPK(entity == null? null: entity.getPrimaryKey()); 285 } 286 287 public boolean getPaymentMethodPKHasBeenModified() { 288 return _value.getPaymentMethodPKHasBeenModified(); 289 } 290 291 public PartyPaymentMethodPK getPartyPaymentMethodPK() { 292 return _value.getPartyPaymentMethodPK(); 293 } 294 295 public PartyPaymentMethod getPartyPaymentMethod(Session session, EntityPermission entityPermission) { 296 PartyPaymentMethodPK pk = getPartyPaymentMethodPK(); 297 PartyPaymentMethod entity = pk == null? null: PartyPaymentMethodFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 298 299 return entity; 300 } 301 302 public PartyPaymentMethod getPartyPaymentMethod(EntityPermission entityPermission) { 303 return getPartyPaymentMethod(ThreadSession.currentSession(), entityPermission); 304 } 305 306 public PartyPaymentMethod getPartyPaymentMethod(Session session) { 307 return getPartyPaymentMethod(session, EntityPermission.READ_ONLY); 308 } 309 310 public PartyPaymentMethod getPartyPaymentMethod() { 311 return getPartyPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 312 } 313 314 public PartyPaymentMethod getPartyPaymentMethodForUpdate(Session session) { 315 return getPartyPaymentMethod(session, EntityPermission.READ_WRITE); 316 } 317 318 public PartyPaymentMethod getPartyPaymentMethodForUpdate() { 319 return getPartyPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 320 } 321 322 public void setPartyPaymentMethodPK(PartyPaymentMethodPK partyPaymentMethodPK) 323 throws PersistenceNotNullException, PersistenceReadOnlyException { 324 checkReadWrite(); 325 _value.setPartyPaymentMethodPK(partyPaymentMethodPK); 326 } 327 328 public void setPartyPaymentMethod(PartyPaymentMethod entity) { 329 setPartyPaymentMethodPK(entity == null? null: entity.getPrimaryKey()); 330 } 331 332 public boolean getPartyPaymentMethodPKHasBeenModified() { 333 return _value.getPartyPaymentMethodPKHasBeenModified(); 334 } 335 336 public Boolean getWasPresent() { 337 return _value.getWasPresent(); 338 } 339 340 public void setWasPresent(Boolean wasPresent) 341 throws PersistenceNotNullException, PersistenceReadOnlyException { 342 checkReadWrite(); 343 _value.setWasPresent(wasPresent); 344 } 345 346 public boolean getWasPresentHasBeenModified() { 347 return _value.getWasPresentHasBeenModified(); 348 } 349 350 public Long getMaximumAmount() { 351 return _value.getMaximumAmount(); 352 } 353 354 public void setMaximumAmount(Long maximumAmount) 355 throws PersistenceNotNullException, PersistenceReadOnlyException { 356 checkReadWrite(); 357 _value.setMaximumAmount(maximumAmount); 358 } 359 360 public boolean getMaximumAmountHasBeenModified() { 361 return _value.getMaximumAmountHasBeenModified(); 362 } 363 364 public Integer getSortOrder() { 365 return _value.getSortOrder(); 366 } 367 368 public void setSortOrder(Integer sortOrder) 369 throws PersistenceNotNullException, PersistenceReadOnlyException { 370 checkReadWrite(); 371 _value.setSortOrder(sortOrder); 372 } 373 374 public boolean getSortOrderHasBeenModified() { 375 return _value.getSortOrderHasBeenModified(); 376 } 377 378 public Long getFromTime() { 379 return _value.getFromTime(); 380 } 381 382 public void setFromTime(Long fromTime) 383 throws PersistenceNotNullException, PersistenceReadOnlyException { 384 checkReadWrite(); 385 _value.setFromTime(fromTime); 386 } 387 388 public boolean getFromTimeHasBeenModified() { 389 return _value.getFromTimeHasBeenModified(); 390 } 391 392 public Long getThruTime() { 393 return _value.getThruTime(); 394 } 395 396 public void setThruTime(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}