Subversion Repositories WebE

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
33 PointedEar 1
/*
2
 * Hibernate, Relational Persistence for Idiomatic Java
3
 *
4
 * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
5
 * indicated by the @author tags or express copyright attribution
6
 * statements applied by the authors.  All third-party contributions are
7
 * distributed under license by Red Hat Middleware LLC.
8
 *
9
 * This copyrighted material is made available to anyone wishing to use, modify,
10
 * copy, or redistribute it subject to the terms and conditions of the GNU
11
 * Lesser General Public License, as published by the Free Software Foundation.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
16
 * for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public License
19
 * along with this distribution; if not, write to:
20
 * Free Software Foundation, Inc.
21
 * 51 Franklin Street, Fifth Floor
22
 * Boston, MA  02110-1301  USA
23
 *
24
 */
25
package org.hibernate;
26
 
27
import org.hibernate.engine.FilterDefinition;
28
 
29
import java.util.Collection;
30
 
31
/**
32
 * Type definition of Filter.  Filter defines the user's view into enabled dynamic filters,
33
 * allowing them to set filter parameter values.
34
 *
35
 * @author Steve Ebersole
36
 */
37
public interface Filter {
38
 
39
        /**
40
         * Get the name of this filter.
41
         *
42
         * @return This filter's name.
43
         */
44
        public String getName();
45
 
46
        /**
47
         * Get the filter definition containing additional information about the
48
         * filter (such as default-condition and expected parameter names/types).
49
         *
50
         * @return The filter definition
51
         */
52
        public FilterDefinition getFilterDefinition();
53
 
54
 
55
        /**
56
         * Set the named parameter's value for this filter.
57
         *
58
         * @param name The parameter's name.
59
         * @param value The value to be applied.
60
         * @return This FilterImpl instance (for method chaining).
61
         */
62
        public Filter setParameter(String name, Object value);
63
 
64
        /**
65
         * Set the named parameter's value list for this filter.  Used
66
         * in conjunction with IN-style filter criteria.
67
         *
68
         * @param name The parameter's name.
69
         * @param values The values to be expanded into an SQL IN list.
70
         * @return This FilterImpl instance (for method chaining).
71
         */
72
        public Filter setParameterList(String name, Collection values);
73
 
74
        /**
75
         * Set the named parameter's value list for this filter.  Used
76
         * in conjunction with IN-style filter criteria.
77
         *
78
         * @param name The parameter's name.
79
         * @param values The values to be expanded into an SQL IN list.
80
         * @return This FilterImpl instance (for method chaining).
81
         */
82
        public Filter setParameterList(String name, Object[] values);
83
 
84
        /**
85
         * Perform validation of the filter state.  This is used to verify the
86
         * state of the filter after its enablement and before its use.
87
         *
88
         * @throws HibernateException If the state is not currently valid.
89
         */
90
        public void validate() throws HibernateException;
91
}