View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: Generated code! Do not modify by hand!
4   // Generated by: hibernate/SpringHibernateDaoBase.vsl in <project>/mda/src/main/cartridge/custom/...
5   //
6   package fr.ifremer.quadrige3.core.dao.system.rule;
7   
8   /*-
9    * #%L
10   * Quadrige3 Core :: Client API
11   * %%
12   * Copyright (C) 2017 - 2024 Ifremer
13   * %%
14   * This program is free software: you can redistribute it and/or modify
15   * it under the terms of the GNU Affero General Public License as published by
16   * the Free Software Foundation, either version 3 of the License, or
17   * (at your option) any later version.
18   * 
19   * This program is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   * GNU General Public License for more details.
23   * 
24   * You should have received a copy of the GNU Affero General Public License
25   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26   * #L%
27   */
28  import fr.ifremer.quadrige3.core.dao.PrincipalStore;
29  import fr.ifremer.quadrige3.core.dao.PropertySearch;
30  import fr.ifremer.quadrige3.core.dao.Search;
31  import fr.ifremer.quadrige3.core.dao.technical.hibernate.HibernateDaoSupport;
32  import fr.ifremer.quadrige3.core.vo.system.rule.RulePreconditionVO;
33  import java.security.Principal;
34  import java.sql.Timestamp;
35  import java.util.ArrayList;
36  import java.util.Collection;
37  import java.util.Iterator;
38  import java.util.LinkedHashSet;
39  import java.util.List;
40  import java.util.Set;
41  import javax.annotation.Resource;
42  import org.andromda.spring.PaginationResult;
43  import org.apache.commons.collections.CollectionUtils;
44  import org.apache.commons.collections.Transformer;
45  import org.hibernate.Criteria;
46  import org.hibernate.HibernateException;
47  import org.hibernate.Query;
48  import org.hibernate.ScrollableResults;
49  
50  /**
51   * <p>
52   * Base Spring DAO Class: is able to create, update, remove, load, and find
53   * objects of type <code>RulePrecondition</code>.
54   * </p>
55   *
56   * @see RulePrecondition
57   */
58  public abstract class RulePreconditionDaoBase
59      extends HibernateDaoSupport    
60      implements RulePreconditionDao
61  {
62      /**
63       * {@inheritDoc}
64       */
65      @Override
66      public Object get(final int transform, final Integer rulePrecondId)
67      {
68          if (rulePrecondId == null)
69          {
70              throw new IllegalArgumentException(
71                  "RulePrecondition.get - 'rulePrecondId' can not be null");
72          }
73          final RulePrecondition entity = get(RulePreconditionImpl.class, rulePrecondId);
74          return transformEntity(transform, entity);
75      }
76      /**
77       * {@inheritDoc}
78       */
79      @Override
80      public RulePrecondition get(Integer rulePrecondId)
81      {
82          return (RulePrecondition)this.get(TRANSFORM_NONE, rulePrecondId);
83      }
84  
85      /**
86       * {@inheritDoc}
87       */
88      @Override
89      public Object load(final int transform, final Integer rulePrecondId)
90      {
91          if (rulePrecondId == null)
92          {
93              throw new IllegalArgumentException(
94                  "RulePrecondition.load - 'rulePrecondId' can not be null");
95          }
96          final RulePrecondition entity = get(RulePreconditionImpl.class, rulePrecondId);
97          return transformEntity(transform, entity);
98      }
99  
100     /**
101      * {@inheritDoc}
102      */
103     @Override
104     public RulePrecondition load(Integer rulePrecondId)
105     {
106         return (RulePrecondition)this.load(TRANSFORM_NONE, rulePrecondId);
107     }
108 
109     /**
110      * {@inheritDoc}
111      */
112     @Override
113     @SuppressWarnings({"unchecked"})
114     public Collection<RulePrecondition> loadAll()
115     {
116         return (Collection<RulePrecondition>) this.loadAll(RulePreconditionDao.TRANSFORM_NONE);
117     }
118 
119     /**
120      * {@inheritDoc}
121      */
122     @Override
123     public Collection<?> loadAll(final int transform)
124     {
125         return this.loadAll(transform, -1, -1);
126     }
127 
128     /**
129      * {@inheritDoc}
130      */
131     @Override
132     public Collection<?> loadAll(final int pageNumber, final int pageSize)
133     {
134         return this.loadAll(RulePreconditionDao.TRANSFORM_NONE, pageNumber, pageSize);
135     }
136 
137     /**
138      * {@inheritDoc}
139      */
140     @Override
141     public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize)
142     {
143         try
144         {
145             final Criteria criteria = this.getSession().createCriteria(RulePreconditionImpl.class);
146             if (pageNumber > 0 && pageSize > 0)
147             {
148                 criteria.setFirstResult(this.calculateFirstResult(pageNumber, pageSize));
149                 criteria.setMaxResults(pageSize);
150             }
151             final Collection<?> results = criteria.list();
152             this.transformEntities(transform, results);
153             return results;
154         }
155         catch (HibernateException ex)
156         {
157             throw ex;
158         }
159     }
160 
161     /**
162      * firstResult = (pageNumber - 1) * pageSize
163      * @param pageNumber
164      * @param pageSize
165      * @return firstResult
166      */
167     protected int calculateFirstResult(int pageNumber, int pageSize)
168     {
169         int firstResult = 0;
170         if (pageNumber > 0)
171         {
172             firstResult = (pageNumber - 1) * pageSize;
173         }
174         return firstResult;
175     }
176 
177     /**
178      * {@inheritDoc}
179      */
180     @Override
181     public RulePrecondition create(RulePrecondition rulePrecondition)
182     {
183         return (RulePrecondition)this.create(RulePreconditionDao.TRANSFORM_NONE, rulePrecondition);
184     }
185 
186     /**
187      * {@inheritDoc}
188      */
189     @Override
190     public Object create(final int transform, final RulePrecondition rulePrecondition)
191     {
192         if (rulePrecondition == null)
193         {
194             throw new IllegalArgumentException(
195                 "RulePrecondition.create - 'rulePrecondition' can not be null");
196         }
197         this.getSessionFactory().getCurrentSession().save(rulePrecondition);
198         return this.transformEntity(transform, rulePrecondition);
199     }
200 
201     /**
202      * {@inheritDoc}
203      */
204     @Override
205     @SuppressWarnings({"unchecked"})
206     public Collection<RulePrecondition> create(final Collection<RulePrecondition> entities)
207     {
208         return (Collection<RulePrecondition>) create(RulePreconditionDao.TRANSFORM_NONE, entities);
209     }
210 
211     /**
212      * {@inheritDoc}
213      */
214     @Override
215     public Collection<?> create(final int transform, final Collection<RulePrecondition> entities)
216     {
217         if (entities == null)
218         {
219             throw new IllegalArgumentException(
220                 "RulePrecondition.create - 'entities' can not be null");
221         }
222                     for (RulePrecondition entity : entities)
223                     {
224                         create(transform, entity);
225                     }
226         return entities;
227     }
228 
229     /**
230      * {@inheritDoc}
231      */
232     @Override
233     public RulePrecondition create(
234         String rulePrecondLb,
235         String rulePrecondIsBidir,
236         String rulePrecondIsActive,
237         Timestamp updateDt)
238     {
239         return (RulePrecondition)this.create(RulePreconditionDao.TRANSFORM_NONE, rulePrecondLb, rulePrecondIsBidir, rulePrecondIsActive, updateDt);
240     }
241 
242     /**
243      * {@inheritDoc}
244      */
245     @Override
246     public Object create(
247         final int transform,
248         String rulePrecondLb,
249         String rulePrecondIsBidir,
250         String rulePrecondIsActive,
251         Timestamp updateDt)
252     {
253         RulePrecondition entity = new RulePreconditionImpl();
254         entity.setRulePrecondLb(rulePrecondLb);
255         entity.setRulePrecondIsBidir(rulePrecondIsBidir);
256         entity.setRulePrecondIsActive(rulePrecondIsActive);
257         entity.setUpdateDt(updateDt);
258         return this.create(transform, entity);
259     }
260 
261     /**
262      * {@inheritDoc}
263      */
264     @Override
265     public RulePrecondition create(
266         Rule rule,
267         String rulePrecondIsActive,
268         String rulePrecondIsBidir,
269         String rulePrecondLb,
270         Rule usedRule)
271     {
272         return (RulePrecondition)this.create(RulePreconditionDao.TRANSFORM_NONE, rule, rulePrecondIsActive, rulePrecondIsBidir, rulePrecondLb, usedRule);
273     }
274 
275     /**
276      * {@inheritDoc}
277      */
278     @Override
279     public Object create(
280         final int transform,
281         Rule rule,
282         String rulePrecondIsActive,
283         String rulePrecondIsBidir,
284         String rulePrecondLb,
285         Rule usedRule)
286     {
287         RulePrecondition entity = new RulePreconditionImpl();
288         entity.setRule(rule);
289         entity.setRulePrecondIsActive(rulePrecondIsActive);
290         entity.setRulePrecondIsBidir(rulePrecondIsBidir);
291         entity.setRulePrecondLb(rulePrecondLb);
292         entity.setUsedRule(usedRule);
293         return this.create(transform, entity);
294     }
295 
296     /**
297      * {@inheritDoc}
298      */
299     @Override
300     public void update(RulePrecondition rulePrecondition)
301     {
302         if (rulePrecondition == null)
303         {
304             throw new IllegalArgumentException(
305                 "RulePrecondition.update - 'rulePrecondition' can not be null");
306         }
307         this.getSessionFactory().getCurrentSession().update(rulePrecondition);
308     }
309 
310     /**
311      * {@inheritDoc}
312      */
313     @Override
314     public void update(final Collection<RulePrecondition> entities)
315     {
316         if (entities == null)
317         {
318             throw new IllegalArgumentException(
319                 "RulePrecondition.update - 'entities' can not be null");
320         }
321                     for (RulePrecondition entity : entities)
322                     {
323                         update(entity);
324                     }
325     }
326 
327     /**
328      * {@inheritDoc}
329      */
330     @Override
331     public void remove(RulePrecondition rulePrecondition)
332     {
333         if (rulePrecondition == null)
334         {
335             throw new IllegalArgumentException(
336                 "RulePrecondition.remove - 'rulePrecondition' can not be null");
337         }
338         this.getSessionFactory().getCurrentSession().delete(rulePrecondition);
339     }
340 
341     /**
342      * {@inheritDoc}
343      */
344     @Override
345     public void remove(Integer rulePrecondId)
346     {
347         if (rulePrecondId == null)
348         {
349             throw new IllegalArgumentException(
350                 "RulePrecondition.remove - 'rulePrecondId' can not be null");
351         }
352         RulePrecondition entity = this.get(rulePrecondId);
353         if (entity != null)
354         {
355             this.remove(entity);
356         }
357     }
358 
359     /**
360      * {@inheritDoc}
361      */
362     @Override
363     public void remove(Collection<RulePrecondition> entities)
364     {
365         if (entities == null)
366         {
367             throw new IllegalArgumentException(
368                 "RulePrecondition.remove - 'entities' can not be null");
369         }
370         deleteAll(entities);
371     }
372     /**
373      * {@inheritDoc}
374      */
375     @Override
376     public RulePreconditionVO save(final RulePreconditionVO rulePrecondition, final Timestamp updateDt)
377     {
378         if (rulePrecondition == null)
379         {
380             throw new IllegalArgumentException(
381                 "fr.ifremer.quadrige3.core.dao.system.rule.RulePreconditionDao.save(RulePreconditionVO rulePrecondition, Timestamp updateDt) - 'rulePrecondition' can not be null");
382         }
383         try
384         {
385             return this.handleSave(rulePrecondition, updateDt);
386         }
387         catch (Throwable th)
388         {
389             throw new RuntimeException(
390             "Error performing 'RulePreconditionDao.save(RulePreconditionVO rulePrecondition, Timestamp updateDt)' --> " + th,
391             th);
392         }
393     }
394 
395     /**
396      * Performs the core logic for {@link #save(RulePreconditionVO, Timestamp)}
397      * @param rulePrecondition
398      * @param updateDt
399      * @return RulePreconditionVO
400      * @throws Exception
401      */
402     protected abstract RulePreconditionVO handleSave(RulePreconditionVO rulePrecondition, Timestamp updateDt)
403         throws Exception;
404 
405     /**
406      * {@inheritDoc}
407      */
408     @Override
409     public void removeByIds(final Collection<Integer> rulePreconditionIds)
410     {
411         if (rulePreconditionIds == null)
412         {
413             throw new IllegalArgumentException(
414                 "fr.ifremer.quadrige3.core.dao.system.rule.RulePreconditionDao.removeByIds(Collection<Integer> rulePreconditionIds) - 'rulePreconditionIds' can not be null");
415         }
416         try
417         {
418             this.handleRemoveByIds(rulePreconditionIds);
419         }
420         catch (Throwable th)
421         {
422             throw new RuntimeException(
423             "Error performing 'RulePreconditionDao.removeByIds(Collection<Integer> rulePreconditionIds)' --> " + th,
424             th);
425         }
426     }
427 
428     /**
429      * Performs the core logic for {@link #removeByIds(Collection<Integer>)}
430      * @param rulePreconditionIds
431      * @return void
432      * @throws Exception
433      */
434     protected abstract void handleRemoveByIds(Collection<Integer> rulePreconditionIds)
435         throws Exception;
436 
437     /**
438      * Allows transformation of entities into value objects
439      * (or something else for that matter), when the <code>transform</code>
440      * flag is set to one of the constants defined in <code>RulePreconditionDao</code>, please note
441      * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
442      * will be returned.
443      * <p>
444      * This method will return instances of these types:
445      * <ul>
446      *   <li>{@link RulePrecondition} - {@link #TRANSFORM_NONE}</li>
447      *   <li>{@link RulePreconditionVO} - {@link #TRANSFORM_RULEPRECONDITIONVO}</li>
448      * </ul>
449      *
450      * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
451      *
452      * @param transform one of the constants declared in {@link RulePreconditionDao}
453      * @param entity an entity that was found
454      * @return the transformed entity (i.e. new value object, etc)
455      * @see RulePreconditionDao#transformEntity(int, RulePrecondition)
456      */
457     public Object transformEntity(final int transform, final RulePrecondition entity)
458     {
459         Object target = null;
460         if (entity != null)
461         {
462             switch (transform)
463             {
464                 case TRANSFORM_RULEPRECONDITIONVO :
465                     target = toRulePreconditionVO(entity);
466                     break;
467                 case RulePreconditionDao.TRANSFORM_NONE : // fall-through
468                 default:
469                     target = entity;
470             }
471         }
472         return target;
473     }
474 
475     /**
476      * {@inheritDoc}
477      */
478     @Override
479     public void transformEntities(final int transform, final Collection<?> entities)
480     {
481         switch (transform)
482         {
483             case TRANSFORM_RULEPRECONDITIONVO :
484                 toRulePreconditionVOCollection(entities);
485                 break;
486             case RulePreconditionDao.TRANSFORM_NONE : // fall-through
487                 default:
488                 // do nothing;
489         }
490     }
491 
492     /**
493      * @see RulePreconditionDao#toEntities(Collection)
494      */
495     public void toEntities(final Collection<?> results)
496     {
497         if (results != null)
498         {
499             CollectionUtils.transform(results, this.ENTITYTRANSFORMER);
500         }
501     }
502 
503     /**
504      * This anonymous transformer is designed to transform report query results
505      * (which result in an array of entities) to {@link RulePrecondition}
506      * using the Jakarta Commons-Collections Transformation API.
507      */
508     private Transformer ENTITYTRANSFORMER =
509         new Transformer()
510         {
511             public Object transform(Object input)
512             {
513                 Object result = null;
514                 if (input instanceof Object[])
515                 {
516                     result = toEntity((Object[])input);
517                 }
518                 else if (input instanceof RulePrecondition)
519                 {
520                     result = input;
521                 }
522                 return result;
523             }
524         };
525 
526     /**
527      * @param row
528      * @return RulePrecondition
529      */
530     protected RulePrecondition toEntity(Object[] row)
531     {
532         RulePrecondition target = null;
533         if (row != null)
534         {
535             final int numberOfObjects = row.length;
536             for (int ctr = 0; ctr < numberOfObjects; ctr++)
537             {
538                 final Object object = row[ctr];
539                 if (object instanceof RulePrecondition)
540                 {
541                     target = (RulePrecondition)object;
542                     break;
543                 }
544             }
545         }
546         return target;
547     }
548 
549     /**
550      * {@inheritDoc}
551      */
552     @Override
553     @SuppressWarnings({"unchecked"})
554     public final Collection<RulePreconditionVO> toRulePreconditionVOCollection(Collection<?> entities)
555     {
556         Collection<RulePreconditionVO> result = new ArrayList<RulePreconditionVO>();
557         if (entities != null)
558         {
559             CollectionUtils.transform(entities, this.RULEPRECONDITIONVO_TRANSFORMER);
560             result.addAll((Collection<? extends RulePreconditionVO>) entities);
561         }
562         return result;
563     }
564 
565     /**
566      * {@inheritDoc}
567      */
568     @Override
569     @SuppressWarnings({ "unchecked" })
570     public final RulePreconditionVO[] toRulePreconditionVOArray(Collection<?> entities)
571     {
572         RulePreconditionVO[] result = null;
573         if (entities != null)
574         {
575             // Unchecked transformation: reuses entities Collection
576             final Collection collection = new ArrayList(entities);
577             this.toRulePreconditionVOCollection(collection);
578             result = (RulePreconditionVO[]) collection.toArray(new RulePreconditionVO[collection.size()]);
579         }
580         return result;
581     }
582 
583     /**
584      * Default implementation for transforming the results of a report query into a value object. This
585      * implementation exists for convenience reasons only. It needs only be overridden in the
586      * {@link RulePreconditionDaoImpl} class if you intend to use reporting queries.
587      * @param row
588      * @return toRulePreconditionVO(this.toEntity(row))
589      * @see RulePreconditionDao#toRulePreconditionVO(RulePrecondition)
590      */
591     protected RulePreconditionVO toRulePreconditionVO(Object[] row)
592     {
593         return this.toRulePreconditionVO(this.toEntity(row));
594     }
595 
596     /**
597      * This anonymous transformer is designed to transform entities or report query results
598      * (which result in an array of objects) to {@link RulePreconditionVO}
599      * using the Jakarta Commons-Collections Transformation API.
600      */
601     private Transformer RULEPRECONDITIONVO_TRANSFORMER =
602         new Transformer()
603         {
604             public Object transform(Object input)
605             {
606                 Object result = null;
607                 if (input instanceof RulePrecondition)
608                 {
609                     result = toRulePreconditionVO((RulePrecondition)input);
610                 }
611                 else if (input instanceof Object[])
612                 {
613                     result = toRulePreconditionVO((Object[])input);
614                 }
615                 return result;
616             }
617         };
618 
619     /**
620      * {@inheritDoc}
621      */
622     @Override
623     public final void rulePreconditionVOToEntityCollection(Collection<?> instances)
624     {
625         if (instances != null)
626         {
627             for (final Iterator<?> iterator = instances.iterator(); iterator.hasNext();)
628             {
629                 // - remove an objects that are null or not of the correct instance
630                 if (!(iterator.next() instanceof RulePreconditionVO))
631                 {
632                     iterator.remove();
633                 }
634             }
635             CollectionUtils.transform(instances, this.RulePreconditionVOToEntityTransformer);
636         }
637     }
638 
639     private final Transformer RulePreconditionVOToEntityTransformer =
640         new Transformer()
641         {
642             public Object transform(Object input)
643             {
644                 return rulePreconditionVOToEntity((RulePreconditionVO)input);
645             }
646         };
647 
648 
649     /**
650      * {@inheritDoc}
651      */
652     @Override
653     public void toRulePreconditionVO(
654         RulePrecondition source,
655         RulePreconditionVO target)
656     {
657         target.setRulePrecondId(source.getRulePrecondId());
658         target.setRulePrecondLb(source.getRulePrecondLb());
659         target.setRulePrecondIsBidir(source.getRulePrecondIsBidir());
660         target.setRulePrecondIsActive(source.getRulePrecondIsActive());
661         target.setUpdateDt(source.getUpdateDt());
662     }
663 
664     /**
665      * {@inheritDoc}
666      */
667     @Override
668     public RulePreconditionVO toRulePreconditionVO(final RulePrecondition entity)
669     {
670         RulePreconditionVO target = null;
671         if (entity != null)
672         {
673             target =  new RulePreconditionVO();
674             this.toRulePreconditionVO(entity, target);
675         }
676         return target;
677     }
678 
679     /**
680      * {@inheritDoc}
681      */
682     @Override
683     public void rulePreconditionVOToEntity(
684         RulePreconditionVO source,
685         RulePrecondition target,
686         boolean copyIfNull)
687     {
688         if (copyIfNull || source.getRulePrecondLb() != null)
689         {
690             target.setRulePrecondLb(source.getRulePrecondLb());
691         }
692         if (copyIfNull || source.getRulePrecondIsBidir() != null)
693         {
694             target.setRulePrecondIsBidir(source.getRulePrecondIsBidir());
695         }
696         if (copyIfNull || source.getRulePrecondIsActive() != null)
697         {
698             target.setRulePrecondIsActive(source.getRulePrecondIsActive());
699         }
700         if (copyIfNull || source.getUpdateDt() != null)
701         {
702             target.setUpdateDt(source.getUpdateDt());
703         }
704     }
705 
706     /**
707      * Gets the current <code>principal</code> if one has been set,
708      * otherwise returns <code>null</code>.
709      *
710      * @return the current principal
711      */
712     protected Principal getPrincipal()
713     {
714         return PrincipalStore.get();
715     }
716 
717     /**
718      * {@inheritDoc}
719      */
720     @Override
721     @SuppressWarnings({ "unchecked" })
722     public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search)
723     {
724         try
725         {
726             search.setPageNumber(pageNumber);
727             search.setPageSize(pageSize);
728             final PropertySearch propertySearch = new PropertySearch(
729                 this.getSession(), RulePreconditionImpl.class, search);
730             final List results = propertySearch.executeAsList();
731             this.transformEntities(transform, results);
732             return new PaginationResult(results.toArray(new Object[results.size()]), propertySearch.getTotalCount());
733         }
734         catch (HibernateException ex)
735         {
736             throw ex; /*super.convertHibernateAccessException(ex);*/
737         }
738     }
739 
740     /**
741      * {@inheritDoc}
742      */
743     @Override
744     public PaginationResult search(final int pageNumber, final int pageSize, final Search search)
745     {
746         return this.search(RulePreconditionDao.TRANSFORM_NONE, pageNumber, pageSize, search);
747     }
748 
749     /**
750      * {@inheritDoc}
751      */
752     @Override
753     public Set<?> search(final int transform, final Search search)
754     {
755         try
756         {
757             final PropertySearch propertySearch = new PropertySearch(
758                 this.getSession(), RulePreconditionImpl.class, search);
759             final Set<?> results = propertySearch.executeAsSet();
760             this.transformEntities(transform, results);
761             return results;
762         }
763         catch (HibernateException ex)
764         {
765             throw ex; /*super.convertHibernateAccessException(ex);*/
766         }
767     }
768 
769     /**
770      * {@inheritDoc}
771      */
772     @Override
773     @SuppressWarnings("unchecked")
774     public Set<RulePrecondition> search(final Search search)
775     {
776         return (Set<RulePrecondition>) this.search(RulePreconditionDao.TRANSFORM_NONE, search);
777     }
778 
779     /**
780      * Executes and returns the given Hibernate queryObject as a {@link PaginationResult} instance.
781      * @param queryObject
782      * @param transform
783      * @param pageNumber
784      * @param pageSize
785      * @return PaginationResult
786      */
787     @SuppressWarnings({ "unchecked" })
788     protected PaginationResult getPaginationResult(
789         final Query queryObject,
790         final int transform, int pageNumber, int pageSize)
791     {
792         try
793         {
794             final ScrollableResults scrollableResults = queryObject.scroll();
795             scrollableResults.last();
796             int totalCount = scrollableResults.getRowNumber();
797             totalCount = totalCount >= 0 ? totalCount + 1 : 0;
798             if (pageNumber > 0 && pageSize > 0)
799             {
800                 queryObject.setFirstResult(this.calculateFirstResult(pageNumber, pageSize));
801                 queryObject.setMaxResults(pageSize);
802             }
803             // Unchecked transformation because Set object is reused, cannot be strongly typed.
804             Set results = new LinkedHashSet(queryObject.list());
805             transformEntities(transform, results);
806             return new PaginationResult(results.toArray(new Object[results.size()]), totalCount);
807         }
808         catch (HibernateException ex)
809         {
810             throw ex; /*super.convertHibernateAccessException(ex);*/
811         }
812     }
813 
814     // spring-hibernate-dao-base merge-point
815 }