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 * WishlistLine.java 021 */ 022 023package com.echothree.model.data.wishlist.server.entity; 024 025import com.echothree.model.data.wishlist.common.pk.WishlistLinePK; 026 027import com.echothree.model.data.order.common.pk.OrderLinePK; 028import com.echothree.model.data.offer.common.pk.OfferUsePK; 029import com.echothree.model.data.wishlist.common.pk.WishlistPriorityPK; 030import com.echothree.model.data.associate.common.pk.AssociateReferralPK; 031 032import com.echothree.model.data.order.server.entity.OrderLine; 033import com.echothree.model.data.offer.server.entity.OfferUse; 034import com.echothree.model.data.wishlist.server.entity.WishlistPriority; 035import com.echothree.model.data.associate.server.entity.AssociateReferral; 036 037import com.echothree.model.data.order.server.factory.OrderLineFactory; 038import com.echothree.model.data.offer.server.factory.OfferUseFactory; 039import com.echothree.model.data.wishlist.server.factory.WishlistPriorityFactory; 040import com.echothree.model.data.associate.server.factory.AssociateReferralFactory; 041 042import com.echothree.model.data.wishlist.common.pk.WishlistLinePK; 043 044import com.echothree.model.data.wishlist.server.value.WishlistLineValue; 045 046import com.echothree.model.data.wishlist.server.factory.WishlistLineFactory; 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 WishlistLine 065 extends BaseEntity 066 implements Serializable { 067 068 private WishlistLinePK _pk; 069 private WishlistLineValue _value; 070 071 /** Creates a new instance of WishlistLine */ 072 public WishlistLine() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of WishlistLine */ 078 public WishlistLine(WishlistLineValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public WishlistLineFactory getBaseFactoryInstance() { 087 return WishlistLineFactory.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 WishlistLine that) { 111 WishlistLineValue thatValue = that.getWishlistLineValue(); 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 WishlistLineValue getWishlistLineValue() { 137 return _value; 138 } 139 140 public void setWishlistLineValue(WishlistLineValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public WishlistLinePK getPrimaryKey() { 148 return _pk; 149 } 150 151 public OrderLinePK getOrderLinePK() { 152 return _value.getOrderLinePK(); 153 } 154 155 public OrderLine getOrderLine(Session session, EntityPermission entityPermission) { 156 return OrderLineFactory.getInstance().getEntityFromPK(session, entityPermission, getOrderLinePK()); 157 } 158 159 public OrderLine getOrderLine(EntityPermission entityPermission) { 160 return getOrderLine(ThreadSession.currentSession(), entityPermission); 161 } 162 163 public OrderLine getOrderLine(Session session) { 164 return getOrderLine(session, EntityPermission.READ_ONLY); 165 } 166 167 public OrderLine getOrderLine() { 168 return getOrderLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 169 } 170 171 public OrderLine getOrderLineForUpdate(Session session) { 172 return getOrderLine(session, EntityPermission.READ_WRITE); 173 } 174 175 public OrderLine getOrderLineForUpdate() { 176 return getOrderLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 177 } 178 179 public void setOrderLinePK(OrderLinePK orderLinePK) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setOrderLinePK(orderLinePK); 183 } 184 185 public void setOrderLine(OrderLine entity) { 186 setOrderLinePK(entity == null? null: entity.getPrimaryKey()); 187 } 188 189 public boolean getOrderLinePKHasBeenModified() { 190 return _value.getOrderLinePKHasBeenModified(); 191 } 192 193 public OfferUsePK getOfferUsePK() { 194 return _value.getOfferUsePK(); 195 } 196 197 public OfferUse getOfferUse(Session session, EntityPermission entityPermission) { 198 return OfferUseFactory.getInstance().getEntityFromPK(session, entityPermission, getOfferUsePK()); 199 } 200 201 public OfferUse getOfferUse(EntityPermission entityPermission) { 202 return getOfferUse(ThreadSession.currentSession(), entityPermission); 203 } 204 205 public OfferUse getOfferUse(Session session) { 206 return getOfferUse(session, EntityPermission.READ_ONLY); 207 } 208 209 public OfferUse getOfferUse() { 210 return getOfferUse(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 211 } 212 213 public OfferUse getOfferUseForUpdate(Session session) { 214 return getOfferUse(session, EntityPermission.READ_WRITE); 215 } 216 217 public OfferUse getOfferUseForUpdate() { 218 return getOfferUse(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 219 } 220 221 public void setOfferUsePK(OfferUsePK offerUsePK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setOfferUsePK(offerUsePK); 225 } 226 227 public void setOfferUse(OfferUse entity) { 228 setOfferUsePK(entity == null? null: entity.getPrimaryKey()); 229 } 230 231 public boolean getOfferUsePKHasBeenModified() { 232 return _value.getOfferUsePKHasBeenModified(); 233 } 234 235 public WishlistPriorityPK getWishlistPriorityPK() { 236 return _value.getWishlistPriorityPK(); 237 } 238 239 public WishlistPriority getWishlistPriority(Session session, EntityPermission entityPermission) { 240 return WishlistPriorityFactory.getInstance().getEntityFromPK(session, entityPermission, getWishlistPriorityPK()); 241 } 242 243 public WishlistPriority getWishlistPriority(EntityPermission entityPermission) { 244 return getWishlistPriority(ThreadSession.currentSession(), entityPermission); 245 } 246 247 public WishlistPriority getWishlistPriority(Session session) { 248 return getWishlistPriority(session, EntityPermission.READ_ONLY); 249 } 250 251 public WishlistPriority getWishlistPriority() { 252 return getWishlistPriority(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 253 } 254 255 public WishlistPriority getWishlistPriorityForUpdate(Session session) { 256 return getWishlistPriority(session, EntityPermission.READ_WRITE); 257 } 258 259 public WishlistPriority getWishlistPriorityForUpdate() { 260 return getWishlistPriority(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 261 } 262 263 public void setWishlistPriorityPK(WishlistPriorityPK wishlistPriorityPK) 264 throws PersistenceNotNullException, PersistenceReadOnlyException { 265 checkReadWrite(); 266 _value.setWishlistPriorityPK(wishlistPriorityPK); 267 } 268 269 public void setWishlistPriority(WishlistPriority entity) { 270 setWishlistPriorityPK(entity == null? null: entity.getPrimaryKey()); 271 } 272 273 public boolean getWishlistPriorityPKHasBeenModified() { 274 return _value.getWishlistPriorityPKHasBeenModified(); 275 } 276 277 public AssociateReferralPK getAssociateReferralPK() { 278 return _value.getAssociateReferralPK(); 279 } 280 281 public AssociateReferral getAssociateReferral(Session session, EntityPermission entityPermission) { 282 AssociateReferralPK pk = getAssociateReferralPK(); 283 AssociateReferral entity = pk == null? null: AssociateReferralFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 284 285 return entity; 286 } 287 288 public AssociateReferral getAssociateReferral(EntityPermission entityPermission) { 289 return getAssociateReferral(ThreadSession.currentSession(), entityPermission); 290 } 291 292 public AssociateReferral getAssociateReferral(Session session) { 293 return getAssociateReferral(session, EntityPermission.READ_ONLY); 294 } 295 296 public AssociateReferral getAssociateReferral() { 297 return getAssociateReferral(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 298 } 299 300 public AssociateReferral getAssociateReferralForUpdate(Session session) { 301 return getAssociateReferral(session, EntityPermission.READ_WRITE); 302 } 303 304 public AssociateReferral getAssociateReferralForUpdate() { 305 return getAssociateReferral(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 306 } 307 308 public void setAssociateReferralPK(AssociateReferralPK associateReferralPK) 309 throws PersistenceNotNullException, PersistenceReadOnlyException { 310 checkReadWrite(); 311 _value.setAssociateReferralPK(associateReferralPK); 312 } 313 314 public void setAssociateReferral(AssociateReferral entity) { 315 setAssociateReferralPK(entity == null? null: entity.getPrimaryKey()); 316 } 317 318 public boolean getAssociateReferralPKHasBeenModified() { 319 return _value.getAssociateReferralPKHasBeenModified(); 320 } 321 322 public String getComment() { 323 return _value.getComment(); 324 } 325 326 public void setComment(String comment) 327 throws PersistenceNotNullException, PersistenceReadOnlyException { 328 checkReadWrite(); 329 _value.setComment(comment); 330 } 331 332 public boolean getCommentHasBeenModified() { 333 return _value.getCommentHasBeenModified(); 334 } 335 336 public Long getFromTime() { 337 return _value.getFromTime(); 338 } 339 340 public void setFromTime(Long fromTime) 341 throws PersistenceNotNullException, PersistenceReadOnlyException { 342 checkReadWrite(); 343 _value.setFromTime(fromTime); 344 } 345 346 public boolean getFromTimeHasBeenModified() { 347 return _value.getFromTimeHasBeenModified(); 348 } 349 350 public Long getThruTime() { 351 return _value.getThruTime(); 352 } 353 354 public void setThruTime(Long thruTime) 355 throws PersistenceNotNullException, PersistenceReadOnlyException { 356 checkReadWrite(); 357 _value.setThruTime(thruTime); 358 } 359 360 public boolean getThruTimeHasBeenModified() { 361 return _value.getThruTimeHasBeenModified(); 362 } 363 364}