1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package interceptors;
25
26 import org.dbforms.config.DbFormsConfig;
27 import org.dbforms.config.FieldValues;
28 import org.dbforms.config.Table;
29 import org.dbforms.config.ValidationException;
30
31 import org.dbforms.event.DbEventInterceptorSupport;
32
33 import java.sql.Connection;
34 import javax.servlet.http.HttpServletRequest;
35
36
37
38
39
40 /***
41 * @author hkk
42 *
43 * To change this generated comment go to Window>Preferences>Java>Code
44 * Generation>Code and Comments
45 */
46 public class InterceptorTestClassic extends DbEventInterceptorSupport {
47 public static boolean preInsertCalled = false;
48 public static boolean preSelectCalled = false;
49 public static boolean preUpdateCalled = false;
50 public static boolean preDeleteCalled = false;
51 public static boolean postUpdateCalled = false;
52 public static boolean postSelectCalled = false;
53 public static boolean postInsertCalled = false;
54 public static boolean postDeleteCalled = false;
55
56
57
58
59 public void postDelete(HttpServletRequest request, DbFormsConfig config,
60 Connection con) {
61 postDeleteCalled = true;
62 }
63
64 public void postInsert(HttpServletRequest request, DbFormsConfig config,
65 Connection con) {
66 postInsertCalled = true;
67 }
68
69 public void postSelect(HttpServletRequest request, DbFormsConfig config,
70 Connection con) {
71 postSelectCalled = true;
72 }
73
74 public void postUpdate(HttpServletRequest request, DbFormsConfig config,
75 Connection con) {
76 postUpdateCalled = true;
77 }
78
79 public int preDelete(HttpServletRequest request, Table table,
80 FieldValues fieldValues, DbFormsConfig config, Connection con)
81 throws ValidationException {
82 preDeleteCalled = true;
83 return GRANT_OPERATION;
84 }
85
86 public int preInsert(HttpServletRequest request,
87 Table table,
88 FieldValues fieldValues,
89 DbFormsConfig config,
90 Connection con) throws ValidationException {
91 preInsertCalled = true;
92 return GRANT_OPERATION;
93 }
94
95 public int preSelect(HttpServletRequest request,
96 DbFormsConfig config,
97 Connection con) {
98 preSelectCalled = true;
99 return GRANT_OPERATION;
100 }
101
102
103 public int preUpdate(HttpServletRequest request,
104 Table table,
105 FieldValues fieldValues,
106 DbFormsConfig config,
107 Connection con) throws ValidationException {
108 preUpdateCalled = true;
109 return GRANT_OPERATION;
110 }
111 }