View Javadoc

1   /* (c) Copyright 2003 Caleigo AB, All rights reserved. 
2    * 
3    * This library is free software; you can redistribute it and/or
4    * modify it under the terms of the GNU Lesser General Public
5    * License as published by the Free Software Foundation; either
6    * version 2.1 of the License, or (at your option) any later version.
7    * 
8    * This library is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11   * Lesser General Public License for more details.
12   * 
13   * You should have received a copy of the GNU Lesser General Public
14   * License along with this library; if not, write to the Free Software
15   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16   *  
17   */
18  package org.caleigo.core.meta;
19  
20  import org.caleigo.core.*;
21  
22  /*** MetaEntityDescriptorEntiy is the entity class for MetaEntityDescriptor objects.
23  *
24  * @author dennis
25  * @version 1.0.0
26  *//*
27  * WHEN    WHO                WHY & WHAT 
28  * ------------------------------------------------------------------------------
29  * 030627  dennis    Creation
30  */
31  public class MetaEntityDescriptorEntity extends AbstractMetaEntity 
32  {
33      // Constructors ------------------------------------------------------------
34      
35      /*** Default constructor for MetaEntityDescriptorEntity.
36       */
37      public MetaEntityDescriptorEntity() 
38      {
39      }
40      
41      /*** Copy constructor for MetaEntityDescriptorEntity.
42       */
43      public MetaEntityDescriptorEntity(MetaEntityDescriptorEntity entity) 
44      {
45          this.copyData(entity);
46          this.clearAllDirtyFlags();
47      }
48      
49      /*** This constructor creates a new MetaEntityDescriptorEntity and loads
50       * it with data from the data source using the entity's identity data.
51       */
52      public MetaEntityDescriptorEntity(String aSourceName) 
53      {
54          super(Qualifier.create(MetaEntityDescriptor.SourceName, new String(aSourceName)));
55      }
56      
57      
58      /*** This constructor creates a new MetaEntityDescriptorEntity and loads
59       * it with data from the data source using the provided identity qualifier.
60       */
61      public MetaEntityDescriptorEntity(Qualifier identityQualifier) 
62      {
63          super(identityQualifier);
64      }
65      
66      // Superclass overrides ----------------------------------------------------
67      public IEntityDescriptor getEntityDescriptor()
68      {
69          return MetaEntityDescriptor.instance;
70      }
71          
72      // Access methods ----------------------------------------------------------
73      public String getSourceName() {return (String)this.getData(MetaEntityDescriptor.SourceName);}
74      public String getCodeName() {return (String)this.getData(MetaEntityDescriptor.CodeName);}
75      public String getDisplayName() {return (String)this.getData(MetaEntityDescriptor.DisplayName);}
76      public int getEntityType() {return this.getDataInteger(MetaEntityDescriptor.EntityType);}
77      public int getSizeType() {return this.getDataInteger(MetaEntityDescriptor.SizeType);}
78      public int getCacheTime() {return this.getDataInteger(MetaEntityDescriptor.CacheTime);}
79      public boolean isCreatable() {return this.getDataBoolean(MetaEntityDescriptor.Creatable);}
80      public boolean isEditable() {return this.getDataBoolean(MetaEntityDescriptor.Editable);}
81      public boolean isDeletable() {return this.getDataBoolean(MetaEntityDescriptor.Deletable);}
82      public String getParentDataSource() {return (String)this.getData(MetaEntityDescriptor.DataSource);}
83  
84      public void setSourceName(String value) {this.setData(MetaEntityDescriptor.SourceName, value);}
85      public void setCodeName(String value) {this.setData(MetaEntityDescriptor.CodeName, value);}
86      public void setDisplayName(String value) {this.setData(MetaEntityDescriptor.DisplayName, value);}
87      public void setEntityType(int value) {this.setDataInteger(MetaEntityDescriptor.EntityType, value);}
88      public void setSizeType(int value) {this.setDataInteger(MetaEntityDescriptor.SizeType, value);}
89      public void setCacheTime(int value) {this.setDataInteger(MetaEntityDescriptor.CacheTime, value);}
90      public void setCreatable(boolean value) {this.setDataBoolean(MetaEntityDescriptor.Creatable, value);}
91      public void setEditable(boolean value) {this.setDataBoolean(MetaEntityDescriptor.Editable, value);}
92      public void setDeletable(boolean value) {this.setDataBoolean(MetaEntityDescriptor.Deletable, value);}
93      public void setParentDataSource(String value) {this.setData(MetaEntityDescriptor.DataSource, value);}
94  
95      public Object getSourceNameData() {return this.getData(MetaEntityDescriptor.SourceName);}
96      public Object getCodeNameData() {return this.getData(MetaEntityDescriptor.CodeName);}
97      public Object getDisplayNameData() {return this.getData(MetaEntityDescriptor.DisplayName);}
98      public Object getEntityTypeData() {return this.getData(MetaEntityDescriptor.EntityType);}
99      public Object getSizeTypeData() {return this.getData(MetaEntityDescriptor.SizeType);}
100     public Object getCacheTimeData() {return this.getData(MetaEntityDescriptor.CacheTime);}
101     public Object getCreatableData() {return this.getData(MetaEntityDescriptor.Creatable);}
102     public Object getEditableData() {return this.getData(MetaEntityDescriptor.Editable);}
103     public Object getDeletableData() {return this.getData(MetaEntityDescriptor.Deletable);}
104     public Object getDataSourceData() {return this.getData(MetaEntityDescriptor.DataSource);}
105 
106     public void setSourceNameData(Object value) {this.setData(MetaEntityDescriptor.SourceName, value);}
107     public void setCodeNameData(Object value) {this.setData(MetaEntityDescriptor.CodeName, value);}
108     public void setDisplayNameData(Object value) {this.setData(MetaEntityDescriptor.DisplayName, value);}
109     public void setEntityTypeData(Object value) {this.setData(MetaEntityDescriptor.EntityType, value);}
110     public void setSizeTypeData(Object value) {this.setData(MetaEntityDescriptor.SizeType, value);}
111     public void setCacheTimeData(Object value) {this.setData(MetaEntityDescriptor.CacheTime, value);}
112     public void setCreatableData(Object value) {this.setData(MetaEntityDescriptor.Creatable, value);}
113     public void setEditableData(Object value) {this.setData(MetaEntityDescriptor.Editable, value);}
114     public void setDeletableData(Object value) {this.setData(MetaEntityDescriptor.Deletable, value);}
115     public void setDataSourceData(Object value) {this.setData(MetaEntityDescriptor.DataSource, value);}
116 }