View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.xml.schema.annotations.jdo;
9   
10  /**
11   * Element 'table' is used to specify the table where the
12   *  Object will be saved.
13   *  
14   * 
15   * @version $Revision$ $Date$
16   */
17  @SuppressWarnings("serial")
18  public class Table implements java.io.Serializable {
19  
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * Attribute 'name' is used to specify the name of
27       *  the table.
28       *  
29       */
30      private java.lang.String _name;
31  
32      /**
33       * Field _accessMode.
34       */
35      private types.TableAccessModeType _accessMode = types.TableAccessModeType.fromValue("shared");
36  
37      /**
38       * Attribute 'detachable' is used to indicate that the 
39       *  domain entity generated will support Castor JDO
40       *  long transactions out of the box. 
41       *  
42       */
43      private boolean _detachable = false;
44  
45      /**
46       * keeps track of state for field: _detachable
47       */
48      private boolean _has_detachable;
49  
50      /**
51       * Field _primaryKey.
52       */
53      private org.exolab.castor.xml.schema.annotations.jdo.PrimaryKey _primaryKey;
54  
55  
56        //----------------/
57       //- Constructors -/
58      //----------------/
59  
60      public Table() {
61          super();
62          setAccessMode(types.TableAccessModeType.fromValue("shared"));
63      }
64  
65  
66        //-----------/
67       //- Methods -/
68      //-----------/
69  
70      /**
71       */
72      public void deleteDetachable(
73      ) {
74          this._has_detachable= false;
75      }
76  
77      /**
78       * Returns the value of field 'accessMode'.
79       * 
80       * @return the value of field 'AccessMode'.
81       */
82      public types.TableAccessModeType getAccessMode(
83      ) {
84          return this._accessMode;
85      }
86  
87      /**
88       * Returns the value of field 'detachable'. The field
89       * 'detachable' has the following description: Attribute
90       * 'detachable' is used to indicate that the 
91       *  domain entity generated will support Castor JDO
92       *  long transactions out of the box. 
93       *  
94       * 
95       * @return the value of field 'Detachable'.
96       */
97      public boolean getDetachable(
98      ) {
99          return this._detachable;
100     }
101 
102     /**
103      * Returns the value of field 'name'. The field 'name' has the
104      * following description: Attribute 'name' is used to specify
105      * the name of
106      *  the table.
107      *  
108      * 
109      * @return the value of field 'Name'.
110      */
111     public java.lang.String getName(
112     ) {
113         return this._name;
114     }
115 
116     /**
117      * Returns the value of field 'primaryKey'.
118      * 
119      * @return the value of field 'PrimaryKey'.
120      */
121     public org.exolab.castor.xml.schema.annotations.jdo.PrimaryKey getPrimaryKey(
122     ) {
123         return this._primaryKey;
124     }
125 
126     /**
127      * Method hasDetachable.
128      * 
129      * @return true if at least one Detachable has been added
130      */
131     public boolean hasDetachable(
132     ) {
133         return this._has_detachable;
134     }
135 
136     /**
137      * Returns the value of field 'detachable'. The field
138      * 'detachable' has the following description: Attribute
139      * 'detachable' is used to indicate that the 
140      *  domain entity generated will support Castor JDO
141      *  long transactions out of the box. 
142      *  
143      * 
144      * @return the value of field 'Detachable'.
145      */
146     public boolean isDetachable(
147     ) {
148         return this._detachable;
149     }
150 
151     /**
152      * Method isValid.
153      * 
154      * @return true if this object is valid according to the schema
155      */
156     public boolean isValid(
157     ) {
158         try {
159             validate();
160         } catch (org.exolab.castor.xml.ValidationException vex) {
161             return false;
162         }
163         return true;
164     }
165 
166     /**
167      * 
168      * 
169      * @param out
170      * @throws org.exolab.castor.xml.MarshalException if object is
171      * null or if any SAXException is thrown during marshaling
172      * @throws org.exolab.castor.xml.ValidationException if this
173      * object is an invalid instance according to the schema
174      */
175     public void marshal(
176             final java.io.Writer out)
177     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
178         org.exolab.castor.xml.Marshaller.marshal(this, out);
179     }
180 
181     /**
182      * 
183      * 
184      * @param handler
185      * @throws java.io.IOException if an IOException occurs during
186      * marshaling
187      * @throws org.exolab.castor.xml.ValidationException if this
188      * object is an invalid instance according to the schema
189      * @throws org.exolab.castor.xml.MarshalException if object is
190      * null or if any SAXException is thrown during marshaling
191      */
192     public void marshal(
193             final org.xml.sax.ContentHandler handler)
194     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
195         org.exolab.castor.xml.Marshaller.marshal(this, handler);
196     }
197 
198     /**
199      * Sets the value of field 'accessMode'.
200      * 
201      * @param accessMode the value of field 'accessMode'.
202      */
203     public void setAccessMode(
204             final types.TableAccessModeType accessMode) {
205         this._accessMode = accessMode;
206     }
207 
208     /**
209      * Sets the value of field 'detachable'. The field 'detachable'
210      * has the following description: Attribute 'detachable' is
211      * used to indicate that the 
212      *  domain entity generated will support Castor JDO
213      *  long transactions out of the box. 
214      *  
215      * 
216      * @param detachable the value of field 'detachable'.
217      */
218     public void setDetachable(
219             final boolean detachable) {
220         this._detachable = detachable;
221         this._has_detachable = true;
222     }
223 
224     /**
225      * Sets the value of field 'name'. The field 'name' has the
226      * following description: Attribute 'name' is used to specify
227      * the name of
228      *  the table.
229      *  
230      * 
231      * @param name the value of field 'name'.
232      */
233     public void setName(
234             final java.lang.String name) {
235         this._name = name;
236     }
237 
238     /**
239      * Sets the value of field 'primaryKey'.
240      * 
241      * @param primaryKey the value of field 'primaryKey'.
242      */
243     public void setPrimaryKey(
244             final org.exolab.castor.xml.schema.annotations.jdo.PrimaryKey primaryKey) {
245         this._primaryKey = primaryKey;
246     }
247 
248     /**
249      * Method unmarshal.
250      * 
251      * @param reader
252      * @throws org.exolab.castor.xml.MarshalException if object is
253      * null or if any SAXException is thrown during marshaling
254      * @throws org.exolab.castor.xml.ValidationException if this
255      * object is an invalid instance according to the schema
256      * @return the unmarshaled
257      * org.exolab.castor.xml.schema.annotations.jdo.Table
258      */
259     public static org.exolab.castor.xml.schema.annotations.jdo.Table unmarshal(
260             final java.io.Reader reader)
261     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
262         return (org.exolab.castor.xml.schema.annotations.jdo.Table) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.xml.schema.annotations.jdo.Table.class, reader);
263     }
264 
265     /**
266      * 
267      * 
268      * @throws org.exolab.castor.xml.ValidationException if this
269      * object is an invalid instance according to the schema
270      */
271     public void validate(
272     )
273     throws org.exolab.castor.xml.ValidationException {
274         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
275         validator.validate(this);
276     }
277 
278 }