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 * GlAccountClassDetail.java 021 */ 022 023package com.echothree.model.data.accounting.server.entity; 024 025import com.echothree.model.data.accounting.common.pk.GlAccountClassDetailPK; 026 027import com.echothree.model.data.accounting.common.pk.GlAccountClassPK; 028 029import com.echothree.model.data.accounting.server.entity.GlAccountClass; 030 031import com.echothree.model.data.accounting.server.factory.GlAccountClassFactory; 032 033import com.echothree.model.data.accounting.common.pk.GlAccountClassDetailPK; 034 035import com.echothree.model.data.accounting.server.value.GlAccountClassDetailValue; 036 037import com.echothree.model.data.accounting.server.factory.GlAccountClassDetailFactory; 038 039import com.echothree.util.common.exception.PersistenceException; 040import com.echothree.util.common.exception.PersistenceDatabaseException; 041import com.echothree.util.common.exception.PersistenceNotNullException; 042import com.echothree.util.common.exception.PersistenceReadOnlyException; 043 044import com.echothree.util.common.persistence.BasePK; 045 046import com.echothree.util.common.persistence.type.ByteArray; 047 048import com.echothree.util.server.persistence.BaseEntity; 049import com.echothree.util.server.persistence.EntityPermission; 050import com.echothree.util.server.persistence.Session; 051import com.echothree.util.server.persistence.ThreadSession; 052 053import java.io.Serializable; 054 055import javax.annotation.Nonnull; 056import javax.annotation.Nullable; 057 058public class GlAccountClassDetail 059 extends BaseEntity 060 implements Serializable { 061 062 private GlAccountClassDetailPK _pk; 063 private GlAccountClassDetailValue _value; 064 065 /** Creates a new instance of GlAccountClassDetail */ 066 public GlAccountClassDetail() 067 throws PersistenceException { 068 super(); 069 } 070 071 /** Creates a new instance of GlAccountClassDetail */ 072 public GlAccountClassDetail(GlAccountClassDetailValue value, EntityPermission entityPermission) { 073 super(entityPermission); 074 075 _value = value; 076 _pk = value.getPrimaryKey(); 077 } 078 079 @Override 080 @Nonnull 081 public GlAccountClassDetailFactory getBaseFactoryInstance() { 082 return GlAccountClassDetailFactory.getInstance(); 083 } 084 085 @Override 086 public boolean hasBeenModified() { 087 return _value.hasBeenModified(); 088 } 089 090 @Override 091 public int hashCode() { 092 return _pk.hashCode(); 093 } 094 095 @Override 096 @Nonnull 097 public String toString() { 098 return _pk.toString(); 099 } 100 101 @Override 102 public boolean equals(Object other) { 103 if(this == other) 104 return true; 105 106 if(other instanceof GlAccountClassDetail that) { 107 GlAccountClassDetailValue thatValue = that.getGlAccountClassDetailValue(); 108 return _value.equals(thatValue); 109 } else { 110 return false; 111 } 112 } 113 114 @Override 115 public void store() 116 throws PersistenceDatabaseException { 117 getBaseFactoryInstance().store(this); 118 } 119 120 @Override 121 public void remove() 122 throws PersistenceDatabaseException { 123 getBaseFactoryInstance().remove(this); 124 } 125 126 @Nonnull 127 public GlAccountClassDetailValue getGlAccountClassDetailValue() { 128 return _value; 129 } 130 131 public void setGlAccountClassDetailValue(@Nonnull GlAccountClassDetailValue value) 132 throws PersistenceReadOnlyException { 133 checkReadWrite(); 134 _value = value; 135 } 136 137 @Override 138 @Nonnull 139 public GlAccountClassDetailPK getPrimaryKey() { 140 return _pk; 141 } 142 143 @Nonnull 144 public GlAccountClassPK getGlAccountClassPK() { 145 return _value.getGlAccountClassPK(); 146 } 147 148 @Nonnull 149 public GlAccountClass getGlAccountClass(EntityPermission entityPermission) { 150 return GlAccountClassFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountClassPK()); 151 } 152 153 @Nonnull 154 public GlAccountClass getGlAccountClass() { 155 return getGlAccountClass(EntityPermission.READ_ONLY); 156 } 157 158 @Nonnull 159 public GlAccountClass getGlAccountClassForUpdate() { 160 return getGlAccountClass(EntityPermission.READ_WRITE); 161 } 162 163 public void setGlAccountClassPK(@Nonnull GlAccountClassPK glAccountClassPK) 164 throws PersistenceNotNullException, PersistenceReadOnlyException { 165 checkReadWrite(); 166 _value.setGlAccountClassPK(glAccountClassPK); 167 } 168 169 public void setGlAccountClass(@Nonnull GlAccountClass entity) { 170 setGlAccountClassPK(entity == null ? null : entity.getPrimaryKey()); 171 } 172 173 public boolean getGlAccountClassPKHasBeenModified() { 174 return _value.getGlAccountClassPKHasBeenModified(); 175 } 176 177 @Nonnull 178 public String getGlAccountClassName() { 179 return _value.getGlAccountClassName(); 180 } 181 182 public void setGlAccountClassName(@Nonnull String glAccountClassName) 183 throws PersistenceNotNullException, PersistenceReadOnlyException { 184 checkReadWrite(); 185 _value.setGlAccountClassName(glAccountClassName); 186 } 187 188 public boolean getGlAccountClassNameHasBeenModified() { 189 return _value.getGlAccountClassNameHasBeenModified(); 190 } 191 192 @Nullable 193 public GlAccountClassPK getParentGlAccountClassPK() { 194 return _value.getParentGlAccountClassPK(); 195 } 196 197 @Nullable 198 public GlAccountClass getParentGlAccountClass(EntityPermission entityPermission) { 199 GlAccountClassPK pk = getParentGlAccountClassPK(); 200 GlAccountClass entity = pk == null? null: GlAccountClassFactory.getInstance().getEntityFromPK(entityPermission, pk); 201 202 return entity; 203 } 204 205 @Nullable 206 public GlAccountClass getParentGlAccountClass() { 207 return getParentGlAccountClass(EntityPermission.READ_ONLY); 208 } 209 210 @Nullable 211 public GlAccountClass getParentGlAccountClassForUpdate() { 212 return getParentGlAccountClass(EntityPermission.READ_WRITE); 213 } 214 215 public void setParentGlAccountClassPK(@Nullable GlAccountClassPK parentGlAccountClassPK) 216 throws PersistenceNotNullException, PersistenceReadOnlyException { 217 checkReadWrite(); 218 _value.setParentGlAccountClassPK(parentGlAccountClassPK); 219 } 220 221 public void setParentGlAccountClass(@Nullable GlAccountClass entity) { 222 setParentGlAccountClassPK(entity == null ? null : entity.getPrimaryKey()); 223 } 224 225 public boolean getParentGlAccountClassPKHasBeenModified() { 226 return _value.getParentGlAccountClassPKHasBeenModified(); 227 } 228 229 @Nonnull 230 public Boolean getIsDefault() { 231 return _value.getIsDefault(); 232 } 233 234 public void setIsDefault(@Nonnull Boolean isDefault) 235 throws PersistenceNotNullException, PersistenceReadOnlyException { 236 checkReadWrite(); 237 _value.setIsDefault(isDefault); 238 } 239 240 public boolean getIsDefaultHasBeenModified() { 241 return _value.getIsDefaultHasBeenModified(); 242 } 243 244 @Nonnull 245 public Integer getSortOrder() { 246 return _value.getSortOrder(); 247 } 248 249 public void setSortOrder(@Nonnull Integer sortOrder) 250 throws PersistenceNotNullException, PersistenceReadOnlyException { 251 checkReadWrite(); 252 _value.setSortOrder(sortOrder); 253 } 254 255 public boolean getSortOrderHasBeenModified() { 256 return _value.getSortOrderHasBeenModified(); 257 } 258 259 @Nonnull 260 public Long getFromTime() { 261 return _value.getFromTime(); 262 } 263 264 public void setFromTime(@Nonnull Long fromTime) 265 throws PersistenceNotNullException, PersistenceReadOnlyException { 266 checkReadWrite(); 267 _value.setFromTime(fromTime); 268 } 269 270 public boolean getFromTimeHasBeenModified() { 271 return _value.getFromTimeHasBeenModified(); 272 } 273 274 @Nonnull 275 public Long getThruTime() { 276 return _value.getThruTime(); 277 } 278 279 public void setThruTime(@Nonnull Long thruTime) 280 throws PersistenceNotNullException, PersistenceReadOnlyException { 281 checkReadWrite(); 282 _value.setThruTime(thruTime); 283 } 284 285 public boolean getThruTimeHasBeenModified() { 286 return _value.getThruTimeHasBeenModified(); 287 } 288 289}