001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }