1
|
/**
|
2
|
* Copyright (C) 2007 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.api.service.config;
|
11
|
|
12
|
import java.util.List;
|
13
|
|
14
|
import org.hibernate.criterion.Criterion;
|
15
|
|
16
|
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
|
17
|
import eu.etaxonomy.cdm.persistence.query.MatchMode;
|
18
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
19
|
|
20
|
/**
|
21
|
* @author a.babadshanjan
|
22
|
* @author n.hoffmann
|
23
|
* @since 03.03.2009
|
24
|
* @version 1.1
|
25
|
*/
|
26
|
public class IdentifiableServiceConfiguratorImpl<T extends IIdentifiableEntity> implements IIdentifiableEntityServiceConfigurator<T>{
|
27
|
|
28
|
private String titleSearchString;
|
29
|
protected MatchMode matchMode;
|
30
|
private Integer pageSize;
|
31
|
private Integer pageNumber;
|
32
|
private Class<? extends T> clazz;
|
33
|
private List<Criterion> criteria;
|
34
|
private List<String> propertyPaths;
|
35
|
private List<OrderHint> orderHints;
|
36
|
|
37
|
@Override
|
38
|
public Class<? extends T> getClazz() {
|
39
|
return clazz;
|
40
|
}
|
41
|
|
42
|
@Override
|
43
|
public void setClazz(Class<? extends T> clazz) {
|
44
|
this.clazz = clazz;
|
45
|
}
|
46
|
|
47
|
public String getTitleSearchString() {
|
48
|
return titleSearchString;
|
49
|
}
|
50
|
|
51
|
public String getTitleSearchStringSqlized(){
|
52
|
return getTitleSearchString().replace("*", "%");
|
53
|
}
|
54
|
|
55
|
public void setTitleSearchString(String titleSearchString) {
|
56
|
this.titleSearchString = titleSearchString;
|
57
|
}
|
58
|
|
59
|
/**
|
60
|
* @return the pageSize
|
61
|
*/
|
62
|
public Integer getPageSize() {
|
63
|
return pageSize;
|
64
|
}
|
65
|
|
66
|
/**
|
67
|
* Sets the number of results that should be shown on current page
|
68
|
*
|
69
|
* @param pageSize the pageSize to set
|
70
|
*/
|
71
|
public void setPageSize(Integer pageSize) {
|
72
|
this.pageSize = pageSize;
|
73
|
}
|
74
|
|
75
|
/**
|
76
|
* @return the pageNumber
|
77
|
*/
|
78
|
public Integer getPageNumber() {
|
79
|
return pageNumber;
|
80
|
}
|
81
|
|
82
|
/**
|
83
|
* Sets the number of the page the first result should come from, starting
|
84
|
* with 0 as the first page.
|
85
|
*
|
86
|
* @param pageNumber the pageNumber to set
|
87
|
*/
|
88
|
public void setPageNumber(Integer pageNumber) {
|
89
|
this.pageNumber = pageNumber;
|
90
|
}
|
91
|
|
92
|
public MatchMode getMatchMode() {
|
93
|
return matchMode;
|
94
|
}
|
95
|
|
96
|
public void setMatchMode(MatchMode matchMode) {
|
97
|
this.matchMode = matchMode;
|
98
|
}
|
99
|
|
100
|
@Override
|
101
|
public List<Criterion> getCriteria() {
|
102
|
return criteria;
|
103
|
}
|
104
|
|
105
|
@Override
|
106
|
public void setCriteria(List<Criterion> criteria) {
|
107
|
this.criteria = criteria;
|
108
|
}
|
109
|
|
110
|
@Override
|
111
|
public List<OrderHint> getOrderHints() {
|
112
|
return orderHints;
|
113
|
}
|
114
|
|
115
|
@Override
|
116
|
public void setOrderHints(List<OrderHint> orderHints) {
|
117
|
this.orderHints = orderHints;
|
118
|
}
|
119
|
|
120
|
@Override
|
121
|
public List<String> getPropertyPaths() {
|
122
|
return propertyPaths;
|
123
|
}
|
124
|
|
125
|
@Override
|
126
|
public void setPropertyPaths(List<String> propertyPaths) {
|
127
|
this.propertyPaths = propertyPaths;
|
128
|
}
|
129
|
}
|