1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  public class LiferayClassicSession extends LiferaySession implements Session {
50  
51      public LiferayClassicSession(Session session) {
52          super(session);
53  
54          _session = session;
55      }
56  
57      public Session getHibernateClassicSession() {
58          return _session;
59      }
60  
61      /**
62       * @deprecated
63       */
64      public Query createSQLQuery(
65          String sql, String returnAlias, Class returnClass) {
66  
67          return _session.createSQLQuery(sql, returnAlias, returnClass);
68      }
69  
70      /**
71       * @deprecated
72       */
73      public Query createSQLQuery(
74          String sql, String[] returnAliases, Class[] returnClasses) {
75  
76          return _session.createSQLQuery(sql, returnAliases, returnClasses);
77      }
78  
79      /**
80       * @deprecated
81       */
82      public int delete(String query) throws HibernateException {
83          return _session.delete(query);
84      }
85  
86      /**
87       * @deprecated
88       */
89      public int delete(String query, Object value, Type type)
90          throws HibernateException {
91  
92          return _session.delete(query, value, type);
93      }
94  
95      /**
96       * @deprecated
97       */
98      public int delete(String query, Object[] values, Type[] types)
99          throws HibernateException {
100 
101         return _session.delete(query, values, types);
102     }
103 
104     /**
105      * @deprecated
106      */
107     public Collection filter(Object collection, String filter)
108         throws HibernateException {
109 
110         return _session.filter(collection, filter);
111     }
112 
113     /**
114      * @deprecated
115      */
116     public Collection filter(
117             Object collection, String filter, Object value, Type type)
118         throws HibernateException {
119 
120         return _session.filter(collection, filter, value, type);
121     }
122 
123     /**
124      * @deprecated
125      */
126     public Collection filter(
127             Object collection, String filter, Object[] values, Type[] types)
128         throws HibernateException {
129 
130         return _session.filter(collection, filter, values, types);
131     }
132 
133     /**
134      * @deprecated
135      */
136     public List find(String query) throws HibernateException {
137         return _session.find(query);
138     }
139 
140     /**
141      * @deprecated
142      */
143     public List find(String query, Object value, Type type)
144         throws HibernateException {
145 
146         return _session.find(query, value, type);
147     }
148 
149     /**
150      * @deprecated
151      */
152     public List find(String query, Object[] values, Type[] types)
153         throws HibernateException {
154 
155         return _session.find(query, values, types);
156     }
157 
158     /**
159      * @deprecated
160      */
161     public Iterator iterate(String query) throws HibernateException {
162         return _session.iterate(query);
163     }
164 
165     /**
166      * @deprecated
167      */
168     public Iterator iterate(String query, Object value, Type type)
169         throws HibernateException {
170 
171         return _session.iterate(query, value, type);
172     }
173 
174     /**
175      * @deprecated
176      */
177     public Iterator iterate(String query, Object[] values, Type[] types)
178         throws HibernateException {
179 
180         return _session.iterate(query, values, types);
181     }
182 
183     /**
184      * @deprecated
185      */
186     public void save(Object object, Serializable id) throws HibernateException {
187         _session.save(object, id);
188     }
189 
190     /**
191      * @deprecated
192      */
193     public void save(String entityName, Object object, Serializable id)
194         throws HibernateException {
195 
196         _session.save(entityName, object, id);
197     }
198 
199     /**
200      * @deprecated
201      */
202     public Object saveOrUpdateCopy(Object object) throws HibernateException {
203         return _session.saveOrUpdateCopy(object);
204     }
205 
206     /**
207      * @deprecated
208      */
209     public Object saveOrUpdateCopy(Object object, Serializable id)
210         throws HibernateException {
211 
212         return _session.saveOrUpdateCopy(object, id);
213     }
214 
215     /**
216      * @deprecated
217      */
218     public Object saveOrUpdateCopy(String entityName, Object object)
219         throws HibernateException {
220 
221         return _session.saveOrUpdateCopy(entityName, object);
222     }
223 
224     /**
225      * @deprecated
226      */
227     public Object saveOrUpdateCopy(
228             String entityName, Object object, Serializable id)
229         throws HibernateException {
230 
231         return _session.saveOrUpdateCopy(entityName, object, id);
232     }
233 
234     /**
235      * @deprecated
236      */
237     public void update(Object object, Serializable id)
238         throws HibernateException {
239 
240         _session.update(object, id);
241     }
242 
243     /**
244      * @deprecated
245      */
246     public void update(String entityName, Object object, Serializable id)
247         throws HibernateException {
248 
249         _session.update(entityName, object, id);
250     }
251 
252     private Session _session;
253 
254 }