001    /**
002     * Copyright (c) 2000-present 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.Connection;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     * @author Shuyang Zhou
024     */
025    public interface Session {
026    
027            public void clear() throws ORMException;
028    
029            public Connection close() throws ORMException;
030    
031            public boolean contains(Object object) throws ORMException;
032    
033            public Query createQuery(String queryString) throws ORMException;
034    
035            public Query createQuery(String queryString, boolean strictName)
036                    throws ORMException;
037    
038            public SQLQuery createSQLQuery(String queryString) throws ORMException;
039    
040            public SQLQuery createSQLQuery(String queryString, boolean strictName)
041                    throws ORMException;
042    
043            public SQLQuery createSynchronizedSQLQuery(String queryString)
044                    throws ORMException;
045    
046            public SQLQuery createSynchronizedSQLQuery(
047                            String queryString, boolean strictName)
048                    throws ORMException;
049    
050            public void delete(Object object) throws ORMException;
051    
052            public void evict(Object object) throws ORMException;
053    
054            public void flush() throws ORMException;
055    
056            public Object get(Class<?> clazz, Serializable id) throws ORMException;
057    
058            public Object get(Class<?> clazz, Serializable id, LockMode lockMode)
059                    throws ORMException;
060    
061            public Object getWrappedSession() throws ORMException;
062    
063            public boolean isDirty() throws ORMException;
064    
065            public Object load(Class<?> clazz, Serializable id) throws ORMException;
066    
067            public Object merge(Object object) throws ORMException;
068    
069            public Serializable save(Object object) throws ORMException;
070    
071            public void saveOrUpdate(Object object) throws ORMException;
072    
073    }