Coverage Report - org.kuali.student.core.atp.entity.Milestone
 
Classes in this File Line Coverage Branch Coverage Complexity
Milestone
100%
22/22
N/A
1
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.core.atp.entity;
 17  
 
 18  
 import java.util.Date;
 19  
 import java.util.List;
 20  
 
 21  
 import javax.persistence.CascadeType;
 22  
 import javax.persistence.Column;
 23  
 import javax.persistence.Entity;
 24  
 import javax.persistence.JoinColumn;
 25  
 import javax.persistence.ManyToOne;
 26  
 import javax.persistence.NamedQueries;
 27  
 import javax.persistence.NamedQuery;
 28  
 import javax.persistence.OneToMany;
 29  
 import javax.persistence.Table;
 30  
 import javax.persistence.Temporal;
 31  
 import javax.persistence.TemporalType;
 32  
 
 33  
 import org.kuali.student.common.entity.AttributeOwner;
 34  
 import org.kuali.student.common.entity.MetaEntity;
 35  
 @Entity
 36  
 @Table(name = "KSAP_MLSTN")
 37  
 @NamedQueries( { 
 38  
         @NamedQuery(name = "Milestone.findMilestonesByAtp", query = "SELECT milestone FROM Milestone milestone WHERE milestone.atp.id = :atpId"),
 39  
         @NamedQuery(name = "Milestone.findMilestonesByDates", query = "SELECT milestone FROM Milestone milestone WHERE milestone.milestoneDate >= :startDate AND milestone.milestoneDate <= :endDate"),
 40  
         @NamedQuery(name = "Milestone.findMilestonesByDatesAndType", query = "SELECT milestone FROM Milestone milestone WHERE milestone.type.id = :milestoneTypeId AND milestone.milestoneDate >= :startDate AND milestone.milestoneDate <= :endDate")
 41  
 })
 42  8
 public class Milestone extends MetaEntity implements
 43  
                 AttributeOwner<MilestoneAttribute> {
 44  
         
 45  
         @Column(name = "NAME")
 46  
         private String name;
 47  
         
 48  
         @ManyToOne(cascade=CascadeType.ALL)
 49  
         @JoinColumn(name = "RT_DESCR_ID")
 50  
         private AtpRichText descr;
 51  
 
 52  
         @ManyToOne
 53  
         @JoinColumn(name = "ATP_ID")
 54  
         private Atp atp;
 55  
         
 56  
         @Temporal(TemporalType.TIMESTAMP)
 57  
         @Column(name="MLSTN_DT")
 58  
         private Date milestoneDate;
 59  
         
 60  
         @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
 61  
         private List<MilestoneAttribute> attributes;
 62  
 
 63  
         @ManyToOne
 64  
         @JoinColumn(name = "MLSTN_TYPE_ID")
 65  
         private MilestoneType type;
 66  
         
 67  
         @Column(name="STATE")
 68  
         private String state;
 69  
         
 70  
         public String getName() {
 71  5
                 return name;
 72  
         }
 73  
 
 74  
         public void setName(String name) {
 75  3
                 this.name = name;
 76  3
         }
 77  
 
 78  
         public Atp getAtp() {
 79  5
                 return atp;
 80  
         }
 81  
 
 82  
         public void setAtp(Atp atp) {
 83  3
                 this.atp = atp;
 84  3
         }
 85  
 
 86  
         public Date getMilestoneDate() {
 87  5
                 return milestoneDate;
 88  
         }
 89  
 
 90  
         public void setMilestoneDate(Date milestoneDate) {
 91  3
                 this.milestoneDate = milestoneDate;
 92  3
         }
 93  
 
 94  
         public List<MilestoneAttribute> getAttributes() {
 95  11
                 return attributes;
 96  
         }
 97  
 
 98  
         public void setAttributes(List<MilestoneAttribute> attributes) {
 99  4
                 this.attributes = attributes;
 100  4
         }
 101  
 
 102  
         public MilestoneType getType() {
 103  5
                 return type;
 104  
         }
 105  
 
 106  
         public void setType(MilestoneType type) {
 107  3
                 this.type = type;
 108  3
         }
 109  
 
 110  
         public String getState() {
 111  5
                 return state;
 112  
         }
 113  
 
 114  
         public void setState(String state) {
 115  2
                 this.state = state;
 116  2
         }
 117  
 
 118  
         public void setDescr(AtpRichText descr) {
 119  3
                 this.descr = descr;
 120  3
         }
 121  
 
 122  
         public AtpRichText getDescr() {
 123  5
                 return descr;
 124  
         }
 125  
 
 126  
 }