2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.persistence
.dao
.common
;
12 import java
.util
.List
;
14 import org
.hibernate
.criterion
.Criterion
;
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
;
21 public interface IUserDao
extends ICdmEntityDao
<User
> {
24 * Among other purposes this method will be used while
25 * authenticating a user.
30 public User
findUserByUsername(String username
);
33 * Return a List of users matching the given query string, optionally filtered by class, optionally with a particular MatchMode
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)}
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)}
48 public List
<User
> findByUsername(String queryString
, MatchMode matchmode
, List
<Criterion
> criteria
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
51 * Return a count of users matching the given query string in the username, optionally filtered by class, optionally with a particular MatchMode
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
59 * @see {@link IIdentifiableDao#countByTitle(Class, String, MatchMode, List)}
61 public int countByUsername(String queryString
, MatchMode matchmode
, List
<Criterion
> criteria
);