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 * Language.java
021 */
022
023package com.echothree.model.data.party.server.entity;
024
025import com.echothree.model.data.party.common.pk.LanguagePK;
026
027import com.echothree.model.data.party.common.pk.LanguagePK;
028
029import com.echothree.model.data.party.server.value.LanguageValue;
030
031import com.echothree.model.data.party.server.factory.LanguageFactory;
032
033import com.echothree.util.common.exception.PersistenceException;
034import com.echothree.util.common.exception.PersistenceDatabaseException;
035import com.echothree.util.common.exception.PersistenceNotNullException;
036import com.echothree.util.common.exception.PersistenceReadOnlyException;
037
038import com.echothree.util.common.persistence.BasePK;
039
040import com.echothree.util.common.persistence.type.ByteArray;
041
042import com.echothree.util.server.persistence.BaseEntity;
043import com.echothree.util.server.persistence.EntityPermission;
044import com.echothree.util.server.persistence.Session;
045import com.echothree.util.server.persistence.ThreadSession;
046
047import java.io.Serializable;
048
049public class Language
050        extends BaseEntity
051        implements Serializable {
052    
053    private LanguagePK _pk;
054    private LanguageValue _value;
055    
056    /** Creates a new instance of Language */
057    public Language()
058            throws PersistenceException {
059        super();
060    }
061    
062    /** Creates a new instance of Language */
063    public Language(LanguageValue value, EntityPermission entityPermission) {
064        super(entityPermission);
065        
066        _value = value;
067        _pk = value.getPrimaryKey();
068    }
069    
070    @Override
071    public LanguageFactory getBaseFactoryInstance() {
072        return LanguageFactory.getInstance();
073    }
074    
075    @Override
076    public boolean hasBeenModified() {
077        return _value.hasBeenModified();
078    }
079    
080    @Override
081    public int hashCode() {
082        return _pk.hashCode();
083    }
084    
085    @Override
086    public String toString() {
087        return _pk.toString();
088    }
089    
090    @Override
091    public boolean equals(Object other) {
092        if(this == other)
093            return true;
094        
095        if(other instanceof Language that) {
096            LanguageValue thatValue = that.getLanguageValue();
097            return _value.equals(thatValue);
098        } else {
099            return false;
100        }
101    }
102    
103    @Override
104    public void store(Session session)
105            throws PersistenceDatabaseException {
106        getBaseFactoryInstance().store(session, this);
107    }
108    
109    @Override
110    public void remove(Session session)
111            throws PersistenceDatabaseException {
112        getBaseFactoryInstance().remove(session, this);
113    }
114    
115    @Override
116    public void remove()
117            throws PersistenceDatabaseException {
118        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
119    }
120    
121    public LanguageValue getLanguageValue() {
122        return _value;
123    }
124    
125    public void setLanguageValue(LanguageValue value)
126            throws PersistenceReadOnlyException {
127        checkReadWrite();
128        _value = value;
129    }
130    
131    @Override
132    public LanguagePK getPrimaryKey() {
133        return _pk;
134    }
135    
136    public String getLanguageIsoName() {
137        return _value.getLanguageIsoName();
138    }
139    
140    public void setLanguageIsoName(String languageIsoName)
141            throws PersistenceNotNullException, PersistenceReadOnlyException {
142        checkReadWrite();
143        _value.setLanguageIsoName(languageIsoName);
144    }
145    
146    public boolean getLanguageIsoNameHasBeenModified() {
147        return _value.getLanguageIsoNameHasBeenModified();
148    }
149    
150    public Boolean getIsDefault() {
151        return _value.getIsDefault();
152    }
153    
154    public void setIsDefault(Boolean isDefault)
155            throws PersistenceNotNullException, PersistenceReadOnlyException {
156        checkReadWrite();
157        _value.setIsDefault(isDefault);
158    }
159    
160    public boolean getIsDefaultHasBeenModified() {
161        return _value.getIsDefaultHasBeenModified();
162    }
163    
164    public Integer getSortOrder() {
165        return _value.getSortOrder();
166    }
167    
168    public void setSortOrder(Integer sortOrder)
169            throws PersistenceNotNullException, PersistenceReadOnlyException {
170        checkReadWrite();
171        _value.setSortOrder(sortOrder);
172    }
173    
174    public boolean getSortOrderHasBeenModified() {
175        return _value.getSortOrderHasBeenModified();
176    }
177    
178}