1 // Do not edit this file! It was generated by Melati POEM's DSD preprocessor.
2
3 package org.melati.admin.test.generated;
4
5
6 import org.melati.admin.test.AdminTestDatabaseTables;
7 import org.melati.admin.test.UserTable;
8 import org.melati.poem.AccessPoemException;
9 import org.melati.poem.Column;
10 import org.melati.poem.Field;
11 import org.melati.poem.User;
12 import org.melati.poem.ValidationPoemException;
13
14
15 /**
16 * Melati POEM generated abstract base class for a <code>Persistent</code>
17 * <code>User</code> Object.
18 *
19 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava
20 */
21 public abstract class UserBase extends User {
22
23
24 /**
25 * Retrieves the Database object.
26 *
27 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava
28 * @return the database
29 */
30 public AdminTestDatabaseTables getAdminTestDatabaseTables() {
31 return (AdminTestDatabaseTables)getDatabase();
32 }
33
34
35 /**
36 * Retrieves the <code>UserTable</code> table
37 * which this <code>Persistent</code> is from.
38 *
39 * @see org.melati.poem.prepro.TableDef#generatePersistentBaseJava
40 * @return the org.melati.poem.UserTable
41 */
42 public org.melati.poem.UserTable getUserTable() {
43 return (org.melati.poem.UserTable)getTable();
44 }
45
46 private UserTable _getUserTable() {
47 return (UserTable)getTable();
48 }
49
50 // Fields in this table
51 /**
52 * email - The user's email address
53 */
54 protected String email;
55
56
57 /**
58 * Retrieves the <code>Email</code> value, without locking,
59 * for this <code>User</code> <code>Persistent</code>.
60 *
61 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
62 * @return the String email
63 */
64 public String getEmail_unsafe() {
65 return email;
66 }
67
68
69 /**
70 * Sets the <code>Email</code> value directly, without checking,
71 * for this User <code>Persistent</code>.
72 *
73 * @see org.melati.poem.prepro.FieldDef#generateBaseMethods
74 * @param cooked the pre-validated value to set
75 */
76 public void setEmail_unsafe(String cooked) {
77 email = cooked;
78 }
79
80 /**
81 * Retrieves the Email value, with locking, for this
82 * <code>User</code> <code>Persistent</code>.
83 * Field description:
84 * The user's email address
85 *
86 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
87 * @throws AccessPoemException
88 * if the current <code>AccessToken</code>
89 * does not confer write access rights
90 * @return the value of the field <code>Email</code> for this
91 * <code>User</code> <code>Persistent</code>
92 */
93
94 public String getEmail()
95 throws AccessPoemException {
96 readLock();
97 return getEmail_unsafe();
98 }
99
100
101 /**
102 * Sets the <code>Email</code> value, with checking, for this
103 * <code>User</code> <code>Persistent</code>.
104 * Field description:
105 * The user's email address
106 *
107 * @generator org.melati.poem.prepro.AtomFieldDef#generateBaseMethods
108 * @param cooked a validated <code>int</code>
109 * @throws AccessPoemException
110 * if the current <code>AccessToken</code>
111 * does not confer write access rights
112 * @throws ValidationPoemException
113 * if the value is not valid
114 */
115 public void setEmail(String cooked)
116 throws AccessPoemException, ValidationPoemException {
117 _getUserTable().getEmailColumn().
118 getType().assertValidCooked(cooked);
119 writeLock();
120 setEmail_unsafe(cooked);
121 }
122
123
124 /**
125 * Retrieves the <code>Email</code> value as a <code>Field</code>
126 * from this <code>User</code> <code>Persistent</code>.
127 *
128 * @see org.melati.poem.prepro.FieldDef#generateFieldCreator
129 * @throws AccessPoemException
130 * if the current <code>AccessToken</code>
131 * does not confer write access rights
132 * @return the String email
133 */
134 public Field getEmailField() throws AccessPoemException {
135 Column c = _getUserTable().getEmailColumn();
136 return new Field(c.getRaw(this), c);
137 }
138 }
139