001/** 002 * Copyright 2011-2012 The Kuali Foundation Licensed under the 003 * Educational Community License, Version 2.0 (the "License"); you may 004 * not use this file except in compliance with the License. You may 005 * obtain a copy of the License at 006 * 007 * http://www.osedu.org/licenses/ECL-2.0 008 * 009 * Unless required by applicable law or agreed to in writing, 010 * software distributed under the License is distributed on an "AS IS" 011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 012 * or implied. See the License for the specific language governing 013 * permissions and limitations under the License. 014 */ 015 016package org.kuali.mobility.reporting.entity; 017 018import java.io.Serializable; 019import java.sql.Timestamp; 020import java.util.ArrayList; 021import java.util.List; 022 023import javax.persistence.CascadeType; 024import javax.persistence.Column; 025import javax.persistence.Entity; 026import javax.persistence.FetchType; 027import javax.persistence.GeneratedValue; 028import javax.persistence.GenerationType; 029import javax.persistence.Id; 030import javax.persistence.OneToMany; 031import javax.persistence.Table; 032import javax.persistence.Version; 033import javax.xml.bind.annotation.XmlElement; 034import javax.xml.bind.annotation.XmlRootElement; 035 036@XmlRootElement(name = "submission") 037@Entity 038@Table(name="KME_SUBMISSION_T") 039public class Submission implements Serializable { 040 041 private static final long serialVersionUID = 3936544145647062912L; 042 043 @Id 044 @GeneratedValue(strategy = GenerationType.TABLE) 045 @Column(name="ID", nullable=false, updatable=false) 046 private Long id; 047 048 @Column(name="PRNT_ID") 049 private Long parentId; 050 051 @Column(name="REV_NBR") 052 private Long revisionNumber; 053 054 @Column(name="REV_USR_ID") 055 private String revisionUserId; 056 057 @Column(name="NM") 058 private String name; 059 060 @Column(name="TYP") 061 private String type; 062 063 @Column(name="GRP") 064 private String group; 065 066 @Column(name="ACTV") 067 private int active; 068 069 @Column(name="PST_DT") 070 private Timestamp postDate; 071 072 @Column(name="ARCHVD_DT") 073 private Timestamp archivedDate; 074 075 @Column(name="IP_ADDR") 076 private String ipAddress; 077 078 @Column(name="USR_AGNT") 079 private String userAgent; 080 081 @Column(name="USR_ID") 082 private String userId; 083 084 @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy="submission") 085 private List<SubmissionAttribute> attributes; 086 087 @Version 088 @Column(name="VER_NBR") 089 protected Long versionNumber; 090 091 public Long getId() { 092 return id; 093 } 094 095 public void setId(Long id) { 096 this.id = id; 097 } 098 099 public Long getParentId() { 100 return parentId; 101 } 102 103 public void setParentId(Long parentId) { 104 this.parentId = parentId; 105 } 106 107 public Long getRevisionNumber() { 108 return revisionNumber; 109 } 110 111 public void setRevisionNumber(Long revisionNumber) { 112 this.revisionNumber = revisionNumber; 113 } 114 115 public String getRevisionUserId() { 116 return revisionUserId; 117 } 118 119 public void setRevisionUserId(String revisionUserId) { 120 this.revisionUserId = revisionUserId; 121 } 122 123 public String getName() { 124 return name; 125 } 126 127 public void setName(String name) { 128 this.name = name; 129 } 130 131 public String getType() { 132 return type; 133 } 134 135 public void setType(String type) { 136 this.type = type; 137 } 138 139 public String getGroup() { 140 return group; 141 } 142 143 public void setGroup(String group) { 144 this.group = group; 145 } 146 147 public int getActive() { 148 return active; 149 } 150 151 public void setActive(int active) { 152 this.active = active; 153 } 154 155 public Timestamp getPostDate() { 156 return postDate; 157 } 158 159 public void setPostDate(Timestamp postDate) { 160 this.postDate = postDate; 161 } 162 163 public Timestamp getArchivedDate() { 164 return archivedDate; 165 } 166 167 public void setArchivedDate(Timestamp archivedDate) { 168 this.archivedDate = archivedDate; 169 } 170 171 public String getIpAddress() { 172 return ipAddress; 173 } 174 175 public void setIpAddress(String ipAddress) { 176 this.ipAddress = ipAddress; 177 } 178 179 public String getUserAgent() { 180 return userAgent; 181 } 182 183 public void setUserAgent(String userAgent) { 184 this.userAgent = userAgent; 185 } 186 187 public String getUserId() { 188 return userId; 189 } 190 191 public void setUserId(String userId) { 192 this.userId = userId; 193 } 194 195 public Long getVersionNumber() { 196 return versionNumber; 197 } 198 199 public void setVersionNumber(Long versionNumber) { 200 this.versionNumber = versionNumber; 201 } 202 203 @XmlElement(name = "attributes") 204 public List<SubmissionAttribute> getAttributes() { 205 return attributes; 206 } 207 208 public void setAttributes(List<SubmissionAttribute> attributes) { 209 this.attributes = attributes; 210 } 211 212}