View Javadoc

1   /**
2    * Copyright 2011-2013 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.mobility.admin.entity;
17  
18  import java.io.Serializable;
19  import java.util.ArrayList;
20  import java.util.Arrays;
21  import java.util.List;
22  
23  import javax.persistence.CascadeType;
24  import javax.persistence.Column;
25  import javax.persistence.Entity;
26  import javax.persistence.FetchType;
27  import javax.persistence.GeneratedValue;
28  import javax.persistence.GenerationType;
29  import javax.persistence.Id;
30  import javax.persistence.OneToMany;
31  import javax.persistence.Table;
32  import javax.persistence.Version;
33  import javax.xml.bind.annotation.XmlRootElement;
34  
35  /**
36   * Defines a home screen with a collection of tools
37   * @author Kuali Mobility Team (moblitiy.collab@kuali.org)
38   */
39  @Entity
40  @Table(name="KME_HM_SCRN_T")
41  @XmlRootElement(name="homeScreen")
42  public class HomeScreen implements Serializable {
43  
44  	private static final long serialVersionUID = 4947101996672004361L;
45  
46  	@Id
47  	@GeneratedValue(strategy = GenerationType.TABLE)
48      @Column(name="ID")
49      private Long homeScreenId;
50  
51  	@Column(name="ALIAS")
52  	private String alias;
53  
54  	@Column(name="TTL")
55  	private String title;
56  
57      @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy="homeScreen")
58      private List<HomeTool> homeTools;
59  
60  	@Version
61      @Column(name="VER_NBR")
62      private Long versionNumber;
63  
64  	public HomeScreen() {
65  		homeTools = new ArrayList<HomeTool>();
66  	}
67  
68  	/**
69  	 * @return the HomeTool objects associated with this HomeScreen
70  	 */
71  	public List<HomeTool> getHomeTools() {
72  		return homeTools;
73  	}
74  
75  	/**
76  	 * set the HomeTool objects
77  	 * @param homeTools
78  	 */
79  	public void setHomeTools(List<HomeTool> homeTools) {
80  		this.homeTools = homeTools;
81  	}
82  
83  	/**
84  	 * set the HomeTools collection with an array
85  	 * @param homeTools
86  	 */
87  	public void setHomeTools(HomeTool[] homeTools) {
88  		this.homeTools = Arrays.asList(homeTools);
89  	}
90  
91  	public Long getHomeScreenId() {
92  		return homeScreenId;
93  	}
94  
95  	public void setHomeScreenId(Long homeScreenId) {
96  		this.homeScreenId = homeScreenId;
97  	}
98  
99  	public String getAlias() {
100 		return alias;
101 	}
102 
103 	public void setAlias(String alias) {
104 		this.alias = alias;
105 	}
106 
107 	public String getTitle() {
108 		return title;
109 	}
110 
111 	public void setTitle(String title) {
112 		this.title = title;
113 	}
114 
115 	public Long getVersionNumber() {
116 		return versionNumber;
117 	}
118 
119 	public void setVersionNumber(Long versionNumber) {
120 		this.versionNumber = versionNumber;
121 	}
122 
123 }