001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.dao.orm;
016    
017    import java.io.Serializable;
018    
019    import java.sql.Timestamp;
020    
021    import java.util.Iterator;
022    import java.util.List;
023    
024    /**
025     * @author Brian Wing Shun Chan
026     * @author Shuyang Zhou
027     */
028    public interface Query {
029    
030            public int executeUpdate() throws ORMException;
031    
032            @SuppressWarnings("rawtypes")
033            public Iterator iterate() throws ORMException;
034    
035            @SuppressWarnings("rawtypes")
036            public Iterator iterate(boolean modifiable) throws ORMException;
037    
038            @SuppressWarnings("rawtypes")
039            public List list() throws ORMException;
040    
041            @SuppressWarnings("rawtypes")
042            public List list(boolean unmodifiable) throws ORMException;
043    
044            public ScrollableResults scroll() throws ORMException;
045    
046            public Query setBoolean(int pos, boolean value);
047    
048            public Query setBoolean(String name, boolean value);
049    
050            public Query setCacheable(boolean cacheable);
051    
052            public Query setCacheMode(CacheMode cacheMode);
053    
054            public Query setCacheRegion(String cacheRegion);
055    
056            public Query setDouble(int pos, double value);
057    
058            public Query setDouble(String name, double value);
059    
060            public Query setFirstResult(int firstResult);
061    
062            public Query setFloat(int pos, float value);
063    
064            public Query setFloat(String name, float value);
065    
066            public Query setInteger(int pos, int value);
067    
068            public Query setInteger(String name, int value);
069    
070            public Query setLong(int pos, long value);
071    
072            public Query setLong(String name, long value);
073    
074            public Query setMaxResults(int maxResults);
075    
076            public Query setSerializable(int pos, Serializable value);
077    
078            public Query setSerializable(String name, Serializable value);
079    
080            public Query setShort(int pos, short value);
081    
082            public Query setShort(String name, short value);
083    
084            public Query setString(int pos, String value);
085    
086            public Query setString(String name, String value);
087    
088            public Query setTimestamp(int pos, Timestamp value);
089    
090            public Query setTimestamp(String name, Timestamp value);
091    
092            public Object uniqueResult() throws ORMException;
093    
094    }