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 * OfferUseDetail.java 021 */ 022 023package com.echothree.model.data.offer.server.entity; 024 025import com.echothree.model.data.offer.common.pk.OfferUseDetailPK; 026 027import com.echothree.model.data.offer.common.pk.OfferUsePK; 028import com.echothree.model.data.offer.common.pk.OfferPK; 029import com.echothree.model.data.offer.common.pk.UsePK; 030import com.echothree.model.data.sequence.common.pk.SequencePK; 031 032import com.echothree.model.data.offer.server.entity.OfferUse; 033import com.echothree.model.data.offer.server.entity.Offer; 034import com.echothree.model.data.offer.server.entity.Use; 035import com.echothree.model.data.sequence.server.entity.Sequence; 036 037import com.echothree.model.data.offer.server.factory.OfferUseFactory; 038import com.echothree.model.data.offer.server.factory.OfferFactory; 039import com.echothree.model.data.offer.server.factory.UseFactory; 040import com.echothree.model.data.sequence.server.factory.SequenceFactory; 041 042import com.echothree.model.data.offer.common.pk.OfferUseDetailPK; 043 044import com.echothree.model.data.offer.server.value.OfferUseDetailValue; 045 046import com.echothree.model.data.offer.server.factory.OfferUseDetailFactory; 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 OfferUseDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private OfferUseDetailPK _pk; 069 private OfferUseDetailValue _value; 070 071 /** Creates a new instance of OfferUseDetail */ 072 public OfferUseDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of OfferUseDetail */ 078 public OfferUseDetail(OfferUseDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public OfferUseDetailFactory getBaseFactoryInstance() { 087 return OfferUseDetailFactory.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 OfferUseDetail) { 111 OfferUseDetail that = (OfferUseDetail)other; 112 113 OfferUseDetailValue thatValue = that.getOfferUseDetailValue(); 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 OfferUseDetailValue getOfferUseDetailValue() { 139 return _value; 140 } 141 142 public void setOfferUseDetailValue(OfferUseDetailValue value) 143 throws PersistenceReadOnlyException { 144 checkReadWrite(); 145 _value = value; 146 } 147 148 @Override 149 public OfferUseDetailPK getPrimaryKey() { 150 return _pk; 151 } 152 153 public OfferUsePK getOfferUsePK() { 154 return _value.getOfferUsePK(); 155 } 156 157 public OfferUse getOfferUse(Session session, EntityPermission entityPermission) { 158 return OfferUseFactory.getInstance().getEntityFromPK(session, entityPermission, getOfferUsePK()); 159 } 160 161 public OfferUse getOfferUse(EntityPermission entityPermission) { 162 return getOfferUse(ThreadSession.currentSession(), entityPermission); 163 } 164 165 public OfferUse getOfferUse(Session session) { 166 return getOfferUse(session, EntityPermission.READ_ONLY); 167 } 168 169 public OfferUse getOfferUse() { 170 return getOfferUse(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 171 } 172 173 public OfferUse getOfferUseForUpdate(Session session) { 174 return getOfferUse(session, EntityPermission.READ_WRITE); 175 } 176 177 public OfferUse getOfferUseForUpdate() { 178 return getOfferUse(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 179 } 180 181 public void setOfferUsePK(OfferUsePK offerUsePK) 182 throws PersistenceNotNullException, PersistenceReadOnlyException { 183 checkReadWrite(); 184 _value.setOfferUsePK(offerUsePK); 185 } 186 187 public void setOfferUse(OfferUse entity) { 188 setOfferUsePK(entity == null? null: entity.getPrimaryKey()); 189 } 190 191 public boolean getOfferUsePKHasBeenModified() { 192 return _value.getOfferUsePKHasBeenModified(); 193 } 194 195 public OfferPK getOfferPK() { 196 return _value.getOfferPK(); 197 } 198 199 public Offer getOffer(Session session, EntityPermission entityPermission) { 200 return OfferFactory.getInstance().getEntityFromPK(session, entityPermission, getOfferPK()); 201 } 202 203 public Offer getOffer(EntityPermission entityPermission) { 204 return getOffer(ThreadSession.currentSession(), entityPermission); 205 } 206 207 public Offer getOffer(Session session) { 208 return getOffer(session, EntityPermission.READ_ONLY); 209 } 210 211 public Offer getOffer() { 212 return getOffer(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 213 } 214 215 public Offer getOfferForUpdate(Session session) { 216 return getOffer(session, EntityPermission.READ_WRITE); 217 } 218 219 public Offer getOfferForUpdate() { 220 return getOffer(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 221 } 222 223 public void setOfferPK(OfferPK offerPK) 224 throws PersistenceNotNullException, PersistenceReadOnlyException { 225 checkReadWrite(); 226 _value.setOfferPK(offerPK); 227 } 228 229 public void setOffer(Offer entity) { 230 setOfferPK(entity == null? null: entity.getPrimaryKey()); 231 } 232 233 public boolean getOfferPKHasBeenModified() { 234 return _value.getOfferPKHasBeenModified(); 235 } 236 237 public UsePK getUsePK() { 238 return _value.getUsePK(); 239 } 240 241 public Use getUse(Session session, EntityPermission entityPermission) { 242 return UseFactory.getInstance().getEntityFromPK(session, entityPermission, getUsePK()); 243 } 244 245 public Use getUse(EntityPermission entityPermission) { 246 return getUse(ThreadSession.currentSession(), entityPermission); 247 } 248 249 public Use getUse(Session session) { 250 return getUse(session, EntityPermission.READ_ONLY); 251 } 252 253 public Use getUse() { 254 return getUse(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 255 } 256 257 public Use getUseForUpdate(Session session) { 258 return getUse(session, EntityPermission.READ_WRITE); 259 } 260 261 public Use getUseForUpdate() { 262 return getUse(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 263 } 264 265 public void setUsePK(UsePK usePK) 266 throws PersistenceNotNullException, PersistenceReadOnlyException { 267 checkReadWrite(); 268 _value.setUsePK(usePK); 269 } 270 271 public void setUse(Use entity) { 272 setUsePK(entity == null? null: entity.getPrimaryKey()); 273 } 274 275 public boolean getUsePKHasBeenModified() { 276 return _value.getUsePKHasBeenModified(); 277 } 278 279 public SequencePK getSalesOrderSequencePK() { 280 return _value.getSalesOrderSequencePK(); 281 } 282 283 public Sequence getSalesOrderSequence(Session session, EntityPermission entityPermission) { 284 SequencePK pk = getSalesOrderSequencePK(); 285 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 286 287 return entity; 288 } 289 290 public Sequence getSalesOrderSequence(EntityPermission entityPermission) { 291 return getSalesOrderSequence(ThreadSession.currentSession(), entityPermission); 292 } 293 294 public Sequence getSalesOrderSequence(Session session) { 295 return getSalesOrderSequence(session, EntityPermission.READ_ONLY); 296 } 297 298 public Sequence getSalesOrderSequence() { 299 return getSalesOrderSequence(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 300 } 301 302 public Sequence getSalesOrderSequenceForUpdate(Session session) { 303 return getSalesOrderSequence(session, EntityPermission.READ_WRITE); 304 } 305 306 public Sequence getSalesOrderSequenceForUpdate() { 307 return getSalesOrderSequence(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 308 } 309 310 public void setSalesOrderSequencePK(SequencePK salesOrderSequencePK) 311 throws PersistenceNotNullException, PersistenceReadOnlyException { 312 checkReadWrite(); 313 _value.setSalesOrderSequencePK(salesOrderSequencePK); 314 } 315 316 public void setSalesOrderSequence(Sequence entity) { 317 setSalesOrderSequencePK(entity == null? null: entity.getPrimaryKey()); 318 } 319 320 public boolean getSalesOrderSequencePKHasBeenModified() { 321 return _value.getSalesOrderSequencePKHasBeenModified(); 322 } 323 324 public Long getFromTime() { 325 return _value.getFromTime(); 326 } 327 328 public void setFromTime(Long fromTime) 329 throws PersistenceNotNullException, PersistenceReadOnlyException { 330 checkReadWrite(); 331 _value.setFromTime(fromTime); 332 } 333 334 public boolean getFromTimeHasBeenModified() { 335 return _value.getFromTimeHasBeenModified(); 336 } 337 338 public Long getThruTime() { 339 return _value.getThruTime(); 340 } 341 342 public void setThruTime(Long thruTime) 343 throws PersistenceNotNullException, PersistenceReadOnlyException { 344 checkReadWrite(); 345 _value.setThruTime(thruTime); 346 } 347 348 public boolean getThruTimeHasBeenModified() { 349 return _value.getThruTimeHasBeenModified(); 350 } 351 352}