001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 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) { 111 OrderPaymentPreferenceDetail that = (OrderPaymentPreferenceDetail)other; 112 113 OrderPaymentPreferenceDetailValue thatValue = that.getOrderPaymentPreferenceDetailValue(); 114 return _value.equals(thatValue); 115 } else { 116 return false; 117 } 118 } 119 120 @Override 121 public void store(Session session) 122 throws PersistenceDatabaseException { 123 getBaseFactoryInstance().store(session, this); 124 } 125 126 @Override 127 public void remove(Session session) 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().remove(session, this); 130 } 131 132 @Override 133 public void remove() 134 throws PersistenceDatabaseException { 135 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 136 } 137 138 public OrderPaymentPreferenceDetailValue getOrderPaymentPreferenceDetailValue() { 139 return _value; 140 } 141 142 public void setOrderPaymentPreferenceDetailValue(OrderPaymentPreferenceDetailValue value) 143 throws PersistenceReadOnlyException { 144 checkReadWrite(); 145 _value = value; 146 } 147 148 @Override 149 public OrderPaymentPreferenceDetailPK getPrimaryKey() { 150 return _pk; 151 } 152 153 public OrderPaymentPreferencePK getOrderPaymentPreferencePK() { 154 return _value.getOrderPaymentPreferencePK(); 155 } 156 157 public OrderPaymentPreference getOrderPaymentPreference(Session session, EntityPermission entityPermission) { 158 return OrderPaymentPreferenceFactory.getInstance().getEntityFromPK(session, entityPermission, getOrderPaymentPreferencePK()); 159 } 160 161 public OrderPaymentPreference getOrderPaymentPreference(EntityPermission entityPermission) { 162 return getOrderPaymentPreference(ThreadSession.currentSession(), entityPermission); 163 } 164 165 public OrderPaymentPreference getOrderPaymentPreference(Session session) { 166 return getOrderPaymentPreference(session, EntityPermission.READ_ONLY); 167 } 168 169 public OrderPaymentPreference getOrderPaymentPreference() { 170 return getOrderPaymentPreference(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 171 } 172 173 public OrderPaymentPreference getOrderPaymentPreferenceForUpdate(Session session) { 174 return getOrderPaymentPreference(session, EntityPermission.READ_WRITE); 175 } 176 177 public OrderPaymentPreference getOrderPaymentPreferenceForUpdate() { 178 return getOrderPaymentPreference(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 179 } 180 181 public void setOrderPaymentPreferencePK(OrderPaymentPreferencePK orderPaymentPreferencePK) 182 throws PersistenceNotNullException, PersistenceReadOnlyException { 183 checkReadWrite(); 184 _value.setOrderPaymentPreferencePK(orderPaymentPreferencePK); 185 } 186 187 public void setOrderPaymentPreference(OrderPaymentPreference entity) { 188 setOrderPaymentPreferencePK(entity == null? null: entity.getPrimaryKey()); 189 } 190 191 public boolean getOrderPaymentPreferencePKHasBeenModified() { 192 return _value.getOrderPaymentPreferencePKHasBeenModified(); 193 } 194 195 public OrderPK getOrderPK() { 196 return _value.getOrderPK(); 197 } 198 199 public Order getOrder(Session session, EntityPermission entityPermission) { 200 return OrderFactory.getInstance().getEntityFromPK(session, entityPermission, getOrderPK()); 201 } 202 203 public Order getOrder(EntityPermission entityPermission) { 204 return getOrder(ThreadSession.currentSession(), entityPermission); 205 } 206 207 public Order getOrder(Session session) { 208 return getOrder(session, EntityPermission.READ_ONLY); 209 } 210 211 public Order getOrder() { 212 return getOrder(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 213 } 214 215 public Order getOrderForUpdate(Session session) { 216 return getOrder(session, EntityPermission.READ_WRITE); 217 } 218 219 public Order getOrderForUpdate() { 220 return getOrder(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 221 } 222 223 public void setOrderPK(OrderPK orderPK) 224 throws PersistenceNotNullException, PersistenceReadOnlyException { 225 checkReadWrite(); 226 _value.setOrderPK(orderPK); 227 } 228 229 public void setOrder(Order entity) { 230 setOrderPK(entity == null? null: entity.getPrimaryKey()); 231 } 232 233 public boolean getOrderPKHasBeenModified() { 234 return _value.getOrderPKHasBeenModified(); 235 } 236 237 public Integer getOrderPaymentPreferenceSequence() { 238 return _value.getOrderPaymentPreferenceSequence(); 239 } 240 241 public void setOrderPaymentPreferenceSequence(Integer orderPaymentPreferenceSequence) 242 throws PersistenceNotNullException, PersistenceReadOnlyException { 243 checkReadWrite(); 244 _value.setOrderPaymentPreferenceSequence(orderPaymentPreferenceSequence); 245 } 246 247 public boolean getOrderPaymentPreferenceSequenceHasBeenModified() { 248 return _value.getOrderPaymentPreferenceSequenceHasBeenModified(); 249 } 250 251 public PaymentMethodPK getPaymentMethodPK() { 252 return _value.getPaymentMethodPK(); 253 } 254 255 public PaymentMethod getPaymentMethod(Session session, EntityPermission entityPermission) { 256 return PaymentMethodFactory.getInstance().getEntityFromPK(session, entityPermission, getPaymentMethodPK()); 257 } 258 259 public PaymentMethod getPaymentMethod(EntityPermission entityPermission) { 260 return getPaymentMethod(ThreadSession.currentSession(), entityPermission); 261 } 262 263 public PaymentMethod getPaymentMethod(Session session) { 264 return getPaymentMethod(session, EntityPermission.READ_ONLY); 265 } 266 267 public PaymentMethod getPaymentMethod() { 268 return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 269 } 270 271 public PaymentMethod getPaymentMethodForUpdate(Session session) { 272 return getPaymentMethod(session, EntityPermission.READ_WRITE); 273 } 274 275 public PaymentMethod getPaymentMethodForUpdate() { 276 return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 277 } 278 279 public void setPaymentMethodPK(PaymentMethodPK paymentMethodPK) 280 throws PersistenceNotNullException, PersistenceReadOnlyException { 281 checkReadWrite(); 282 _value.setPaymentMethodPK(paymentMethodPK); 283 } 284 285 public void setPaymentMethod(PaymentMethod entity) { 286 setPaymentMethodPK(entity == null? null: entity.getPrimaryKey()); 287 } 288 289 public boolean getPaymentMethodPKHasBeenModified() { 290 return _value.getPaymentMethodPKHasBeenModified(); 291 } 292 293 public PartyPaymentMethodPK getPartyPaymentMethodPK() { 294 return _value.getPartyPaymentMethodPK(); 295 } 296 297 public PartyPaymentMethod getPartyPaymentMethod(Session session, EntityPermission entityPermission) { 298 PartyPaymentMethodPK pk = getPartyPaymentMethodPK(); 299 PartyPaymentMethod entity = pk == null? null: PartyPaymentMethodFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 300 301 return entity; 302 } 303 304 public PartyPaymentMethod getPartyPaymentMethod(EntityPermission entityPermission) { 305 return getPartyPaymentMethod(ThreadSession.currentSession(), entityPermission); 306 } 307 308 public PartyPaymentMethod getPartyPaymentMethod(Session session) { 309 return getPartyPaymentMethod(session, EntityPermission.READ_ONLY); 310 } 311 312 public PartyPaymentMethod getPartyPaymentMethod() { 313 return getPartyPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 314 } 315 316 public PartyPaymentMethod getPartyPaymentMethodForUpdate(Session session) { 317 return getPartyPaymentMethod(session, EntityPermission.READ_WRITE); 318 } 319 320 public PartyPaymentMethod getPartyPaymentMethodForUpdate() { 321 return getPartyPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 322 } 323 324 public void setPartyPaymentMethodPK(PartyPaymentMethodPK partyPaymentMethodPK) 325 throws PersistenceNotNullException, PersistenceReadOnlyException { 326 checkReadWrite(); 327 _value.setPartyPaymentMethodPK(partyPaymentMethodPK); 328 } 329 330 public void setPartyPaymentMethod(PartyPaymentMethod entity) { 331 setPartyPaymentMethodPK(entity == null? null: entity.getPrimaryKey()); 332 } 333 334 public boolean getPartyPaymentMethodPKHasBeenModified() { 335 return _value.getPartyPaymentMethodPKHasBeenModified(); 336 } 337 338 public Boolean getWasPresent() { 339 return _value.getWasPresent(); 340 } 341 342 public void setWasPresent(Boolean wasPresent) 343 throws PersistenceNotNullException, PersistenceReadOnlyException { 344 checkReadWrite(); 345 _value.setWasPresent(wasPresent); 346 } 347 348 public boolean getWasPresentHasBeenModified() { 349 return _value.getWasPresentHasBeenModified(); 350 } 351 352 public Long getMaximumAmount() { 353 return _value.getMaximumAmount(); 354 } 355 356 public void setMaximumAmount(Long maximumAmount) 357 throws PersistenceNotNullException, PersistenceReadOnlyException { 358 checkReadWrite(); 359 _value.setMaximumAmount(maximumAmount); 360 } 361 362 public boolean getMaximumAmountHasBeenModified() { 363 return _value.getMaximumAmountHasBeenModified(); 364 } 365 366 public Integer getSortOrder() { 367 return _value.getSortOrder(); 368 } 369 370 public void setSortOrder(Integer sortOrder) 371 throws PersistenceNotNullException, PersistenceReadOnlyException { 372 checkReadWrite(); 373 _value.setSortOrder(sortOrder); 374 } 375 376 public boolean getSortOrderHasBeenModified() { 377 return _value.getSortOrderHasBeenModified(); 378 } 379 380 public Long getFromTime() { 381 return _value.getFromTime(); 382 } 383 384 public void setFromTime(Long fromTime) 385 throws PersistenceNotNullException, PersistenceReadOnlyException { 386 checkReadWrite(); 387 _value.setFromTime(fromTime); 388 } 389 390 public boolean getFromTimeHasBeenModified() { 391 return _value.getFromTimeHasBeenModified(); 392 } 393 394 public Long getThruTime() { 395 return _value.getThruTime(); 396 } 397 398 public void setThruTime(Long thruTime) 399 throws PersistenceNotNullException, PersistenceReadOnlyException { 400 checkReadWrite(); 401 _value.setThruTime(thruTime); 402 } 403 404 public boolean getThruTimeHasBeenModified() { 405 return _value.getThruTimeHasBeenModified(); 406 } 407 408}