2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.persistence
.dao
.hibernate
.description
;
12 import java
.util
.Collection
;
13 import java
.util
.HashMap
;
14 import java
.util
.Iterator
;
15 import java
.util
.List
;
17 import java
.util
.UUID
;
19 import org
.apache
.log4j
.Logger
;
20 import org
.hibernate
.Criteria
;
21 import org
.springframework
.stereotype
.Repository
;
23 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
24 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
25 import eu
.etaxonomy
.cdm
.persistence
.dao
.description
.IPolytomousKeyDao
;
26 import eu
.etaxonomy
.cdm
.persistence
.dao
.hibernate
.common
.IdentifiableDaoBase
;
34 public class PolytomousKeyDaoImpl
extends IdentifiableDaoBase
<PolytomousKey
> implements IPolytomousKeyDao
{
35 private static final Logger logger
= Logger
.getLogger(PolytomousKeyDaoImpl
.class);
37 public PolytomousKeyDaoImpl() {
38 super(PolytomousKey
.class);
39 // indexedClasses = new Class[1];
40 // indexedClasses[0] = PolytomousKey.class;
45 public List
<PolytomousKey
> list() {
46 Criteria crit
= getSession().createCriteria(type
);
51 //FIXME rewrite as node has a key attribute now
52 public void loadNodes(PolytomousKeyNode root
, List
<String
> nodePaths
) {
53 for(PolytomousKeyNode child
: root
.getChildren()) {
54 defaultBeanInitializer
.initialize(child
, nodePaths
);
55 loadNodes(child
,nodePaths
);