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