1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.dao.orm.hibernate;
24  
25  import java.io.Serializable;
26  
27  import java.lang.Class;
28  import java.lang.Object;
29  import java.lang.String;
30  
31  import java.util.Collection;
32  import java.util.Iterator;
33  import java.util.List;
34  
35  import org.hibernate.HibernateException;
36  import org.hibernate.Query;
37  import org.hibernate.classic.Session;
38  import org.hibernate.type.Type;
39  
40  /**
41   * <a href="LiferayClassicSession.java.html"><b><i>View Source</i></b></a>
42   *
43   * <p>
44   * See http://support.liferay.com/browse/LEP-2996.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   */
50  public class LiferayClassicSession extends LiferaySession implements Session {
51  
52      public LiferayClassicSession(Session session) {
53          super(session);
54  
55          _session = session;
56      }
57  
58      public Session getHibernateClassicSession() {
59          return _session;
60      }
61  
62      /**
63       * @deprecated
64       */
65      public Query createSQLQuery(
66          String sql, String returnAlias, Class returnClass) {
67  
68          return _session.createSQLQuery(sql, returnAlias, returnClass);
69      }
70  
71      /**
72       * @deprecated
73       */
74      public Query createSQLQuery(
75          String sql, String[] returnAliases, Class[] returnClasses) {
76  
77          return _session.createSQLQuery(sql, returnAliases, returnClasses);
78      }
79  
80      /**
81       * @deprecated
82       */
83      public int delete(String query) throws HibernateException {
84          return _session.delete(query);
85      }
86  
87      /**
88       * @deprecated
89       */
90      public int delete(String query, Object value, Type type)
91          throws HibernateException {
92  
93          return _session.delete(query, value, type);
94      }
95  
96      /**
97       * @deprecated
98       */
99      public int delete(String query, Object[] values, Type[] types)
100         throws HibernateException {
101 
102         return _session.delete(query, values, types);
103     }
104 
105     /**
106      * @deprecated
107      */
108     public Collection filter(Object collection, String filter)
109         throws HibernateException {
110 
111         return _session.filter(collection, filter);
112     }
113 
114     /**
115      * @deprecated
116      */
117     public Collection filter(
118             Object collection, String filter, Object value, Type type)
119         throws HibernateException {
120 
121         return _session.filter(collection, filter, value, type);
122     }
123 
124     /**
125      * @deprecated
126      */
127     public Collection filter(
128             Object collection, String filter, Object[] values, Type[] types)
129         throws HibernateException {
130 
131         return _session.filter(collection, filter, values, types);
132     }
133 
134     /**
135      * @deprecated
136      */
137     public List find(String query) throws HibernateException {
138         return _session.find(query);
139     }
140 
141     /**
142      * @deprecated
143      */
144     public List find(String query, Object value, Type type)
145         throws HibernateException {
146 
147         return _session.find(query, value, type);
148     }
149 
150     /**
151      * @deprecated
152      */
153     public List find(String query, Object[] values, Type[] types)
154         throws HibernateException {
155 
156         return _session.find(query, values, types);
157     }
158 
159     /**
160      * @deprecated
161      */
162     public Iterator iterate(String query) throws HibernateException {
163         return _session.iterate(query);
164     }
165 
166     /**
167      * @deprecated
168      */
169     public Iterator iterate(String query, Object value, Type type)
170         throws HibernateException {
171 
172         return _session.iterate(query, value, type);
173     }
174 
175     /**
176      * @deprecated
177      */
178     public Iterator iterate(String query, Object[] values, Type[] types)
179         throws HibernateException {
180 
181         return _session.iterate(query, values, types);
182     }
183 
184     /**
185      * @deprecated
186      */
187     public void save(Object object, Serializable id) throws HibernateException {
188         _session.save(object, id);
189     }
190 
191     /**
192      * @deprecated
193      */
194     public void save(String entityName, Object object, Serializable id)
195         throws HibernateException {
196 
197         _session.save(entityName, object, id);
198     }
199 
200     /**
201      * @deprecated
202      */
203     public Object saveOrUpdateCopy(Object object) throws HibernateException {
204         return _session.saveOrUpdateCopy(object);
205     }
206 
207     /**
208      * @deprecated
209      */
210     public Object saveOrUpdateCopy(Object object, Serializable id)
211         throws HibernateException {
212 
213         return _session.saveOrUpdateCopy(object, id);
214     }
215 
216     /**
217      * @deprecated
218      */
219     public Object saveOrUpdateCopy(String entityName, Object object)
220         throws HibernateException {
221 
222         return _session.saveOrUpdateCopy(entityName, object);
223     }
224 
225     /**
226      * @deprecated
227      */
228     public Object saveOrUpdateCopy(
229             String entityName, Object object, Serializable id)
230         throws HibernateException {
231 
232         return _session.saveOrUpdateCopy(entityName, object, id);
233     }
234 
235     /**
236      * @deprecated
237      */
238     public void update(Object object, Serializable id)
239         throws HibernateException {
240 
241         _session.update(object, id);
242     }
243 
244     /**
245      * @deprecated
246      */
247     public void update(String entityName, Object object, Serializable id)
248         throws HibernateException {
249 
250         _session.update(entityName, object, id);
251     }
252 
253     private Session _session;
254 
255 }