1
22
23 package com.liferay.portal.dao.orm.hibernate;
24
25 import com.liferay.portal.kernel.dao.orm.ORMException;
26 import com.liferay.portal.kernel.dao.orm.Query;
27 import com.liferay.portal.kernel.dao.orm.ScrollableResults;
28
29 import java.io.Serializable;
30
31 import java.sql.Timestamp;
32
33 import java.util.Iterator;
34 import java.util.List;
35
36
42 public class QueryImpl implements Query {
43
44 public QueryImpl(org.hibernate.Query query) {
45 _query = query;
46 }
47
48 public Iterator iterate() throws ORMException {
49 try {
50 return _query.iterate();
51 }
52 catch (Exception e) {
53 throw ExceptionTranslator.translate(e);
54 }
55 }
56
57 public List list() throws ORMException {
58 try {
59 return _query.list();
60 }
61 catch (Exception e) {
62 throw ExceptionTranslator.translate(e);
63 }
64 }
65
66 public ScrollableResults scroll() throws ORMException {
67 try {
68 return new ScrollableResultsImpl(_query.scroll());
69 }
70 catch (Exception e) {
71 throw ExceptionTranslator.translate(e);
72 }
73 }
74
75 public Query setBoolean(int pos, boolean value) {
76 _query.setBoolean(pos, value);
77
78 return this;
79 }
80
81 public Query setDouble(int pos, double value) {
82 _query.setDouble(pos, value);
83
84 return this;
85 }
86
87 public Query setFirstResult(int firstResult) {
88 _query.setFirstResult(firstResult);
89
90 return this;
91 }
92
93 public Query setFloat(int pos, float value) {
94 _query.setFloat(pos, value);
95
96 return this;
97 }
98
99 public Query setInteger(int pos, int value) {
100 _query.setInteger(pos, value);
101
102 return this;
103 }
104
105 public Query setLong(int pos, long value) {
106 _query.setLong(pos, value);
107
108 return this;
109 }
110
111 public Query setMaxResults(int maxResults) {
112 _query.setMaxResults(maxResults);
113
114 return this;
115 }
116
117 public Query setSerializable(int pos, Serializable value) {
118 _query.setSerializable(pos, value);
119
120 return this;
121 }
122
123 public Query setShort(int pos, short value) {
124 _query.setShort(pos, value);
125
126 return this;
127 }
128
129 public Query setString(int pos, String value) {
130 _query.setString(pos, value);
131
132 return this;
133 }
134
135 public Query setTimestamp(int pos, Timestamp value) {
136 _query.setTimestamp(pos, value);
137
138 return this;
139 }
140
141 public Object uniqueResult() throws ORMException {
142 try {
143 return _query.uniqueResult();
144 }
145 catch (Exception e) {
146 throw ExceptionTranslator.translate(e);
147 }
148 }
149
150 private org.hibernate.Query _query;
151
152 }