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 int executeUpdate() throws ORMException {
49 try {
50 return _query.executeUpdate();
51 }
52 catch (Exception e) {
53 throw ExceptionTranslator.translate(e);
54 }
55 }
56
57 public Iterator iterate() throws ORMException {
58 try {
59 return _query.iterate();
60 }
61 catch (Exception e) {
62 throw ExceptionTranslator.translate(e);
63 }
64 }
65
66 public List list() throws ORMException {
67 try {
68 return _query.list();
69 }
70 catch (Exception e) {
71 throw ExceptionTranslator.translate(e);
72 }
73 }
74
75 public ScrollableResults scroll() throws ORMException {
76 try {
77 return new ScrollableResultsImpl(_query.scroll());
78 }
79 catch (Exception e) {
80 throw ExceptionTranslator.translate(e);
81 }
82 }
83
84 public Query setBoolean(int pos, boolean value) {
85 _query.setBoolean(pos, value);
86
87 return this;
88 }
89
90 public Query setDouble(int pos, double value) {
91 _query.setDouble(pos, value);
92
93 return this;
94 }
95
96 public Query setFirstResult(int firstResult) {
97 _query.setFirstResult(firstResult);
98
99 return this;
100 }
101
102 public Query setFloat(int pos, float value) {
103 _query.setFloat(pos, value);
104
105 return this;
106 }
107
108 public Query setInteger(int pos, int value) {
109 _query.setInteger(pos, value);
110
111 return this;
112 }
113
114 public Query setLong(int pos, long value) {
115 _query.setLong(pos, value);
116
117 return this;
118 }
119
120 public Query setMaxResults(int maxResults) {
121 _query.setMaxResults(maxResults);
122
123 return this;
124 }
125
126 public Query setSerializable(int pos, Serializable value) {
127 _query.setSerializable(pos, value);
128
129 return this;
130 }
131
132 public Query setShort(int pos, short value) {
133 _query.setShort(pos, value);
134
135 return this;
136 }
137
138 public Query setString(int pos, String value) {
139 _query.setString(pos, value);
140
141 return this;
142 }
143
144 public Query setTimestamp(int pos, Timestamp value) {
145 _query.setTimestamp(pos, value);
146
147 return this;
148 }
149
150 public Object uniqueResult() throws ORMException {
151 try {
152 return _query.uniqueResult();
153 }
154 catch (Exception e) {
155 throw ExceptionTranslator.translate(e);
156 }
157 }
158
159 private org.hibernate.Query _query;
160
161 }