001    /**
002     * Copyright (c) 2000-2010 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     */
027    public interface Query {
028    
029            public int executeUpdate() throws ORMException;
030    
031            @SuppressWarnings("rawtypes")
032            public Iterator iterate() throws ORMException;
033    
034            @SuppressWarnings("rawtypes")
035            public Iterator iterate(boolean modifiable) throws ORMException;
036    
037            @SuppressWarnings("rawtypes")
038            public List list() throws ORMException;
039    
040            @SuppressWarnings("rawtypes")
041            public List list(boolean unmodifiable) throws ORMException;
042    
043            public ScrollableResults scroll() throws ORMException;
044    
045            public Query setBoolean(int pos, boolean value);
046    
047            public Query setCacheable(boolean cacheable);
048    
049            public Query setCacheMode(CacheMode cacheMode);
050    
051            public Query setCacheRegion(String cacheRegion);
052    
053            public Query setDouble(int pos, double value);
054    
055            public Query setFirstResult(int firstResult);
056    
057            public Query setFloat(int pos, float value);
058    
059            public Query setInteger(int pos, int value);
060    
061            public Query setLong(int pos, long value);
062    
063            public Query setMaxResults(int maxResults);
064    
065            public Query setShort(int pos, short value);
066    
067            public Query setSerializable(int pos, Serializable value);
068    
069            public Query setString(int pos, String value);
070    
071            public Query setTimestamp(int pos, Timestamp value);
072    
073            public Object uniqueResult() throws ORMException;
074    
075    }