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 * RatingDetail.java 021 */ 022 023package com.echothree.model.data.rating.server.entity; 024 025import com.echothree.model.data.rating.common.pk.RatingDetailPK; 026 027import com.echothree.model.data.rating.common.pk.RatingPK; 028import com.echothree.model.data.rating.common.pk.RatingTypeListItemPK; 029import com.echothree.model.data.core.common.pk.EntityInstancePK; 030 031import com.echothree.model.data.rating.server.entity.Rating; 032import com.echothree.model.data.rating.server.entity.RatingTypeListItem; 033import com.echothree.model.data.core.server.entity.EntityInstance; 034 035import com.echothree.model.data.rating.server.factory.RatingFactory; 036import com.echothree.model.data.rating.server.factory.RatingTypeListItemFactory; 037import com.echothree.model.data.core.server.factory.EntityInstanceFactory; 038 039import com.echothree.model.data.rating.common.pk.RatingDetailPK; 040 041import com.echothree.model.data.rating.server.value.RatingDetailValue; 042 043import com.echothree.model.data.rating.server.factory.RatingDetailFactory; 044 045import com.echothree.util.common.exception.PersistenceException; 046import com.echothree.util.common.exception.PersistenceDatabaseException; 047import com.echothree.util.common.exception.PersistenceNotNullException; 048import com.echothree.util.common.exception.PersistenceReadOnlyException; 049 050import com.echothree.util.common.persistence.BasePK; 051 052import com.echothree.util.common.persistence.type.ByteArray; 053 054import com.echothree.util.server.persistence.BaseEntity; 055import com.echothree.util.server.persistence.EntityPermission; 056import com.echothree.util.server.persistence.Session; 057import com.echothree.util.server.persistence.ThreadSession; 058 059import java.io.Serializable; 060 061public class RatingDetail 062 extends BaseEntity 063 implements Serializable { 064 065 private RatingDetailPK _pk; 066 private RatingDetailValue _value; 067 068 /** Creates a new instance of RatingDetail */ 069 public RatingDetail() 070 throws PersistenceException { 071 super(); 072 } 073 074 /** Creates a new instance of RatingDetail */ 075 public RatingDetail(RatingDetailValue value, EntityPermission entityPermission) { 076 super(entityPermission); 077 078 _value = value; 079 _pk = value.getPrimaryKey(); 080 } 081 082 @Override 083 public RatingDetailFactory getBaseFactoryInstance() { 084 return RatingDetailFactory.getInstance(); 085 } 086 087 @Override 088 public boolean hasBeenModified() { 089 return _value.hasBeenModified(); 090 } 091 092 @Override 093 public int hashCode() { 094 return _pk.hashCode(); 095 } 096 097 @Override 098 public String toString() { 099 return _pk.toString(); 100 } 101 102 @Override 103 public boolean equals(Object other) { 104 if(this == other) 105 return true; 106 107 if(other instanceof RatingDetail that) { 108 RatingDetailValue thatValue = that.getRatingDetailValue(); 109 return _value.equals(thatValue); 110 } else { 111 return false; 112 } 113 } 114 115 @Override 116 public void store(Session session) 117 throws PersistenceDatabaseException { 118 getBaseFactoryInstance().store(session, this); 119 } 120 121 @Override 122 public void remove(Session session) 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().remove(session, this); 125 } 126 127 @Override 128 public void remove() 129 throws PersistenceDatabaseException { 130 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 131 } 132 133 public RatingDetailValue getRatingDetailValue() { 134 return _value; 135 } 136 137 public void setRatingDetailValue(RatingDetailValue value) 138 throws PersistenceReadOnlyException { 139 checkReadWrite(); 140 _value = value; 141 } 142 143 @Override 144 public RatingDetailPK getPrimaryKey() { 145 return _pk; 146 } 147 148 public RatingPK getRatingPK() { 149 return _value.getRatingPK(); 150 } 151 152 public Rating getRating(Session session, EntityPermission entityPermission) { 153 return RatingFactory.getInstance().getEntityFromPK(session, entityPermission, getRatingPK()); 154 } 155 156 public Rating getRating(EntityPermission entityPermission) { 157 return getRating(ThreadSession.currentSession(), entityPermission); 158 } 159 160 public Rating getRating(Session session) { 161 return getRating(session, EntityPermission.READ_ONLY); 162 } 163 164 public Rating getRating() { 165 return getRating(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 166 } 167 168 public Rating getRatingForUpdate(Session session) { 169 return getRating(session, EntityPermission.READ_WRITE); 170 } 171 172 public Rating getRatingForUpdate() { 173 return getRating(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 174 } 175 176 public void setRatingPK(RatingPK ratingPK) 177 throws PersistenceNotNullException, PersistenceReadOnlyException { 178 checkReadWrite(); 179 _value.setRatingPK(ratingPK); 180 } 181 182 public void setRating(Rating entity) { 183 setRatingPK(entity == null? null: entity.getPrimaryKey()); 184 } 185 186 public boolean getRatingPKHasBeenModified() { 187 return _value.getRatingPKHasBeenModified(); 188 } 189 190 public String getRatingName() { 191 return _value.getRatingName(); 192 } 193 194 public void setRatingName(String ratingName) 195 throws PersistenceNotNullException, PersistenceReadOnlyException { 196 checkReadWrite(); 197 _value.setRatingName(ratingName); 198 } 199 200 public boolean getRatingNameHasBeenModified() { 201 return _value.getRatingNameHasBeenModified(); 202 } 203 204 public RatingTypeListItemPK getRatingTypeListItemPK() { 205 return _value.getRatingTypeListItemPK(); 206 } 207 208 public RatingTypeListItem getRatingTypeListItem(Session session, EntityPermission entityPermission) { 209 return RatingTypeListItemFactory.getInstance().getEntityFromPK(session, entityPermission, getRatingTypeListItemPK()); 210 } 211 212 public RatingTypeListItem getRatingTypeListItem(EntityPermission entityPermission) { 213 return getRatingTypeListItem(ThreadSession.currentSession(), entityPermission); 214 } 215 216 public RatingTypeListItem getRatingTypeListItem(Session session) { 217 return getRatingTypeListItem(session, EntityPermission.READ_ONLY); 218 } 219 220 public RatingTypeListItem getRatingTypeListItem() { 221 return getRatingTypeListItem(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 222 } 223 224 public RatingTypeListItem getRatingTypeListItemForUpdate(Session session) { 225 return getRatingTypeListItem(session, EntityPermission.READ_WRITE); 226 } 227 228 public RatingTypeListItem getRatingTypeListItemForUpdate() { 229 return getRatingTypeListItem(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 230 } 231 232 public void setRatingTypeListItemPK(RatingTypeListItemPK ratingTypeListItemPK) 233 throws PersistenceNotNullException, PersistenceReadOnlyException { 234 checkReadWrite(); 235 _value.setRatingTypeListItemPK(ratingTypeListItemPK); 236 } 237 238 public void setRatingTypeListItem(RatingTypeListItem entity) { 239 setRatingTypeListItemPK(entity == null? null: entity.getPrimaryKey()); 240 } 241 242 public boolean getRatingTypeListItemPKHasBeenModified() { 243 return _value.getRatingTypeListItemPKHasBeenModified(); 244 } 245 246 public EntityInstancePK getRatedEntityInstancePK() { 247 return _value.getRatedEntityInstancePK(); 248 } 249 250 public EntityInstance getRatedEntityInstance(Session session, EntityPermission entityPermission) { 251 return EntityInstanceFactory.getInstance().getEntityFromPK(session, entityPermission, getRatedEntityInstancePK()); 252 } 253 254 public EntityInstance getRatedEntityInstance(EntityPermission entityPermission) { 255 return getRatedEntityInstance(ThreadSession.currentSession(), entityPermission); 256 } 257 258 public EntityInstance getRatedEntityInstance(Session session) { 259 return getRatedEntityInstance(session, EntityPermission.READ_ONLY); 260 } 261 262 public EntityInstance getRatedEntityInstance() { 263 return getRatedEntityInstance(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 264 } 265 266 public EntityInstance getRatedEntityInstanceForUpdate(Session session) { 267 return getRatedEntityInstance(session, EntityPermission.READ_WRITE); 268 } 269 270 public EntityInstance getRatedEntityInstanceForUpdate() { 271 return getRatedEntityInstance(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 272 } 273 274 public void setRatedEntityInstancePK(EntityInstancePK ratedEntityInstancePK) 275 throws PersistenceNotNullException, PersistenceReadOnlyException { 276 checkReadWrite(); 277 _value.setRatedEntityInstancePK(ratedEntityInstancePK); 278 } 279 280 public void setRatedEntityInstance(EntityInstance entity) { 281 setRatedEntityInstancePK(entity == null? null: entity.getPrimaryKey()); 282 } 283 284 public boolean getRatedEntityInstancePKHasBeenModified() { 285 return _value.getRatedEntityInstancePKHasBeenModified(); 286 } 287 288 public EntityInstancePK getRatedByEntityInstancePK() { 289 return _value.getRatedByEntityInstancePK(); 290 } 291 292 public EntityInstance getRatedByEntityInstance(Session session, EntityPermission entityPermission) { 293 return EntityInstanceFactory.getInstance().getEntityFromPK(session, entityPermission, getRatedByEntityInstancePK()); 294 } 295 296 public EntityInstance getRatedByEntityInstance(EntityPermission entityPermission) { 297 return getRatedByEntityInstance(ThreadSession.currentSession(), entityPermission); 298 } 299 300 public EntityInstance getRatedByEntityInstance(Session session) { 301 return getRatedByEntityInstance(session, EntityPermission.READ_ONLY); 302 } 303 304 public EntityInstance getRatedByEntityInstance() { 305 return getRatedByEntityInstance(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 306 } 307 308 public EntityInstance getRatedByEntityInstanceForUpdate(Session session) { 309 return getRatedByEntityInstance(session, EntityPermission.READ_WRITE); 310 } 311 312 public EntityInstance getRatedByEntityInstanceForUpdate() { 313 return getRatedByEntityInstance(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 314 } 315 316 public void setRatedByEntityInstancePK(EntityInstancePK ratedByEntityInstancePK) 317 throws PersistenceNotNullException, PersistenceReadOnlyException { 318 checkReadWrite(); 319 _value.setRatedByEntityInstancePK(ratedByEntityInstancePK); 320 } 321 322 public void setRatedByEntityInstance(EntityInstance entity) { 323 setRatedByEntityInstancePK(entity == null? null: entity.getPrimaryKey()); 324 } 325 326 public boolean getRatedByEntityInstancePKHasBeenModified() { 327 return _value.getRatedByEntityInstancePKHasBeenModified(); 328 } 329 330 public Long getFromTime() { 331 return _value.getFromTime(); 332 } 333 334 public void setFromTime(Long fromTime) 335 throws PersistenceNotNullException, PersistenceReadOnlyException { 336 checkReadWrite(); 337 _value.setFromTime(fromTime); 338 } 339 340 public boolean getFromTimeHasBeenModified() { 341 return _value.getFromTimeHasBeenModified(); 342 } 343 344 public Long getThruTime() { 345 return _value.getThruTime(); 346 } 347 348 public void setThruTime(Long thruTime) 349 throws PersistenceNotNullException, PersistenceReadOnlyException { 350 checkReadWrite(); 351 _value.setThruTime(thruTime); 352 } 353 354 public boolean getThruTimeHasBeenModified() { 355 return _value.getThruTimeHasBeenModified(); 356 } 357 358}