001    /**
002     * Copyright (c) 2000-2013 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 void delete(Object object) throws ORMException;
044    
045            public void evict(Object object) throws ORMException;
046    
047            public void flush() throws ORMException;
048    
049            public Object get(Class<?> clazz, Serializable id) throws ORMException;
050    
051            public Object get(Class<?> clazz, Serializable id, LockMode lockMode)
052                    throws ORMException;
053    
054            public Object getWrappedSession() throws ORMException;
055    
056            public Object load(Class<?> clazz, Serializable id) throws ORMException;
057    
058            public Object merge(Object object) throws ORMException;
059    
060            public Serializable save(Object object) throws ORMException;
061    
062            public void saveOrUpdate(Object object) throws ORMException;
063    
064    }