updated to trunk
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / dao / common / IUserDao.java
1 /**
2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.persistence.dao.common;
11
12 import java.util.List;
13
14 import org.hibernate.criterion.Criterion;
15
16 import eu.etaxonomy.cdm.model.common.User;
17 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
18 import eu.etaxonomy.cdm.persistence.query.MatchMode;
19 import eu.etaxonomy.cdm.persistence.query.OrderHint;
20
21 public interface IUserDao extends ICdmEntityDao<User> {
22
23 /**
24 * Among other purposes this method will be used while
25 * authenticating a user.
26 *
27 * @param username
28 * @return
29 */
30 public User findUserByUsername(String username);
31
32 /**
33 * Return a List of users matching the given query string, optionally filtered by class, optionally with a particular MatchMode
34 *
35 * @param queryString the query string to filter by
36 * @param matchmode use a particular type of matching (can be null - defaults to exact matching)
37 * @param criteria extra restrictions to apply
38 * @param pageSize The maximum number of rights returned (can be null for all rights)
39 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
40 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
41 * @param orderHints
42 * Supports path like <code>orderHints.propertyNames</code> which
43 * include *-to-one properties like createdBy.username or
44 * authorTeam.persistentTitleCache
45 * @return a List of instances of User matching the queryString
46 * @see {@link IIdentifiableDao#findByTitle(Class, String, MatchMode, List, Integer, Integer, List, List)}
47 */
48 public List<User> findByUsername(String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
49
50 /**
51 * Return a count of users matching the given query string in the username, optionally filtered by class, optionally with a particular MatchMode
52 *
53 * @param clazz filter by class - can be null to include all instances of type T
54 * @param queryString the query string to filter by
55 * @param matchmode use a particular type of matching (can be null - defaults to exact matching)
56 * @param criteria extra restrictions to apply
57 * @return a count of instances of type User matching the queryString
58 *
59 * @see {@link IIdentifiableDao#countByTitle(Class, String, MatchMode, List)}
60 */
61 public int countByUsername(String queryString, MatchMode matchmode, List<Criterion> criteria);
62
63
64 }