3 * Copyright (C) 2014 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.persistence
.dao
.hibernate
.molecular
;
12 import java
.util
.ArrayList
;
13 import java
.util
.List
;
14 import java
.util
.UUID
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.hibernate
.Query
;
18 import org
.hibernate
.Session
;
19 import org
.springframework
.stereotype
.Repository
;
21 import eu
.etaxonomy
.cdm
.model
.common
.UuidAndTitleCache
;
22 import eu
.etaxonomy
.cdm
.model
.molecular
.Amplification
;
23 import eu
.etaxonomy
.cdm
.persistence
.dao
.hibernate
.common
.AnnotatableDaoImpl
;
24 import eu
.etaxonomy
.cdm
.persistence
.dao
.molecular
.IAmplificationDao
;
32 public class AmplificationDaoHibernateImpl
extends AnnotatableDaoImpl
<Amplification
> implements IAmplificationDao
{
34 @SuppressWarnings("unused")
35 private static final Logger logger
= Logger
.getLogger(AmplificationDaoHibernateImpl
.class);
40 public AmplificationDaoHibernateImpl() {
41 super(Amplification
.class);
45 public List
<UuidAndTitleCache
<Amplification
>> getAmplificationUuidAndLabelCache() {
46 List
<UuidAndTitleCache
<Amplification
>> list
= new ArrayList
<UuidAndTitleCache
<Amplification
>>();
47 Session session
= getSession();
49 Query query
= session
.createQuery("select uuid, id, labelCache from Amplification");
51 List
<Object
[]> result
= query
.list();
53 for(Object
[] object
: result
){
54 list
.add(new UuidAndTitleCache
<Amplification
>(Amplification
.class, (UUID
) object
[0], (Integer
)object
[1], (String
) object
[2]));