Coverage Report - org.kuali.student.core.atp.entity.DateRange
 
Classes in this File Line Coverage Branch Coverage Complexity
DateRange
0%
0/25
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.AttributeOverride;
 22  
 import javax.persistence.AttributeOverrides;
 23  
 import javax.persistence.CascadeType;
 24  
 import javax.persistence.Column;
 25  
 import javax.persistence.Entity;
 26  
 import javax.persistence.JoinColumn;
 27  
 import javax.persistence.ManyToOne;
 28  
 import javax.persistence.NamedQueries;
 29  
 import javax.persistence.NamedQuery;
 30  
 import javax.persistence.OneToMany;
 31  
 import javax.persistence.Table;
 32  
 import javax.persistence.Temporal;
 33  
 import javax.persistence.TemporalType;
 34  
 
 35  
 import org.kuali.student.common.entity.AttributeOwner;
 36  
 import org.kuali.student.common.entity.MetaEntity;
 37  
 @Entity
 38  
 @Table(name = "KSAP_DT_RANGE")
 39  
 @NamedQueries({
 40  
         @NamedQuery(name="DateRange.findDateRangesByAtp", query="SELECT dateRange FROM DateRange dateRange WHERE dateRange.atp.id = :atpId"),
 41  
         @NamedQuery(name="DateRange.findDateRangesByDate", query="SELECT dateRange FROM DateRange dateRange WHERE dateRange.startDate <= :searchDate AND dateRange.endDate >= :searchDate")
 42  
 })
 43  
 @AttributeOverrides({
 44  
     @AttributeOverride(name="id", column=@Column(name="DATERANGE_KEY"))})
 45  0
 public class DateRange extends MetaEntity implements AttributeOwner<DateRangeAttribute> {
 46  
 
 47  
         @Column(name = "NAME")
 48  
         private String name;
 49  
 
 50  
         @ManyToOne(cascade=CascadeType.ALL)
 51  
         @JoinColumn(name = "RT_DESCR_ID")
 52  
         private AtpRichText descr;
 53  
 
 54  
         @ManyToOne
 55  
         @JoinColumn(name = "ATP_ID")
 56  
         private Atp atp;
 57  
 
 58  
         @Temporal(TemporalType.TIMESTAMP)
 59  
         @Column(name="START_DT")
 60  
         private Date startDate;
 61  
         
 62  
         @Temporal(TemporalType.TIMESTAMP)
 63  
         @Column(name="END_DT")
 64  
         private Date endDate;
 65  
         
 66  
         @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
 67  
         private List<DateRangeAttribute> attributes;
 68  
 
 69  
         @ManyToOne
 70  
         @JoinColumn(name = "DT_RANGE_TYPE_ID")
 71  
         private DateRangeType type;
 72  
 
 73  
         @Column(name="STATE")
 74  
         private String state;
 75  
         
 76  
         public String getName() {
 77  0
                 return name;
 78  
         }
 79  
 
 80  
         public void setName(String name) {
 81  0
                 this.name = name;
 82  0
         }
 83  
 
 84  
         public AtpRichText getDescr() {
 85  0
                 return descr;
 86  
         }
 87  
 
 88  
         public void setDescr(AtpRichText descr) {
 89  0
                 this.descr = descr;
 90  0
         }
 91  
 
 92  
         public Atp getAtp() {
 93  0
                 return atp;
 94  
         }
 95  
 
 96  
         public void setAtp(Atp atp) {
 97  0
                 this.atp = atp;
 98  0
         }
 99  
 
 100  
         public Date getStartDate() {
 101  0
                 return startDate;
 102  
         }
 103  
 
 104  
         public void setStartDate(Date startDate) {
 105  0
                 this.startDate = startDate;
 106  0
         }
 107  
 
 108  
         public Date getEndDate() {
 109  0
                 return endDate;
 110  
         }
 111  
 
 112  
         public void setEndDate(Date endDate) {
 113  0
                 this.endDate = endDate;
 114  0
         }
 115  
 
 116  
         public List<DateRangeAttribute> getAttributes() {
 117  0
                 return attributes;
 118  
         }
 119  
 
 120  
         public void setAttributes(List<DateRangeAttribute> attributes) {
 121  0
                 this.attributes = attributes;
 122  0
         }
 123  
 
 124  
         public DateRangeType getType() {
 125  0
                 return type;
 126  
         }
 127  
 
 128  
         public void setType(DateRangeType type) {
 129  0
                 this.type = type;
 130  0
         }
 131  
 
 132  
         public String getState() {
 133  0
                 return state;
 134  
         }
 135  
 
 136  
         public void setState(String state) {
 137  0
                 this.state = state;
 138  0
         }
 139  
 
 140  
 }