MentaBean

Rev

Rev 217 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 217 Rev 218
1
/*
1
/*
2
 * This program is free software: you can redistribute it and/or modify
2
 * This program is free software: you can redistribute it and/or modify
3
 * it under the terms of the GNU General Public License as published by
3
 * it under the terms of the GNU General Public License as published by
4
 * the Free Software Foundation, either version 3 of the License, or
4
 * the Free Software Foundation, either version 3 of the License, or
5
 * (at your option) any later version.
5
 * (at your option) any later version.
6
 *
6
 *
7
 * This program is distributed in the hope that it will be useful,
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 * GNU General Public License for more details.
10
 * GNU General Public License for more details.
11
 *
11
 *
12
 * You should have received a copy of the GNU General Public License
12
 * You should have received a copy of the GNU General Public License
13
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
13
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
14
 *
14
 *
15
 * MentaBean => http://www.mentabean.org
15
 * MentaBean => http://www.mentabean.org
16
 * Author: Sergio Oliveira Jr. (sergio.oliveira.jr@gmail.com)
16
 * Author: Sergio Oliveira Jr. (sergio.oliveira.jr@gmail.com)
17
 */
17
 */
18
package org.mentabean;
18
package org.mentabean;
19
19
20
import java.sql.Connection;
20
import java.sql.Connection;
21
import java.sql.ResultSet;
21
import java.sql.ResultSet;
22
import java.util.List;
22
import java.util.List;
23
23
24
import org.mentabean.event.TriggerListener;
24
import org.mentabean.event.TriggerListener;
25
import org.mentabean.jdbc.QueryBuilder;
25
import org.mentabean.jdbc.QueryBuilder;
26
import org.mentabean.sql.TableAlias;
26
import org.mentabean.sql.TableAlias;
27
import org.mentabean.util.Limit;
27
import org.mentabean.util.Limit;
28
import org.mentabean.util.OrderBy;
28
import org.mentabean.util.OrderBy;
29
29
30
/**
30
/**
31
 * Describe a simple ORM interface that can perform CRUD for Beans according to properties defined programmatically on BeanManager. It can also load lists and unique beans based on properties set on a given bean. It also supports dynamic update, in other words, it will only update fields from a bean
31
 * Describe a simple ORM interface that can perform CRUD for Beans according to properties defined programmatically on BeanManager. It can also load lists and unique beans based on properties set on a given bean. It also supports dynamic update, in other words, it will only update fields from a bean
32
 * loaded from the database that were actually modified during the session. The behavior can be turned off when necessary ,in other words, when you want to blindly update all properties from a bean in the database regarding of whether they were modified or not.
32
 * loaded from the database that were actually modified during the session. The behavior can be turned off when necessary ,in other words, when you want to blindly update all properties from a bean in the database regarding of whether they were modified or not.
33
 *
33
 *
34
 * @author Sergio Oliveira Jr.
34
 * @author Sergio Oliveira Jr.
35
 */
35
 */
36
public interface BeanSession {
36
public interface BeanSession {
37
37
38
        public static final int UPDATE = 0, INSERT = 1;
38
        public static final int UPDATE = 0, INSERT = 1;
39
       
39
       
40
        /**
40
        /**
41
         * Get the database connection being used by this bean session.
41
         * Get the database connection being used by this bean session.
42
         *
42
         *
43
         * @return the database connection
43
         * @return the database connection
44
         */
44
         */
45
        public Connection getConnection();
45
        public Connection getConnection();
46
46
47
        /**
47
        /**
48
         * Load the bean from the database, injecting all its properties through reflection. Note that the bean passed MUST have its primary key set otherwise there is no way we can load it from the database.
48
         * Load the bean from the database, injecting all its properties through reflection. Note that the bean passed MUST have its primary key set otherwise there is no way we can load it from the database.
49
         *
49
         *
50
         * @param bean
50
         * @param bean
51
         *            The bean we want to load from the DB.
51
         *            The bean we want to load from the DB.
52
         * @return true if the bean was found in the database, false otherwise
52
         * @return true if the bean was found in the database, false otherwise
53
         */
53
         */
54
        public boolean load(Object bean);
54
        public boolean load(Object bean);
55
       
55
       
56
        public boolean load(Object bean, Object... properties);
56
        public boolean load(Object bean, Object... properties);
57
       
57
       
58
        public boolean loadMinus(Object bean, Object... minus);
58
        public boolean loadMinus(Object bean, Object... minus);
59
59
60
        /**
60
        /**
61
         * Update the bean in the database. Only the bean fields that have been modified (dirty) will be updated.
61
         * Update the bean in the database. Only the bean fields that have been modified (dirty) will be updated.
62
         *
62
         *
63
         * It will return 1 if an update did happen or 0 if the bean could not be found in the database or if there was nothing modified in bean.
63
         * It will return 1 if an update did happen or 0 if the bean could not be found in the database or if there was nothing modified in bean.
64
         *
64
         *
65
         * The bean MUST have its primary key set, otherwise it is impossible to update the bean in the database, and an exception will be thrown.
65
         * The bean MUST have its primary key set, otherwise it is impossible to update the bean in the database, and an exception will be thrown.
66
         *
66
         *
67
         * @param bean
67
         * @param bean
68
         *            The bean to be updated
68
         *            The bean to be updated
69
         * @param forceNull
69
         * @param forceNull
70
         *                        Database columns that will be forced to null if the bean property is not set
70
         *                        Database columns that will be forced to null if the bean property is not set
71
         * @return 1 if update was successful, 0 if the update did not happen or was not necessary
71
         * @return 1 if update was successful, 0 if the update did not happen or was not necessary
72
         */
72
         */
73
        public int update(Object bean, Object... forceNull);
73
        public int update(Object bean, Object... forceNull);
74
74
75
        /**
75
        /**
76
         * Same as update(bean) but here you can turn off the default dynamic update behavior and force all bean properties to be updated regardless whether they have been modified or not.
76
         * Same as update(bean) but here you can turn off the default dynamic update behavior and force all bean properties to be updated regardless whether they have been modified or not.
77
         *
77
         *
78
         * @param bean
78
         * @param bean
79
         * @return the number of rows that were updated
79
         * @return the number of rows that were updated
80
         * @throws Exception
80
         * @throws Exception
81
         */
81
         */
82
        public int updateAll(Object bean);
82
        public int updateAll(Object bean);
83
       
83
       
84
        /**
84
        /**
85
         * Updates an object using only the differences between newBean and oldBean instances.
85
         * Updates an object using only the differences between newBean and oldBean instances.
86
         * This method is useful in distributed environments like RMI or web services because these approaches should serialize objects to send/receive informations from client to server and vice versa
86
         * This method is useful in distributed environments like RMI or web services because these approaches should serialize objects to send/receive informations from client to server and vice versa
87
         * @param newBean
87
         * @param newBean
88
         * @param oldBean
88
         * @param oldBean
89
         * @return 1 if update was successful, 0 if the update did not happen or was not necessary (when bean instances have no differences)
89
         * @return 1 if update was successful, 0 if the update did not happen or was not necessary (when bean instances have no differences)
90
         */
90
         */
91
        public <E> int updateDiff(E newBean, E oldBean);
91
        public <E> int updateDiff(E newBean, E oldBean);
92
92
93
        /**
93
        /**
94
         * Insert the bean in the database.
94
         * Insert the bean in the database.
95
         *
95
         *
96
         * Depending on the type of PK, the generation of the PK can and should be taken care by the DB itself. The generated PK should be inserted in the bean by reflection, before the method returns.
96
         * Depending on the type of PK, the generation of the PK can and should be taken care by the DB itself. The generated PK should be inserted in the bean by reflection, before the method returns.
97
         *
97
         *
98
         * The default, database-independent implementation of this method, insert all fields in the database not worrying about PK generation strategies.
98
         * The default, database-independent implementation of this method, insert all fields in the database not worrying about PK generation strategies.
99
         *
99
         *
100
         * @param bean
100
         * @param bean
101
         *            The bean to insert
101
         *            The bean to insert
102
         */
102
         */
103
        public void insert(Object bean);
103
        public void insert(Object bean);
104
       
104
       
105
        /**
105
        /**
106
         * Tries to update or insert a bean using the <code>update</code> method.
106
         * Tries to update or insert a bean using the <code>update</code> method.
107
         *
107
         *
108
         * @param bean The bean to update or insert
108
         * @param bean The bean to update or insert
109
         * @param forceNull Database columns that will be forced to null (or zero) if the bean property is not set
109
         * @param forceNull Database columns that will be forced to null (or zero) if the bean property is not set
110
         * @return      A value <b>0 (zero)</b> if operation executed an <code>update</code> and <b>1 (one)</b> if <code>insert</code> method was executed
110
         * @return      A value <b>0 (zero)</b> if operation executed an <code>update</code> and <b>1 (one)</b> if <code>insert</code> method was executed
111
         * @see #saveAll(Object)
111
         * @see #saveAll(Object)
112
         * @see #update(Object, Object...)
112
         * @see #update(Object, Object...)
113
         */
113
         */
114
        public int save(Object bean, Object... forceNull);
114
        public int save(Object bean, Object... forceNull);
115
       
115
       
116
        /**
116
        /**
117
         * Tries to update or insert a bean object into database. The update uses the <code>updateAll</code> method.
117
         * Tries to update or insert a bean object into database. The update uses the <code>updateAll</code> method.
118
         *
118
         *
119
         * @param bean The bean to update or insert
119
         * @param bean The bean to update or insert
120
         * @return      A value <b>0 (zero)</b> if operation executed an <code>update</code> and <b>1 (one)</b> if <code>insert</code> method was executed
120
         * @return      A value <b>0 (zero)</b> if operation executed an <code>update</code> and <b>1 (one)</b> if <code>insert</code> method was executed
121
         * @see #updateAll(Object)
121
         * @see #updateAll(Object)
122
         */
122
         */
123
        public int saveAll(Object bean);
123
        public int saveAll(Object bean);
124
124
125
        /**
125
        /**
126
         * Delete the bean from the database.
126
         * Delete the bean from the database.
127
         *
127
         *
128
         * The PK of the bean MUST be set. The bean can only be deleted by its PK.
128
         * The PK of the bean MUST be set. The bean can only be deleted by its PK.
129
         *
129
         *
130
         * @param bean
130
         * @param bean
131
         * @return true if it was deleted or false if it did not exist
131
         * @return true if it was deleted or false if it did not exist
132
         * @throws Exception
132
         * @throws Exception
133
         */
133
         */
134
        public boolean delete(Object bean);
134
        public boolean delete(Object bean);
135
       
135
       
136
        /**
136
        /**
137
         * Delete all data based on the properties present in the bean passed
137
         * Delete all data based on the properties present in the bean passed
138
         *
138
         *
139
         * The PK doesn't need to be set
139
         * The PK doesn't need to be set
140
         *
140
         *
141
         * @param bean
141
         * @param bean
142
         * @return The total of tuples removed from database
142
         * @return The total of tuples removed from database
143
         */
143
         */
144
        public int deleteAll(final Object bean);
144
        public int deleteAll(final Object bean);
145
145
146
        /**
146
        /**
147
         * Count the number of beans that would be returned by a loadList method.
147
         * Count the number of beans that would be returned by a loadList method.
148
         *
148
         *
149
         * @param bean
149
         * @param bean
150
         *            The bean holding the properties used by the list query.
150
         *            The bean holding the properties used by the list query.
151
         * @return the number of beans found in the database
151
         * @return the number of beans found in the database
152
         */
152
         */
153
        public int countList(Object bean);
153
        public int countList(Object bean);
154
154
155
        /**
155
        /**
156
         * Load a list of beans based on the properties present in the bean passed. For example, if you want to load all users with lastName equal to 'saoj' you would instantiate a bean and set its lastName property to 'saoj' before passing it as an argument to this method.
156
         * Load a list of beans based on the properties present in the bean passed. For example, if you want to load all users with lastName equal to 'saoj' you would instantiate a bean and set its lastName property to 'saoj' before passing it as an argument to this method.
157
         *
157
         *
158
         * @param <E>
158
         * @param <E>
159
         * @param bean
159
         * @param bean
160
         *            The bean holding the properties used by the list query.
160
         *            The bean holding the properties used by the list query.
161
         * @return A list of beans the match the properties in the given bean. Or an empty list if nothing was found.
161
         * @return A list of beans the match the properties in the given bean. Or an empty list if nothing was found.
162
         */
162
         */
163
        public <E> List<E> loadList(E bean);
163
        public <E> List<E> loadList(E bean);
164
164
165
        public <E> List<E> loadList(E bean, Object... properties);
165
        public <E> List<E> loadList(E bean, Object... properties);
166
166
167
        public <E> List<E> loadListMinus(E bean, Object... minus);
167
        public <E> List<E> loadListMinus(E bean, Object... minus);
168
168
169
        /**
169
        /**
170
         * Same as loadList(bean) except that you can order the list returned by passing an SQL orderBy clause.
170
         * Same as loadList(bean) except that you can order the list returned by passing an SQL orderBy clause.
171
         *
171
         *
172
         * @param <E>
172
         * @param <E>
173
         * @param bean
173
         * @param bean
174
         *            The bean holding the properties used by the list query.
174
         *            The bean holding the properties used by the list query.
175
         * @param orderBy
175
         * @param orderBy
176
         *            The orderBy SQL clause.
176
         *            The orderBy SQL clause.
177
         * @return A list of beans the match the properties in the given bean. Or an empty list if nothing was found.
177
         * @return A list of beans the match the properties in the given bean. Or an empty list if nothing was found.
178
         */
178
         */
179
        public <E> List<E> loadList(E bean, OrderBy orderBy);
179
        public <E> List<E> loadList(E bean, OrderBy orderBy);
180
180
181
        public <E> List<E> loadList(E bean, OrderBy orderBy, Object... properties);
181
        public <E> List<E> loadList(E bean, OrderBy orderBy, Object... properties);
182
182
183
        public <E> List<E> loadListMinus(E bean, OrderBy orderBy, Object... minus);
183
        public <E> List<E> loadListMinus(E bean, OrderBy orderBy, Object... minus);
184
184
185
        /**
185
        /**
186
         * Same as loadList(bean) except that you can limit the number of beans returned in the list.
186
         * Same as loadList(bean) except that you can limit the number of beans returned in the list.
187
         *
187
         *
188
         * @param <E>
188
         * @param <E>
189
         * @param bean
189
         * @param bean
190
         *            The bean holding the properties used by the list query.
190
         *            The bean holding the properties used by the list query.
191
         * @param limit
191
         * @param limit
192
         *            The max number of beans returned in the list.
192
         *            The max number of beans returned in the list.
193
         * @return A list of beans the match the properties in the given bean. Or an empty list if nothing was found.
193
         * @return A list of beans the match the properties in the given bean. Or an empty list if nothing was found.
194
         */
194
         */
195
        public <E> List<E> loadList(E bean, Limit limit);
195
        public <E> List<E> loadList(E bean, Limit limit);
196
196
197
        public <E> List<E> loadList(E bean, Limit limit, Object... properties);
197
        public <E> List<E> loadList(E bean, Limit limit, Object... properties);
198
198
199
        public <E> List<E> loadListMinus(E bean, Limit limit, Object... minus);
199
        public <E> List<E> loadListMinus(E bean, Limit limit, Object... minus);
200
200
201
        /**
201
        /**
202
         * Same as loadList(bean) except that you can limit the number of beans returned in the list as well as sort them by passing a orderBy SQL clause.
202
         * Same as loadList(bean) except that you can limit the number of beans returned in the list as well as sort them by passing a orderBy SQL clause.
203
         *
203
         *
204
         * @param <E>
204
         * @param <E>
205
         * @param bean
205
         * @param bean
206
         *            The bean holding the properties used by the list query.
206
         *            The bean holding the properties used by the list query.
207
         * @param orderBy
207
         * @param orderBy
208
         *            The orderBy SQL clause.
208
         *            The orderBy SQL clause.
209
         * @param limit
209
         * @param limit
210
         *            The max number of beans returned in the list.
210
         *            The max number of beans returned in the list.
211
         * @return A list of beans the match the properties in the given bean. Or an empty list if nothing was found.
211
         * @return A list of beans the match the properties in the given bean. Or an empty list if nothing was found.
212
         */
212
         */
213
        public <E> List<E> loadList(E bean, OrderBy orderBy, Limit limit);
213
        public <E> List<E> loadList(E bean, OrderBy orderBy, Limit limit);
214
214
215
        public <E> List<E> loadList(E bean, OrderBy orderBy, Limit limit, Object... properties);
215
        public <E> List<E> loadList(E bean, OrderBy orderBy, Limit limit, Object... properties);
216
216
217
        public <E> List<E> loadListMinus(E bean, OrderBy orderBy, Limit limit, Object... minus);
217
        public <E> List<E> loadListMinus(E bean, OrderBy orderBy, Limit limit, Object... minus);
218
218
219
        /**
219
        /**
220
         * Same as loadList(bean) but it attempts to load a single bean only. If more than one bean is found it throws an exception.
220
         * Same as loadList(bean) but it attempts to load a single bean only. If more than one bean is found it throws an exception.
221
         *
221
         *
222
         * NOTE: The returned bean will be attached by the session so only the modified properties will be updated in case update() is called.
222
         * NOTE: The returned bean will be attached by the session so only the modified properties will be updated in case update() is called.
223
         *
223
         *
224
         * @param <E>
224
         * @param <E>
225
         * @param bean
225
         * @param bean
226
         *            The bean holding the properties used by the load query.
226
         *            The bean holding the properties used by the load query.
227
         * @return A unique bean that match the properties in the given bean. Or null if nothing was found.
227
         * @return A unique bean that match the properties in the given bean. Or null if nothing was found.
228
         * @throws BeanException
228
         * @throws BeanException
229
         *             if more than one bean is found by the query.
229
         *             if more than one bean is found by the query.
230
         */
230
         */
231
        public <E> E loadUnique(E bean);
231
        public <E> E loadUnique(E bean);
232
       
232
       
233
        public <E> E loadUnique(E bean, Object... properties);
233
        public <E> E loadUnique(E bean, Object... properties);
234
       
234
       
235
        public <E> E loadUniqueMinus(E bean, Object... minus);
235
        public <E> E loadUniqueMinus(E bean, Object... minus);
236
236
237
        public String buildSelect(final Class<? extends Object> beanClass);
237
        public String buildSelect(final Class<? extends Object> beanClass);
238
238
239
        public String buildSelect(final Class<? extends Object> beanClass, Object... properties);
239
        public String buildSelect(final Class<? extends Object> beanClass, Object... properties);
240
240
241
        public String buildSelectMinus(final Class<? extends Object> beanClass, Object... minus);
241
        public String buildSelectMinus(final Class<? extends Object> beanClass, Object... minus);
242
242
243
        public String buildSelect(final Class<? extends Object> beanClass, String tableName);
243
        public String buildSelect(final Class<? extends Object> beanClass, String tableName);
244
244
245
        public String buildSelect(final Class<? extends Object> beanClass, String tableName, Object... properties);
245
        public String buildSelect(final Class<? extends Object> beanClass, String tableName, Object... properties);
246
246
247
        public String buildSelectMinus(final Class<? extends Object> beanClass, String tableName, Object... minus);
247
        public String buildSelectMinus(final Class<? extends Object> beanClass, String tableName, Object... minus);
248
248
249
        public void populateBean(final ResultSet rset, final Object bean);
249
        public void populateBean(final ResultSet rset, final Object bean);
250
250
251
        public void populateBean(final ResultSet rset, final Object bean, Object... properties);
251
        public void populateBean(final ResultSet rset, final Object bean, Object... properties);
252
252
253
        public void populateBeanMinus(final ResultSet rset, final Object bean, Object... minus);
253
        public void populateBeanMinus(final ResultSet rset, final Object bean, Object... minus);
254
254
255
        public void populateBean(final ResultSet rset, final Object bean, String tableName);
255
        public void populateBean(final ResultSet rset, final Object bean, String tableName);
256
256
257
        public void populateBean(final ResultSet rset, final Object bean, String tableName, Object... properties);
257
        public void populateBean(final ResultSet rset, final Object bean, String tableName, Object... properties);
258
258
259
        public void populateBeanMinus(final ResultSet rset, final Object bean, String tableName, Object... minus);
259
        public void populateBeanMinus(final ResultSet rset, final Object bean, String tableName, Object... minus);
260
260
261
        // some experiment with metadata...
261
        // some experiment with metadata...
262
262
263
        public void createTable(Class<? extends Object> beanKlass);
263
        public void createTable(Class<? extends Object> beanKlass);
264
       
264
       
265
        public void dropTable(Class<? extends Object> beanKlass);
265
        public void dropTable(Class<? extends Object> beanKlass);
266
266
267
        public void createTables();
267
        public void createTables();
268
       
268
       
269
        // some useful methods to handle with manual queries
269
        // some useful methods to handle with manual queries
270
       
270
       
271
        public String propertyToColumn(Class<? extends Object> clazz, Object property, String alias);
271
        public String propertyToColumn(Class<? extends Object> clazz, Object property, String alias);
272
       
272
       
273
        public String propertyToColumn(Class<? extends Object> clazz, Object property);
273
        public String propertyToColumn(Class<? extends Object> clazz, Object property);
274
       
274
       
275
        /**
275
        /**
276
         * Creates an single instance only with primary keys according the given object
276
         * Creates an single instance only with primary keys according the given object
277
         * @param bean - The bean with all primary key set
277
         * @param bean - The bean with all primary key set
278
         * @return A new instance of the bean
278
         * @return A new instance of the bean
279
         */
279
         */
280
        public <E> E createBasicInstance(E bean);
280
        public <E> E createBasicInstance(E bean);
281
       
281
       
282
        /**
282
        /**
283
         * Compare differences between two beans holding the properties of first bean passed and
283
         * Compare differences between two beans holding the properties of first bean passed and
284
         * adding null properties in nullProps list. This method returns null when beans has no differences
284
         * adding null properties in nullProps list. This method returns null when beans has no differences
285
         * @param
285
         * @param
286
         *              bean
286
         *              bean
287
         * @param
287
         * @param
288
         *              another
288
         *              another
289
         * @param
289
         * @param
290
         *              nullProps An empty list
290
         *              nullProps An empty list
291
         * @return A new instance of the bean
291
         * @return A new instance of the bean
292
         */
292
         */
293
        public <E> E compareDifferences(E bean, E another, List<String> nullProps);
293
        public <E> E compareDifferences(E bean, E another, List<String> nullProps);
294
       
294
       
295
        /**
295
        /**
296
         * Returns the table name configured for the given class
296
         * Returns the table name configured for the given class
297
         * @param clazz - The bean class
297
         * @param clazz - The bean class
298
         * @return Table name
298
         * @return Table name
299
         */
299
         */
300
        public String buildTableName(Class<? extends Object> clazz);
300
        public String buildTableName(Class<? extends Object> clazz);
301
       
301
       
302
        /**
302
        /**
303
         * Returns the BeanConfig object from the given bean class
303
         * Returns the BeanConfig object from the given bean class
304
         * @param clazz
304
         * @param clazz
305
         * @return BeanConfig
305
         * @return BeanConfig
306
         */
306
         */
307
        public BeanConfig getConfigFor(Class<?> clazz);
307
        public BeanConfig getConfigFor(Class<?> clazz);
308
       
308
       
309
        /**
309
        /**
310
         * Builds a new QueryBuilder so it's possible to create fluent custom SQL queries
310
         * Builds a new QueryBuilder so it's possible to create fluent custom SQL queries
311
         * @return QueryBuilder object
311
         * @return QueryBuilder object
312
         */
312
         */
313
        public QueryBuilder buildQuery();
313
        public QueryBuilder buildQuery();
314
       
314
       
315
        //trigger..
315
        //trigger..
316
        /**
316
        /**
317
         * Add a TriggerListener in this session. Remember that it's not added in BeanConfig, only in current session
317
         * Add a TriggerListener in this session. Remember that it's not added in BeanConfig, only in current session
318
         * @param trigger
318
         * @param trigger
319
         */
319
         */
320
        public void addTrigger(TriggerListener trigger);
320
        public void addTrigger(TriggerListener trigger);
321
       
321
       
322
        /**
322
        /**
323
         * Removes the TriggerListener from session
323
         * Removes the TriggerListener from session
324
         * @param trigger
324
         * @param trigger
325
         */
325
         */
326
        public void removeTrigger(TriggerListener trigger);
326
        public void removeTrigger(TriggerListener trigger);
327
       
327
       
328
        /**
328
        /**
329
         * Return a table alias for this bean class
329
         * Return a table alias for this bean class
330
         *
330
         *
331
         * @param beanClass
331
         * @param beanClass
332
         * @return TableAlias
332
         * @return TableAlias
333
         */
333
         */
334
        public <E> TableAlias<E> createTableAlias(Class<? extends E> beanClass);
334
        public <E> TableAlias<E> createTableAlias(Class<? extends E> beanClass);
335
       
335
       
336
        /**
336
        /**
337
         * Return a table alias for this bean class with a prefix.
337
         * Return a table alias for this bean class with a prefix.
338
         *
338
         *
339
         * @param beanClass
339
         * @param beanClass
340
         * @param prefix
340
         * @param prefix
341
         * @return TableAlias
341
         * @return TableAlias
342
         */
342
         */
343
        public <E> TableAlias<E> createTableAlias(Class<? extends E> beanClass, String prefix);
343
        public <E> TableAlias<E> createTableAlias(Class<? extends E> beanClass, String prefix);
344
       
-
 
345
        /**
-
 
346
         * Return a bean proxy that can be used with a SQLBuilder.
-
 
347
         *
-
 
348
         * @param beanClass
-
 
349
         * @return the bean proxy
-
 
350
         */
-
 
351
        public <E> E createProxy(Class<? extends E> beanClass);
-
 
352
       
-
 
353
        /**
-
 
354
         * Return a bean proxy that can be used with a SQLBuilder
-
 
355
         *
-
 
356
         * @param beanClass
-
 
357
         * @param prefix
-
 
358
         * @return the bean proxy
-
 
359
         */
-
 
360
        public <E> E createProxy(Class<? extends E> beanClass, String prefix);
-
 
361
       
344
       
362
}
345
}