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 * ChainDetail.java 021 */ 022 023package com.echothree.model.data.chain.server.entity; 024 025import com.echothree.model.data.chain.common.pk.ChainDetailPK; 026 027import com.echothree.model.data.chain.common.pk.ChainPK; 028import com.echothree.model.data.chain.common.pk.ChainTypePK; 029import com.echothree.model.data.sequence.common.pk.SequencePK; 030 031import com.echothree.model.data.chain.server.entity.Chain; 032import com.echothree.model.data.chain.server.entity.ChainType; 033import com.echothree.model.data.sequence.server.entity.Sequence; 034 035import com.echothree.model.data.chain.server.factory.ChainFactory; 036import com.echothree.model.data.chain.server.factory.ChainTypeFactory; 037import com.echothree.model.data.sequence.server.factory.SequenceFactory; 038 039import com.echothree.model.data.chain.common.pk.ChainDetailPK; 040 041import com.echothree.model.data.chain.server.value.ChainDetailValue; 042 043import com.echothree.model.data.chain.server.factory.ChainDetailFactory; 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 ChainDetail 062 extends BaseEntity 063 implements Serializable { 064 065 private ChainDetailPK _pk; 066 private ChainDetailValue _value; 067 068 /** Creates a new instance of ChainDetail */ 069 public ChainDetail() 070 throws PersistenceException { 071 super(); 072 } 073 074 /** Creates a new instance of ChainDetail */ 075 public ChainDetail(ChainDetailValue value, EntityPermission entityPermission) { 076 super(entityPermission); 077 078 _value = value; 079 _pk = value.getPrimaryKey(); 080 } 081 082 @Override 083 public ChainDetailFactory getBaseFactoryInstance() { 084 return ChainDetailFactory.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 ChainDetail) { 108 ChainDetail that = (ChainDetail)other; 109 110 ChainDetailValue thatValue = that.getChainDetailValue(); 111 return _value.equals(thatValue); 112 } else { 113 return false; 114 } 115 } 116 117 @Override 118 public void store(Session session) 119 throws PersistenceDatabaseException { 120 getBaseFactoryInstance().store(session, this); 121 } 122 123 @Override 124 public void remove(Session session) 125 throws PersistenceDatabaseException { 126 getBaseFactoryInstance().remove(session, this); 127 } 128 129 @Override 130 public void remove() 131 throws PersistenceDatabaseException { 132 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 133 } 134 135 public ChainDetailValue getChainDetailValue() { 136 return _value; 137 } 138 139 public void setChainDetailValue(ChainDetailValue value) 140 throws PersistenceReadOnlyException { 141 checkReadWrite(); 142 _value = value; 143 } 144 145 @Override 146 public ChainDetailPK getPrimaryKey() { 147 return _pk; 148 } 149 150 public ChainPK getChainPK() { 151 return _value.getChainPK(); 152 } 153 154 public Chain getChain(Session session, EntityPermission entityPermission) { 155 return ChainFactory.getInstance().getEntityFromPK(session, entityPermission, getChainPK()); 156 } 157 158 public Chain getChain(EntityPermission entityPermission) { 159 return getChain(ThreadSession.currentSession(), entityPermission); 160 } 161 162 public Chain getChain(Session session) { 163 return getChain(session, EntityPermission.READ_ONLY); 164 } 165 166 public Chain getChain() { 167 return getChain(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 168 } 169 170 public Chain getChainForUpdate(Session session) { 171 return getChain(session, EntityPermission.READ_WRITE); 172 } 173 174 public Chain getChainForUpdate() { 175 return getChain(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 176 } 177 178 public void setChainPK(ChainPK chainPK) 179 throws PersistenceNotNullException, PersistenceReadOnlyException { 180 checkReadWrite(); 181 _value.setChainPK(chainPK); 182 } 183 184 public void setChain(Chain entity) { 185 setChainPK(entity == null? null: entity.getPrimaryKey()); 186 } 187 188 public boolean getChainPKHasBeenModified() { 189 return _value.getChainPKHasBeenModified(); 190 } 191 192 public ChainTypePK getChainTypePK() { 193 return _value.getChainTypePK(); 194 } 195 196 public ChainType getChainType(Session session, EntityPermission entityPermission) { 197 return ChainTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getChainTypePK()); 198 } 199 200 public ChainType getChainType(EntityPermission entityPermission) { 201 return getChainType(ThreadSession.currentSession(), entityPermission); 202 } 203 204 public ChainType getChainType(Session session) { 205 return getChainType(session, EntityPermission.READ_ONLY); 206 } 207 208 public ChainType getChainType() { 209 return getChainType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 210 } 211 212 public ChainType getChainTypeForUpdate(Session session) { 213 return getChainType(session, EntityPermission.READ_WRITE); 214 } 215 216 public ChainType getChainTypeForUpdate() { 217 return getChainType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 218 } 219 220 public void setChainTypePK(ChainTypePK chainTypePK) 221 throws PersistenceNotNullException, PersistenceReadOnlyException { 222 checkReadWrite(); 223 _value.setChainTypePK(chainTypePK); 224 } 225 226 public void setChainType(ChainType entity) { 227 setChainTypePK(entity == null? null: entity.getPrimaryKey()); 228 } 229 230 public boolean getChainTypePKHasBeenModified() { 231 return _value.getChainTypePKHasBeenModified(); 232 } 233 234 public String getChainName() { 235 return _value.getChainName(); 236 } 237 238 public void setChainName(String chainName) 239 throws PersistenceNotNullException, PersistenceReadOnlyException { 240 checkReadWrite(); 241 _value.setChainName(chainName); 242 } 243 244 public boolean getChainNameHasBeenModified() { 245 return _value.getChainNameHasBeenModified(); 246 } 247 248 public SequencePK getChainInstanceSequencePK() { 249 return _value.getChainInstanceSequencePK(); 250 } 251 252 public Sequence getChainInstanceSequence(Session session, EntityPermission entityPermission) { 253 SequencePK pk = getChainInstanceSequencePK(); 254 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 255 256 return entity; 257 } 258 259 public Sequence getChainInstanceSequence(EntityPermission entityPermission) { 260 return getChainInstanceSequence(ThreadSession.currentSession(), entityPermission); 261 } 262 263 public Sequence getChainInstanceSequence(Session session) { 264 return getChainInstanceSequence(session, EntityPermission.READ_ONLY); 265 } 266 267 public Sequence getChainInstanceSequence() { 268 return getChainInstanceSequence(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 269 } 270 271 public Sequence getChainInstanceSequenceForUpdate(Session session) { 272 return getChainInstanceSequence(session, EntityPermission.READ_WRITE); 273 } 274 275 public Sequence getChainInstanceSequenceForUpdate() { 276 return getChainInstanceSequence(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 277 } 278 279 public void setChainInstanceSequencePK(SequencePK chainInstanceSequencePK) 280 throws PersistenceNotNullException, PersistenceReadOnlyException { 281 checkReadWrite(); 282 _value.setChainInstanceSequencePK(chainInstanceSequencePK); 283 } 284 285 public void setChainInstanceSequence(Sequence entity) { 286 setChainInstanceSequencePK(entity == null? null: entity.getPrimaryKey()); 287 } 288 289 public boolean getChainInstanceSequencePKHasBeenModified() { 290 return _value.getChainInstanceSequencePKHasBeenModified(); 291 } 292 293 public Boolean getIsDefault() { 294 return _value.getIsDefault(); 295 } 296 297 public void setIsDefault(Boolean isDefault) 298 throws PersistenceNotNullException, PersistenceReadOnlyException { 299 checkReadWrite(); 300 _value.setIsDefault(isDefault); 301 } 302 303 public boolean getIsDefaultHasBeenModified() { 304 return _value.getIsDefaultHasBeenModified(); 305 } 306 307 public Integer getSortOrder() { 308 return _value.getSortOrder(); 309 } 310 311 public void setSortOrder(Integer sortOrder) 312 throws PersistenceNotNullException, PersistenceReadOnlyException { 313 checkReadWrite(); 314 _value.setSortOrder(sortOrder); 315 } 316 317 public boolean getSortOrderHasBeenModified() { 318 return _value.getSortOrderHasBeenModified(); 319 } 320 321 public Long getFromTime() { 322 return _value.getFromTime(); 323 } 324 325 public void setFromTime(Long fromTime) 326 throws PersistenceNotNullException, PersistenceReadOnlyException { 327 checkReadWrite(); 328 _value.setFromTime(fromTime); 329 } 330 331 public boolean getFromTimeHasBeenModified() { 332 return _value.getFromTimeHasBeenModified(); 333 } 334 335 public Long getThruTime() { 336 return _value.getThruTime(); 337 } 338 339 public void setThruTime(Long thruTime) 340 throws PersistenceNotNullException, PersistenceReadOnlyException { 341 checkReadWrite(); 342 _value.setThruTime(thruTime); 343 } 344 345 public boolean getThruTimeHasBeenModified() { 346 return _value.getThruTimeHasBeenModified(); 347 } 348 349}