buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/entity/metadata/WhatLogEntry.java
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 629 541af5ee3ed9
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 
       
    18 package com.nokia.helium.jpa.entity.metadata;
       
    19 
       
    20 
       
    21 import javax.persistence.CascadeType;
       
    22 import javax.persistence.Entity;
       
    23 
       
    24 import javax.persistence.GeneratedValue;
       
    25 import javax.persistence.GenerationType;
       
    26 import javax.persistence.Id;
       
    27 import javax.persistence.ManyToOne;
       
    28 import javax.persistence.Column;
       
    29 import javax.persistence.Basic;
       
    30 import javax.persistence.JoinColumn;
       
    31 
       
    32 
       
    33 /**
       
    34  * Entity class to store the component information.
       
    35  */
       
    36 @Entity
       
    37 public class WhatLogEntry {
       
    38 
       
    39     @Id
       
    40     @GeneratedValue(strategy = GenerationType.SEQUENCE)
       
    41     @Column(name = "WHATLOG_ENTRY_ID")
       
    42     private int id;
       
    43 
       
    44     @Basic
       
    45     @Column(name = "COMPONENT_ID", insertable = false, updatable = false)
       
    46     private int componentID;
       
    47 
       
    48     @Basic
       
    49     @Column(name = "MEMBER", nullable = false)
       
    50     private String member;
       
    51 
       
    52     @Basic
       
    53     @Column(name = "MISSING")
       
    54     private boolean missing;
       
    55 
       
    56     @ManyToOne(cascade = CascadeType.REMOVE)
       
    57     @JoinColumn(name = "COMPONENT_ID", referencedColumnName = "COMPONENT_ID")
       
    58     private Component component;
       
    59 
       
    60     /**
       
    61      * Helper function to set the identifier.
       
    62      * @param identifier to set the identifier for the component.
       
    63      */
       
    64     public void setId(int identifier) {
       
    65         id = identifier;
       
    66     }
       
    67 
       
    68     /**
       
    69      * Helper function to set the identifier.
       
    70      * @return the identifier of the component.
       
    71      */
       
    72     public int getId() {
       
    73         return id;
       
    74     }
       
    75 
       
    76     /**
       
    77      * Helper function to set component name.
       
    78      * @param cmp string to be set to.
       
    79      */
       
    80     public void setComponent(Component cmp) {
       
    81         component = cmp;
       
    82     }
       
    83 
       
    84     /**
       
    85      * Helper function to set log file associated
       
    86      * with this component.
       
    87      * @param file associated file to this component.
       
    88      */
       
    89     public void setMember(String mbr) {
       
    90         member = mbr;
       
    91     }
       
    92 
       
    93     /**
       
    94      * Helper function to return component string.
       
    95      * @return component name of this component.
       
    96      */
       
    97     public Component getComponent() {
       
    98         return component;
       
    99     }
       
   100 
       
   101     /**
       
   102      * Helper function to return log file associated with this component.
       
   103      * @return component name of this component.
       
   104      */
       
   105     public String getMember() {
       
   106         return member;
       
   107     }
       
   108 
       
   109     public void setMissing(boolean nonexistance) {
       
   110         missing = nonexistance;
       
   111     }
       
   112 
       
   113     public boolean getMissing() {
       
   114         return missing;
       
   115     }
       
   116 }