001// license-header java merge-point
002//
003// Attention: Generated code! Do not modify by hand!
004// Generated by: hibernate/HibernateSearchConfiguration.vsl in andromda-spring-cartridge.
005//
006package fr.ifremer.adagio.core.dao;
007
008/*
009 * #%L
010 * SIH-Adagio :: Core
011 * $Id:$
012 * $HeadURL:$
013 * %%
014 * Copyright (C) 2012 - 2014 Ifremer
015 * %%
016 * This program is free software: you can redistribute it and/or modify
017 * it under the terms of the GNU Affero General Public License as published by
018 * the Free Software Foundation, either version 3 of the License, or
019 * (at your option) any later version.
020 * 
021 * This program is distributed in the hope that it will be useful,
022 * but WITHOUT ANY WARRANTY; without even the implied warranty of
023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
024 * GNU General Public License for more details.
025 * 
026 * You should have received a copy of the GNU Affero General Public License
027 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
028 * #L%
029 */
030
031/**
032 * Contains configuration parameters for a <code>CriteriaSearch</code>.
033 *
034 * @author Stefan Reichert
035 * @author Peter Friese
036 */
037public class CriteriaSearchConfiguration
038{
039    /**
040     * Constructs a new CriteriaSearchConfiguration instance with all fields set to
041     * either <code>null</code> or <code>false</code>.
042     */
043    public CriteriaSearchConfiguration()
044    {
045        this.forceEagerLoading = false;
046        this.firstResult = null;
047        this.fetchSize = null;
048        this.maximumResultSize = null;
049    }
050
051    /**
052     * If a parameter refers to a childEntity and <code>forceEagerLoading</code> is
053     * <code>true</code>, the childEntity is always loaded. If <code>forceEagerLoading</code> is
054     * <code>false</code>, the loading depends on the persister-configuration of the parentEntity.
055     */
056    private boolean forceEagerLoading;
057
058    /**
059     * Returns whether or not eager loading is enabled.
060     *
061     * @return <code>true</code> if eager loading is enabled, <code>false</code> otherwise
062     */
063    public boolean isForceEagerLoading()
064    {
065        return this.forceEagerLoading;
066    }
067
068    /**
069     * Sets whether or not eager loading is to be enabled.
070     *
071     * @param forceEagerLoadingIn <code>true</code> if eager loading is to be enabled, <code>false</code> otherwise
072     */
073    public void setForceEagerLoading(boolean forceEagerLoadingIn)
074    {
075        this.forceEagerLoading = forceEagerLoadingIn;
076    }
077
078    /**
079     * The first result to retrieve.
080     */
081    private Integer firstResult;
082
083    /**
084     * Gets the first result to retrieve.
085     *
086     * @return the first result to retrieve
087     */
088    public Integer getFirstResult()
089    {
090        return this.firstResult;
091    }
092
093    /**
094     * Sets the first result to retrieve.
095     *
096     * @param firstResultIn the first result to retrieve
097     */
098    public void setFirstResult(Integer firstResultIn)
099    {
100        this.firstResult = firstResultIn;
101    }
102
103    /**
104     * The fetch size.
105     */
106    private Integer fetchSize;
107
108    /**
109     * Gets the fetch size.
110     *
111     * @return the fetch size
112     */
113    public Integer getFetchSize()
114    {
115        return this.fetchSize;
116    }
117
118    /**
119     * Sets the fetch size.
120     *
121     * @param fetchSizeIn the fetch size
122     */
123    public void setFetchSize(Integer fetchSizeIn)
124    {
125        this.fetchSize = fetchSizeIn;
126    }
127
128    /**
129     * If <code>maximumResultSize</code> is not <code>null</code> it limits the maximum size of
130     * the resultList.
131     */
132    private Integer maximumResultSize;
133
134    /**
135     * Gets the maximum size of the search result.
136     *
137     * @return the maximum size of the search result.
138     */
139    public Integer getMaximumResultSize()
140    {
141        return this.maximumResultSize;
142    }
143
144    /**
145     * Sets the maximum size of the result.
146     *
147     * @param maximumResultSizeIn A number indicating how many results will be returned.
148     */
149    public void setMaximumResultSize(Integer maximumResultSizeIn)
150    {
151        this.maximumResultSize = maximumResultSizeIn;
152    }
153}