KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > persistence > core > RoleDAO


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.persistence.core;
17
18 import com.blandware.atleap.common.util.PartialCollection;
19 import com.blandware.atleap.common.util.QueryInfo;
20 import com.blandware.atleap.model.core.Role;
21
22 /**
23  * <p>Role Data Access Object (DAO) interface.
24  * </p>
25  * <p><a HREF="RoleDAO.java.htm"><i>View Source</i></a>
26  * </p>
27  *
28  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
29  */

30 public interface RoleDAO extends DAO {
31
32     /**
33      * Sets DAO to work with users
34      *
35      * @param userDAO user DAO to set
36      */

37     public void setUserDAO(UserDAO userDAO);
38
39     // ~ CRUD Methods ================================================================
40

41     /**
42      * Creates new role
43      *
44      * @param role Value object that represents what role must be created
45      */

46     public void createRole(Role role);
47
48     /**
49      * Retrieves role with specified name
50      *
51      * @param roleName Name to search by
52      * @return Role or null if no role with specified name exists in database
53      */

54     public Role retrieveRole(String JavaDoc roleName);
55
56     /**
57      * Updates role
58      *
59      * @param role Role to update
60      */

61     public void updateRole(Role role);
62
63     /**
64      * Deletes role
65      *
66      * @param role Role to delete
67      */

68     public void deleteRole(Role role);
69
70     // ~ Additional methods ================================================================
71

72     /**
73      * Retrieves filtered/sorted collection of roles.
74      *
75      * @param queryInfo Object that contains information about how to filter and sort data
76      * @return Collection of roles
77      */

78     public PartialCollection listRoles(QueryInfo queryInfo);
79
80     /**
81      * Searches for duplicates. Returns <code>true</code> if there is one or more roles with another ID, but which
82      * have same values from some set (e.g. title)
83      *
84      * @param role Role to find duplicates for
85      * @return whether given role has duplicates
86      */

87     public boolean hasDuplicates(Role role);
88
89     // ~ Finders ================================================================
90

91     /**
92      * Finds role by given title
93      *
94      * @param title to search role by
95      * @return Role or null if nothing was found
96      */

97     public Role findRoleByTitle(String JavaDoc title);
98 }
99
Popular Tags