Rev 821 | Rev 899 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
110 | susana | 1 | package pt.estgp.estgweb.domain.dao.impl; |
2 | |||
748 | jmachado | 3 | import org.apache.log4j.Logger; |
205 | jmachado | 4 | import org.hibernate.Criteria; |
358 | jmachado | 5 | import org.hibernate.Query; |
748 | jmachado | 6 | import org.hibernate.criterion.Criterion; |
7 | import org.hibernate.criterion.Order; |
||
376 | jmachado | 8 | import org.hibernate.sql.JoinFragment; |
748 | jmachado | 9 | import pt.estgp.estgweb.domain.CourseUnit; |
10 | import pt.estgp.estgweb.domain.CourseUnitImpl; |
||
751 | jmachado | 11 | import pt.estgp.estgweb.domain.Teacher; |
748 | jmachado | 12 | import pt.estgp.estgweb.domain.dao.DaoUtils; |
13 | import pt.estgp.estgweb.services.common.SearchTypeEnum; |
||
14 | import pt.estgp.estgweb.utils.DatesUtils; |
||
116 | jmachado | 15 | |
125 | fvelez | 16 | import java.util.List; |
17 | |||
748 | jmachado | 18 | import static org.hibernate.criterion.Restrictions.*; |
19 | |||
110 | susana | 20 | /** |
21 | * @author Jorge Machado |
||
22 | * @date 28/Fev/2008 |
||
23 | * @time 2:51:06 |
||
24 | * @see pt.estgp.estgweb.domain.dao.impl |
||
25 | */ |
||
26 | public class CourseUnitDaoImpl extends CourseUnitDao |
||
27 | { |
||
28 | |||
219 | jmachado | 29 | private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(CourseUnitDaoImpl.class); |
110 | susana | 30 | |
751 | jmachado | 31 | |
202 | jmachado | 32 | private CourseUnitDaoImpl() |
33 | { |
||
110 | susana | 34 | } |
35 | |||
36 | public static CourseUnitDaoImpl getInstance() |
||
37 | { |
||
38 | if (myInstance == null) |
||
39 | myInstance = new CourseUnitDaoImpl(); |
||
40 | return (CourseUnitDaoImpl) myInstance; |
||
41 | } |
||
42 | |||
125 | fvelez | 43 | public List<CourseUnit> loadBySigesCode(1.5.0/docs/api/java/lang/String.html">String sigesCode) |
116 | jmachado | 44 | { |
202 | jmachado | 45 | return createCriteria().add(eq("code", sigesCode)).list(); |
116 | jmachado | 46 | } |
202 | jmachado | 47 | |
214 | jmachado | 48 | public List<CourseUnit> loadByCourse(long course, 1.5.0/docs/api/java/lang/String.html">String importYear) |
49 | { |
||
371 | jmachado | 50 | return createCriteria().add(eq("importYear", importYear)).add(eq("course.id", course)).list(); |
214 | jmachado | 51 | } |
52 | |||
371 | jmachado | 53 | public List<CourseUnit> load(1.5.0/docs/api/java/lang/String.html">String importYear, 1.5.0/docs/api/java/lang/String.html">String semestre) |
358 | jmachado | 54 | { |
371 | jmachado | 55 | return createCriteria().add(eq("importYear", importYear)).add(eq("semestre", semestre)).list(); |
358 | jmachado | 56 | } |
57 | |||
771 | jmachado | 58 | public List<CourseUnit> loadYear(1.5.0/docs/api/java/lang/String.html">String importYear) |
59 | { |
||
60 | return createCriteria().add(eq("importYear", importYear)).list(); |
||
61 | } |
||
62 | |||
767 | jmachado | 63 | |
64 | |||
371 | jmachado | 65 | public List<Long> loadIds(1.5.0/docs/api/java/lang/String.html">String importYear, 1.5.0/docs/api/java/lang/String.html">String semestre) |
358 | jmachado | 66 | { |
371 | jmachado | 67 | 1.5.0/docs/api/javax/management/Query.html">Query q = createQuery("select c.id from c in class " + CourseUnit.class.getName() + " where c.importYear = ? and c.semestre = ?"); |
68 | q.setString(0, importYear); |
||
69 | q.setString(1, semestre); |
||
358 | jmachado | 70 | return q.list(); |
71 | } |
||
72 | |||
218 | jmachado | 73 | public List<CourseUnit> loadSubscribedImportYearUnits(long studentId, 1.5.0/docs/api/java/lang/String.html">String importYear) |
74 | { |
||
371 | jmachado | 75 | return createCriteria().add(eq("importYear", importYear)) |
76 | .createAlias("students", "st") |
||
255 | jmachado | 77 | .add(eq("st.id", studentId)).addOrder(Order.asc("name")).list(); |
218 | jmachado | 78 | } |
420 | jmachado | 79 | public List<CourseUnit> loadSubscribedImportYearSemestreUnits(long studentId, 1.5.0/docs/api/java/lang/String.html">String importYear, 1.5.0/docs/api/java/lang/String.html">String semestre) |
80 | { |
||
81 | Criteria c =createCriteria() |
||
82 | .add(eq("importYear", importYear)) |
||
83 | .createAlias("students", "st") |
||
84 | .add(eq("st.id", studentId)); |
||
85 | if(semestre != null) |
||
86 | c.add(eq("semestre", semestre)); |
||
87 | return c.addOrder(Order.asc("name")).list(); |
||
88 | } |
||
255 | jmachado | 89 | |
90 | public List<CourseUnit> loadSubscribedOtherImportYearUnits(long studentId, 1.5.0/docs/api/java/lang/String.html">String importYear) |
||
91 | { |
||
371 | jmachado | 92 | return createCriteria().add(not(eq("importYear", importYear))) |
93 | .createAlias("students", "st") |
||
255 | jmachado | 94 | .add(eq("st.id", studentId)).addOrder(Order.asc("name")).list(); |
95 | } |
||
343 | jmachado | 96 | |
253 | jmachado | 97 | public List<CourseUnitImpl> loadTeachedImportYearUnits(long teacherId, 1.5.0/docs/api/java/lang/String.html">String importYear) |
218 | jmachado | 98 | { |
371 | jmachado | 99 | return createCriteria().add(eq("importYear", importYear)) |
100 | .createAlias("teachers", "st") |
||
255 | jmachado | 101 | .add(eq("st.id", teacherId)).addOrder(Order.asc("importYear")).addOrder(Order.asc("name")).list(); |
218 | jmachado | 102 | } |
103 | |||
821 | jmachado | 104 | public List<CourseUnitImpl> loadResponsableImportYearUnits(long teacherId, 1.5.0/docs/api/java/lang/String.html">String importYear) |
105 | { |
||
106 | return createCriteria().add(eq("importYear", importYear)) |
||
107 | .add(eq("responsableTeacher.id", teacherId)).addOrder(Order.asc("importYear")).addOrder(Order.asc("name")).list(); |
||
108 | } |
||
109 | |||
420 | jmachado | 110 | public List<CourseUnit> loadTeachedImportYearSemestreUnits(long teacherId, 1.5.0/docs/api/java/lang/String.html">String importYear, 1.5.0/docs/api/java/lang/String.html">String semestre) |
111 | { |
||
112 | Criteria c =createCriteria() |
||
113 | .add(eq("importYear", importYear)) |
||
114 | .createAlias("teachers", "st") |
||
115 | .add(eq("st.id", teacherId)) |
||
116 | .add(eq("st.id", teacherId)); |
||
117 | if(semestre != null) |
||
118 | c.add(eq("semestre", semestre)); |
||
119 | return c.addOrder(Order.asc("name")).list(); |
||
120 | } |
||
121 | |||
122 | |||
123 | |||
163 | jmachado | 124 | public CourseUnit loadBySigesCodeUnique(1.5.0/docs/api/java/lang/String.html">String sigesCode) |
125 | { |
||
202 | jmachado | 126 | return (CourseUnit) createCriteria().add(eq("code", sigesCode)).uniqueResult(); |
163 | jmachado | 127 | } |
116 | jmachado | 128 | |
202 | jmachado | 129 | public CourseUnit loadBySigesCodeUnique(1.5.0/docs/api/java/lang/String.html">String sigesCode, 1.5.0/docs/api/java/lang/String.html">String courseCode) |
130 | { |
||
131 | return (CourseUnit) createCriteria().add(eq("code", sigesCode)).add(eq("courseCode", courseCode)).uniqueResult(); |
||
132 | } |
||
163 | jmachado | 133 | |
228 | jmachado | 134 | public CourseUnit loadBySigesCodeUniqueSubscribed(1.5.0/docs/api/java/lang/String.html">String sigesCode, 1.5.0/docs/api/java/lang/String.html">String year, 1.5.0/docs/api/java/lang/String.html">String courseCode, long studentId, 1.5.0/docs/api/java/lang/String.html">String semestre) |
219 | jmachado | 135 | { |
371 | jmachado | 136 | List<CourseUnit> cus = createCriteria() |
219 | jmachado | 137 | .add(eq("code", sigesCode)) |
228 | jmachado | 138 | .add(eq("importYear", year)) |
219 | jmachado | 139 | .add(eq("courseCode", courseCode)) |
228 | jmachado | 140 | .add(eq("semestre", semestre)) |
371 | jmachado | 141 | .createAlias("students", "st") |
142 | .add(eq("st.id", studentId)) |
||
219 | jmachado | 143 | .list(); |
371 | jmachado | 144 | if (cus.size() > 1) |
219 | jmachado | 145 | { |
146 | CourseUnit cu1 = cus.get(0); |
||
147 | CourseUnit cu2 = cus.get(1); |
||
371 | jmachado | 148 | if (cus.size() > 2) |
219 | jmachado | 149 | { |
150 | logger.error("CourseUnit in more than two places in a course:" + cu1.getCode()); |
||
151 | } |
||
152 | else |
||
153 | { |
||
371 | jmachado | 154 | if (cu1.getSemestre().equals("S1")) |
219 | jmachado | 155 | { |
371 | jmachado | 156 | if (cu2.getSemestre().equals("S1")) |
219 | jmachado | 157 | logger.error("CourseUnit in more than two places in a semestre:" + cu1.getCode()); |
158 | else |
||
159 | { |
||
160 | return cu2; |
||
161 | } |
||
162 | } |
||
163 | else |
||
164 | { |
||
371 | jmachado | 165 | if (cu2.getSemestre().equals("S2")) |
219 | jmachado | 166 | logger.error("CourseUnit in more than two places in a semestre:" + cu1.getCode()); |
167 | else |
||
168 | { |
||
169 | return cu1; |
||
170 | } |
||
171 | } |
||
172 | } |
||
173 | } |
||
371 | jmachado | 174 | else if (cus.size() == 1) |
219 | jmachado | 175 | return cus.get(0); |
176 | |||
177 | return null; |
||
178 | } |
||
179 | |||
751 | jmachado | 180 | |
181 | public void consistCourseUnitCourseCodes(1.5.0/docs/api/java/lang/String.html">String importYear) |
||
182 | { |
||
183 | List<CourseUnit> courseUnit = createCriteria() |
||
184 | .add(eq("importYear", importYear)).list(); |
||
185 | for(CourseUnit cu: courseUnit) |
||
186 | { |
||
187 | if(cu.getCourse() != null) |
||
188 | { |
||
189 | if(cu.getCourseCode() == null || (cu.getCourseCode() != null && !cu.getCourseCode().equals(cu.getCourse().getCode()))) |
||
190 | { |
||
191 | 1.5.0/docs/api/java/lang/System.html">System.out.println("Course code wrong: " + cu.getId() + " - " + cu.getName() + " old CourseCode " + cu.getCourseCode() + " now:" + cu.getCourse().getCode() ); |
||
192 | } |
||
193 | |||
194 | if(cu.getCourseName() == null || (cu.getCourseName() != null && !cu.getCourseName().equals(cu.getCourse().getName()))) |
||
195 | { |
||
196 | 1.5.0/docs/api/java/lang/System.html">System.out.println("Course name wrong: " + cu.getId() + " - " + cu.getName() + " old CourseCode " + cu.getCourseName() + " now:" + cu.getCourse().getName() ); |
||
197 | } |
||
198 | cu.setCourseCode(cu.getCourse().getCode()); |
||
199 | cu.setCourseName(cu.getCourse().getName()); |
||
200 | } |
||
201 | else |
||
202 | { |
||
203 | cu.setCourseCode(""); |
||
204 | cu.setCourseName(""); |
||
205 | } |
||
206 | } |
||
207 | } |
||
208 | |||
209 | |||
748 | jmachado | 210 | //TODO Na actualização de uma cadeira para o curso de TESTE mudar o coursecode para o o coursecode desse curso para nao deixar os dados duplicados e mal |
211 | //se nao a carregar unidades vai buscar a errada |
||
225 | jmachado | 212 | public CourseUnit loadBySigesCodeUnique(1.5.0/docs/api/java/lang/String.html">String sigesCode, 1.5.0/docs/api/java/lang/String.html">String courseCode, 1.5.0/docs/api/java/lang/String.html">String semestre, 1.5.0/docs/api/java/lang/String.html">String year) |
202 | jmachado | 213 | { |
225 | jmachado | 214 | return (CourseUnit) |
215 | createCriteria() |
||
216 | .add(eq("code", sigesCode)) |
||
217 | .add(eq("courseCode", courseCode)) |
||
218 | .add(eq("semestre", semestre)) |
||
219 | .add(eq("importYear", year)) |
||
220 | .uniqueResult(); |
||
202 | jmachado | 221 | } |
767 | jmachado | 222 | |
883 | jmachado | 223 | public CourseUnit loadBySigesCodeUniqueLastYear(1.5.0/docs/api/java/lang/String.html">String sigesCode, 1.5.0/docs/api/java/lang/String.html">String courseCode, 1.5.0/docs/api/java/lang/String.html">String semestre) |
767 | jmachado | 224 | { |
883 | jmachado | 225 | return loadBySigesCodeUnique(sigesCode,courseCode,semestre,DatesUtils.getImportYear()); |
226 | } |
||
227 | |||
228 | |||
229 | public List<CourseUnit> loadBySigesCodeUnique(1.5.0/docs/api/java/lang/String.html">String sigesCode, 1.5.0/docs/api/java/lang/String.html">String courseCode, 1.5.0/docs/api/java/lang/String.html">String year) |
||
230 | { |
||
767 | jmachado | 231 | return createCriteria() |
232 | .add(eq("code", sigesCode)) |
||
233 | .add(eq("courseCode", courseCode)) |
||
234 | .add(eq("importYear", year)) |
||
235 | .addOrder(Order.desc("id")) |
||
236 | .list(); |
||
237 | } |
||
238 | |||
457 | jmachado | 239 | public List<CourseUnit> loadBySigesCodes(1.5.0/docs/api/java/lang/String.html">String sigesCode, 1.5.0/docs/api/java/lang/String.html">String courseCode) |
240 | { |
||
241 | return (List<CourseUnit>) createCriteria() |
||
242 | .add(eq("code", sigesCode)) |
||
243 | .add(eq("courseCode", courseCode)) |
||
244 | .addOrder(Order.desc("importYear")) |
||
245 | .list(); |
||
246 | } |
||
163 | jmachado | 247 | |
376 | jmachado | 248 | public List<CourseUnit> loadCourseUnits(long courseId, 1.5.0/docs/api/java/lang/String.html">String semestre, 1.5.0/docs/api/java/lang/String.html">String year, boolean withTeacher, boolean withNoTeacher) |
249 | { |
||
250 | Criteria c = createCriteria(); |
||
251 | if(courseId > 0) |
||
252 | c.add(eq("course.id", courseId)); |
||
253 | if(semestre != null && semestre.length() > 0) |
||
254 | c.add(eq("semestre", semestre)); |
||
255 | if(year != null && year.length() > 0) |
||
256 | c.add(eq("importYear", year)); |
||
257 | if(withTeacher && !withNoTeacher) |
||
258 | { |
||
259 | c.createAlias("teachers", "th"); |
||
260 | c.add(isNotNull("th.id")); |
||
261 | } |
||
262 | else if(!withTeacher && withNoTeacher) |
||
263 | { |
||
264 | c.createAlias("teachers", "th", JoinFragment.LEFT_OUTER_JOIN); |
||
265 | c.add(isNull("th.id")); |
||
266 | } |
||
267 | return c.list(); |
||
268 | } |
||
163 | jmachado | 269 | |
376 | jmachado | 270 | |
205 | jmachado | 271 | public int countCourseUnits(1.5.0/docs/api/java/lang/String.html">String query, SearchTypeEnum searchType) |
272 | { |
||
749 | jmachado | 273 | Criterion c = DaoUtils.createSearchQuery(query, searchType, "objectives", "name","code"); |
205 | jmachado | 274 | return createCriteria().add(c).list().size(); |
275 | } |
||
163 | jmachado | 276 | |
205 | jmachado | 277 | public List<CourseUnit> search(1.5.0/docs/api/java/lang/String.html">String query, SearchTypeEnum searchTypeEnum, int maxUnits, int page) |
278 | { |
||
748 | jmachado | 279 | Criterion c = DaoUtils.createSearchQuery(query, searchTypeEnum, "objectives", "name","code"); |
205 | jmachado | 280 | Criteria criteria = createCriteria(); |
281 | criteria.add(c) |
||
282 | .addOrder(Order.asc("name")) |
||
283 | .setMaxResults(maxUnits) |
||
284 | .setFirstResult(page * maxUnits); |
||
285 | return criteria.list(); |
||
286 | } |
||
202 | jmachado | 287 | |
206 | jmachado | 288 | public int countCourseUnitsActualYear(1.5.0/docs/api/java/lang/String.html">String query, SearchTypeEnum searchType) |
289 | { |
||
371 | jmachado | 290 | Criterion c = DaoUtils.createSearchQuery(query, searchType, "objectives", "name"); |
206 | jmachado | 291 | return createCriteria() |
292 | .add(c) |
||
293 | .add(eq("importYear", DatesUtils.getImportYear())) |
||
294 | .list().size(); |
||
295 | } |
||
296 | |||
297 | public List<CourseUnit> searchActualYear(1.5.0/docs/api/java/lang/String.html">String query, SearchTypeEnum searchTypeEnum, int maxUnits, int page) |
||
298 | { |
||
299 | Criterion c = DaoUtils.createSearchQuery(query, searchTypeEnum, "objectives", "name"); |
||
300 | Criteria criteria = createCriteria(); |
||
301 | criteria.add(c) |
||
302 | .add(eq("importYear", DatesUtils.getImportYear())) |
||
303 | .addOrder(Order.asc("name")) |
||
304 | .setMaxResults(maxUnits) |
||
305 | .setFirstResult(page * maxUnits); |
||
306 | return criteria.list(); |
||
307 | } |
||
308 | |||
205 | jmachado | 309 | public List<CourseUnit> loadMissingObjectives(long teacherId) |
310 | { |
||
311 | //todo falta a projeccao do teacher id |
||
312 | return createCriteria() |
||
206 | jmachado | 313 | .add(eq("importYear", DatesUtils.getImportYear())) |
371 | jmachado | 314 | .add((or(isNull("objectives"), eq("objectives", "")))) |
205 | jmachado | 315 | .createAlias("teachers", "th") |
371 | jmachado | 316 | .add(eq("semestre", DatesUtils.getSemestre())) |
317 | .add(eq("th.id", teacherId)) |
||
205 | jmachado | 318 | .list(); |
319 | } |
||
320 | |||
214 | jmachado | 321 | public List<CourseUnit> loadMissingPrograms(long teacherId) |
322 | { |
||
323 | //todo falta a projeccao do teacher id |
||
324 | return createCriteria() |
||
325 | .add(eq("importYear", DatesUtils.getImportYear())) |
||
371 | jmachado | 326 | .add((or(isNull("programStreamId"), eq("programStreamId", "")))) |
214 | jmachado | 327 | .createAlias("teachers", "th") |
371 | jmachado | 328 | .add(eq("semestre", DatesUtils.getSemestre())) |
329 | .add(eq("th.id", teacherId)) |
||
214 | jmachado | 330 | .list(); |
331 | } |
||
332 | |||
343 | jmachado | 333 | public List<CourseUnit> loadMissingObjectivesOrPrograms(long teacherId) |
334 | { |
||
335 | //todo falta a projeccao do teacher id |
||
371 | jmachado | 336 | Criteria c = createCriteria() |
343 | jmachado | 337 | .add(eq("importYear", DatesUtils.getImportYear())) |
371 | jmachado | 338 | .add(or(or(isNull("objectives"), eq("objectives", "")), or(isNull("programStreamId"), eq("programStreamId", "")))); |
339 | |||
340 | DatesUtils.SemestreModerate semestreModerate = DatesUtils.getSemestreModerate(); |
||
341 | if (semestreModerate == DatesUtils.SemestreModerate.S1) |
||
342 | c.add(eq("semestre", "S1")); |
||
343 | else if (semestreModerate == DatesUtils.SemestreModerate.S2) |
||
344 | c.add(eq("semestre", "S2")); |
||
345 | else |
||
346 | c.add(or(eq("semestre", "S1"), eq("semestre", "S2"))); |
||
347 | |||
348 | return c.createAlias("teachers", "th") |
||
349 | .add(eq("th.id", teacherId)) |
||
343 | jmachado | 350 | .list(); |
351 | } |
||
214 | jmachado | 352 | |
343 | jmachado | 353 | |
214 | jmachado | 354 | public List<CourseUnit> loadMissingObjectivesGivenCourse(long courseId) |
355 | { |
||
356 | return createCriteria() |
||
357 | .createAlias("course", "c") |
||
371 | jmachado | 358 | .add(eq("c.id", courseId)) |
214 | jmachado | 359 | .add(eq("importYear", DatesUtils.getImportYear())) |
371 | jmachado | 360 | .add(eq("semestre", DatesUtils.getSemestre())) |
361 | .add((or(isNull("objectives"), eq("objectives", "")))) |
||
214 | jmachado | 362 | .list(); |
363 | } |
||
364 | |||
365 | public List<CourseUnit> loadMissingProgramGivenCourse(long courseId) |
||
366 | { |
||
367 | return createCriteria() |
||
368 | .createAlias("course", "c") |
||
371 | jmachado | 369 | .add(eq("c.id", courseId)) |
214 | jmachado | 370 | .add(eq("importYear", DatesUtils.getImportYear())) |
371 | jmachado | 371 | .add(eq("semestre", DatesUtils.getSemestre())) |
372 | .add((or(isNull("programStreamId"), eq("programStreamId", "")))) |
||
214 | jmachado | 373 | .list(); |
374 | } |
||
375 | |||
509 | jmachado | 376 | public List<CourseUnit> loadMissingProgramValidateGivenCourse(long courseId) |
377 | { |
||
378 | return createCriteria() |
||
379 | .createAlias("course", "c") |
||
380 | .add(eq("c.id", courseId)) |
||
381 | .add(eq("importYear", DatesUtils.getImportYear())) |
||
382 | .add(eq("semestre", DatesUtils.getSemestre())) |
||
383 | .add((and(isNotNull("programStreamId"), not(eq("programStreamId", ""))))) |
||
384 | .add((eq("validProgram", false))) |
||
385 | .list(); |
||
386 | } |
||
387 | |||
219 | jmachado | 388 | public List<CourseUnit> loadMissingObjectivesOrProgramGivenCourse(long courseId) |
214 | jmachado | 389 | { |
390 | return createCriteria() |
||
391 | .createAlias("course", "c") |
||
371 | jmachado | 392 | .add(eq("c.id", courseId)) |
214 | jmachado | 393 | .add(eq("importYear", DatesUtils.getImportYear())) |
371 | jmachado | 394 | .add(eq("semestre", DatesUtils.getSemestre())) |
395 | .add((or(or(isNull("objectives"), eq("objectives", "")), or(isNull("programStreamId"), eq("programStreamId", ""))))) |
||
214 | jmachado | 396 | .list(); |
397 | } |
||
205 | jmachado | 398 | |
343 | jmachado | 399 | public int countMissingProgramGivenCourse(long courseId) |
400 | { |
||
401 | return loadMissingProgramGivenCourse(courseId).size(); |
||
402 | } |
||
205 | jmachado | 403 | |
509 | jmachado | 404 | public int countMissingProgramValidateCourse(long courseId) |
405 | { |
||
406 | return loadMissingProgramValidateGivenCourse(courseId).size(); |
||
407 | } |
||
751 | jmachado | 408 | |
409 | |||
410 | public List<String> getTeachersEmails(long unit) { |
||
411 | 1.5.0/docs/api/javax/management/Query.html">Query q = createQuery("select e.email from " |
||
412 | + Teacher.class.getName() + " e join e.teachedUnits as unit " |
||
413 | + " where " |
||
414 | + " unit.id = ? " |
||
415 | |||
416 | ); |
||
417 | q.setLong(0,unit); |
||
418 | return q.list(); |
||
419 | } |
||
110 | susana | 420 | } |