buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SeverityDAO.java
changeset 628 7c4a911dc066
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
       
     1 /*
       
     2  * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  
       
    15  *
       
    16  */
       
    17 package com.nokia.helium.metadata.model.metadata;
       
    18 
       
    19 import java.util.Hashtable;
       
    20 import java.util.Map;
       
    21 
       
    22 import com.nokia.helium.metadata.JpaDAO;
       
    23 
       
    24 /**
       
    25  * Implements DAO for the Severity.
       
    26  * Contains all helpers related to Severity manipulation.
       
    27  *
       
    28  */
       
    29 public class SeverityDAO extends JpaDAO<Severity> {
       
    30 
       
    31     public Map<String, Severity> getSeverities() {
       
    32         Map<String, Severity> result = new Hashtable<String, Severity>();
       
    33         for (Severity severity : this.getEntityManager().createQuery("SELECT s from Severity s", Severity.class).getResultList()) {
       
    34             result.put(severity.getSeverity(), severity);
       
    35         }
       
    36         return result;
       
    37     }
       
    38     
       
    39 }