2 * Copyright (C) 2007 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.
9 package eu
.etaxonomy
.cdm
.api
.service
.config
;
11 import java
.util
.List
;
13 import org
.hibernate
.criterion
.Criterion
;
15 import eu
.etaxonomy
.cdm
.model
.common
.IIdentifiableEntity
;
16 import eu
.etaxonomy
.cdm
.persistence
.dao
.common
.Restriction
;
17 import eu
.etaxonomy
.cdm
.persistence
.query
.MatchMode
;
18 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
21 * @author a.babadshanjan
25 public class IdentifiableServiceConfiguratorImpl
<T
extends IIdentifiableEntity
>
26 implements IIdentifiableEntityServiceConfigurator
<T
>{
28 private static final long serialVersionUID
= -8136736101861741087L;
30 private String titleSearchString
;
31 protected MatchMode matchMode
;
32 private Integer pageSize
;
33 private Integer pageNumber
;
34 private Class
<?
extends T
> clazz
;
35 private List
<Criterion
> criteria
;
36 private List
<Restriction
<?
>> restrictions
;
37 private List
<String
> propertyPaths
;
38 private List
<OrderHint
> orderHints
;
39 private boolean includeUnpublished
= false;
42 public Class
<T
> getClazz() {
46 public void setClazz(Class
<?
extends T
> clazz
) {
51 public String
getTitleSearchString() {
52 return titleSearchString
;
56 public String
getTitleSearchStringSqlized(){
57 return getTitleSearchString() == null ?
null : getTitleSearchString().replace("*", "%");
60 public void setTitleSearchString(String titleSearchString
) {
61 this.titleSearchString
= titleSearchString
;
65 public Integer
getPageSize() {
69 * Sets the number of results that should be shown on current page
71 * @param pageSize the pageSize to set
74 public void setPageSize(Integer pageSize
) {
75 this.pageSize
= pageSize
;
79 * @return the pageNumber
82 public Integer
getPageNumber() {
86 * Sets the number of the page the first result should come from, starting
87 * with 0 as the first page.
89 * @param pageNumber the pageNumber to set
92 public void setPageNumber(Integer pageNumber
) {
93 this.pageNumber
= pageNumber
;
97 public MatchMode
getMatchMode() {
101 public void setMatchMode(MatchMode matchMode
) {
102 this.matchMode
= matchMode
;
106 public List
<Criterion
> getCriteria() {
110 public void setCriteria(List
<Criterion
> criteria
) {
111 this.criteria
= criteria
;
116 public List
<Restriction
<?
>> getRestrictions() {
120 public void setRestrictions(List
<Restriction
<?
>> restrictions
) {
121 this.restrictions
= restrictions
;
125 public List
<OrderHint
> getOrderHints() {
129 public void setOrderHints(List
<OrderHint
> orderHints
) {
130 this.orderHints
= orderHints
;
134 public List
<String
> getPropertyPaths() {
135 return propertyPaths
;
138 public void setPropertyPaths(List
<String
> propertyPaths
) {
139 this.propertyPaths
= propertyPaths
;
142 public boolean isIncludeUnpublished() {
143 return includeUnpublished
;
145 public void setIncludeUnpublished(boolean includeUnpublished
) {
146 this.includeUnpublished
= includeUnpublished
;