001// -------------------------------------------------------------------------------- 002// Copyright 2002-2026 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 * ClubDetail.java 021 */ 022 023package com.echothree.model.data.club.server.entity; 024 025import com.echothree.model.data.club.common.pk.ClubDetailPK; 026 027import com.echothree.model.data.club.common.pk.ClubPK; 028import com.echothree.model.data.subscription.common.pk.SubscriptionTypePK; 029import com.echothree.model.data.filter.common.pk.FilterPK; 030import com.echothree.model.data.accounting.common.pk.CurrencyPK; 031 032import com.echothree.model.data.club.server.entity.Club; 033import com.echothree.model.data.subscription.server.entity.SubscriptionType; 034import com.echothree.model.data.filter.server.entity.Filter; 035import com.echothree.model.data.accounting.server.entity.Currency; 036 037import com.echothree.model.data.club.server.factory.ClubFactory; 038import com.echothree.model.data.subscription.server.factory.SubscriptionTypeFactory; 039import com.echothree.model.data.filter.server.factory.FilterFactory; 040import com.echothree.model.data.accounting.server.factory.CurrencyFactory; 041 042import com.echothree.model.data.club.common.pk.ClubDetailPK; 043 044import com.echothree.model.data.club.server.value.ClubDetailValue; 045 046import com.echothree.model.data.club.server.factory.ClubDetailFactory; 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 ClubDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private ClubDetailPK _pk; 069 private ClubDetailValue _value; 070 071 /** Creates a new instance of ClubDetail */ 072 public ClubDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of ClubDetail */ 078 public ClubDetail(ClubDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public ClubDetailFactory getBaseFactoryInstance() { 087 return ClubDetailFactory.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 ClubDetail that) { 111 ClubDetailValue thatValue = that.getClubDetailValue(); 112 return _value.equals(thatValue); 113 } else { 114 return false; 115 } 116 } 117 118 @Override 119 public void store() 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().store(this); 122 } 123 124 @Override 125 public void remove() 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().remove(this); 128 } 129 130 public ClubDetailValue getClubDetailValue() { 131 return _value; 132 } 133 134 public void setClubDetailValue(ClubDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public ClubDetailPK getPrimaryKey() { 142 return _pk; 143 } 144 145 public ClubPK getClubPK() { 146 return _value.getClubPK(); 147 } 148 149 public Club getClub(EntityPermission entityPermission) { 150 return ClubFactory.getInstance().getEntityFromPK(entityPermission, getClubPK()); 151 } 152 153 public Club getClub() { 154 return getClub(EntityPermission.READ_ONLY); 155 } 156 157 public Club getClubForUpdate() { 158 return getClub(EntityPermission.READ_WRITE); 159 } 160 161 public void setClubPK(ClubPK clubPK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setClubPK(clubPK); 165 } 166 167 public void setClub(Club entity) { 168 setClubPK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getClubPKHasBeenModified() { 172 return _value.getClubPKHasBeenModified(); 173 } 174 175 public String getClubName() { 176 return _value.getClubName(); 177 } 178 179 public void setClubName(String clubName) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setClubName(clubName); 183 } 184 185 public boolean getClubNameHasBeenModified() { 186 return _value.getClubNameHasBeenModified(); 187 } 188 189 public SubscriptionTypePK getSubscriptionTypePK() { 190 return _value.getSubscriptionTypePK(); 191 } 192 193 public SubscriptionType getSubscriptionType(EntityPermission entityPermission) { 194 return SubscriptionTypeFactory.getInstance().getEntityFromPK(entityPermission, getSubscriptionTypePK()); 195 } 196 197 public SubscriptionType getSubscriptionType() { 198 return getSubscriptionType(EntityPermission.READ_ONLY); 199 } 200 201 public SubscriptionType getSubscriptionTypeForUpdate() { 202 return getSubscriptionType(EntityPermission.READ_WRITE); 203 } 204 205 public void setSubscriptionTypePK(SubscriptionTypePK subscriptionTypePK) 206 throws PersistenceNotNullException, PersistenceReadOnlyException { 207 checkReadWrite(); 208 _value.setSubscriptionTypePK(subscriptionTypePK); 209 } 210 211 public void setSubscriptionType(SubscriptionType entity) { 212 setSubscriptionTypePK(entity == null? null: entity.getPrimaryKey()); 213 } 214 215 public boolean getSubscriptionTypePKHasBeenModified() { 216 return _value.getSubscriptionTypePKHasBeenModified(); 217 } 218 219 public FilterPK getClubPriceFilterPK() { 220 return _value.getClubPriceFilterPK(); 221 } 222 223 public Filter getClubPriceFilter(EntityPermission entityPermission) { 224 FilterPK pk = getClubPriceFilterPK(); 225 Filter entity = pk == null? null: FilterFactory.getInstance().getEntityFromPK(entityPermission, pk); 226 227 return entity; 228 } 229 230 public Filter getClubPriceFilter() { 231 return getClubPriceFilter(EntityPermission.READ_ONLY); 232 } 233 234 public Filter getClubPriceFilterForUpdate() { 235 return getClubPriceFilter(EntityPermission.READ_WRITE); 236 } 237 238 public void setClubPriceFilterPK(FilterPK clubPriceFilterPK) 239 throws PersistenceNotNullException, PersistenceReadOnlyException { 240 checkReadWrite(); 241 _value.setClubPriceFilterPK(clubPriceFilterPK); 242 } 243 244 public void setClubPriceFilter(Filter entity) { 245 setClubPriceFilterPK(entity == null? null: entity.getPrimaryKey()); 246 } 247 248 public boolean getClubPriceFilterPKHasBeenModified() { 249 return _value.getClubPriceFilterPKHasBeenModified(); 250 } 251 252 public CurrencyPK getCurrencyPK() { 253 return _value.getCurrencyPK(); 254 } 255 256 public Currency getCurrency(EntityPermission entityPermission) { 257 CurrencyPK pk = getCurrencyPK(); 258 Currency entity = pk == null? null: CurrencyFactory.getInstance().getEntityFromPK(entityPermission, pk); 259 260 return entity; 261 } 262 263 public Currency getCurrency() { 264 return getCurrency(EntityPermission.READ_ONLY); 265 } 266 267 public Currency getCurrencyForUpdate() { 268 return getCurrency(EntityPermission.READ_WRITE); 269 } 270 271 public void setCurrencyPK(CurrencyPK currencyPK) 272 throws PersistenceNotNullException, PersistenceReadOnlyException { 273 checkReadWrite(); 274 _value.setCurrencyPK(currencyPK); 275 } 276 277 public void setCurrency(Currency entity) { 278 setCurrencyPK(entity == null? null: entity.getPrimaryKey()); 279 } 280 281 public boolean getCurrencyPKHasBeenModified() { 282 return _value.getCurrencyPKHasBeenModified(); 283 } 284 285 public Boolean getIsDefault() { 286 return _value.getIsDefault(); 287 } 288 289 public void setIsDefault(Boolean isDefault) 290 throws PersistenceNotNullException, PersistenceReadOnlyException { 291 checkReadWrite(); 292 _value.setIsDefault(isDefault); 293 } 294 295 public boolean getIsDefaultHasBeenModified() { 296 return _value.getIsDefaultHasBeenModified(); 297 } 298 299 public Integer getSortOrder() { 300 return _value.getSortOrder(); 301 } 302 303 public void setSortOrder(Integer sortOrder) 304 throws PersistenceNotNullException, PersistenceReadOnlyException { 305 checkReadWrite(); 306 _value.setSortOrder(sortOrder); 307 } 308 309 public boolean getSortOrderHasBeenModified() { 310 return _value.getSortOrderHasBeenModified(); 311 } 312 313 public Long getFromTime() { 314 return _value.getFromTime(); 315 } 316 317 public void setFromTime(Long fromTime) 318 throws PersistenceNotNullException, PersistenceReadOnlyException { 319 checkReadWrite(); 320 _value.setFromTime(fromTime); 321 } 322 323 public boolean getFromTimeHasBeenModified() { 324 return _value.getFromTimeHasBeenModified(); 325 } 326 327 public Long getThruTime() { 328 return _value.getThruTime(); 329 } 330 331 public void setThruTime(Long thruTime) 332 throws PersistenceNotNullException, PersistenceReadOnlyException { 333 checkReadWrite(); 334 _value.setThruTime(thruTime); 335 } 336 337 public boolean getThruTimeHasBeenModified() { 338 return _value.getThruTimeHasBeenModified(); 339 } 340 341}