View Javadoc
1   /**
2    * Copyright 2005-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.labs;
17  
18  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
19  import org.kuali.rice.krad.bo.DataObjectBase;
20  import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
21  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
22  import org.kuali.rice.krad.data.provider.annotation.Description;
23  import org.kuali.rice.krad.data.provider.annotation.Label;
24  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType;
25  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews;
26  import org.kuali.rice.krad.data.provider.annotation.UifValidCharactersConstraintBeanName;
27  
28  import javax.persistence.Column;
29  import javax.persistence.Entity;
30  import javax.persistence.GeneratedValue;
31  import javax.persistence.Id;
32  import javax.persistence.Table;
33  import java.io.Serializable;
34  
35  /**
36   * Labs version of {@code TravelCompany} to show {@code allowsNewOrCopy} functionality.
37   *
38   * @author Kuali Rice Team (rice.collab@kuali.org)
39   */
40  @Entity
41  @Table(name = "TRVL_CO_T")
42  @UifAutoCreateViews({UifAutoCreateViewType.INQUIRY, UifAutoCreateViewType.LOOKUP})
43  public class LabsTravelCompany extends DataObjectBase implements MutableInactivatable, Serializable {
44  
45      @Id @Column(name = "CO_ID", length = 40)
46      @GeneratedValue(generator = "TRVL_CO_ID_S")
47      @PortableSequenceGenerator(name = "TRVL_CO_ID_S")
48      @Label("id")
49      @Description("Unique identifier for company")
50      @UifValidCharactersConstraintBeanName("AlphaNumericPatternConstraint")
51      private String travelCompanyId;
52  
53      @Column(name = "CO_NM", length = 40)
54      @Label("Company name")
55      @Description("Company Name")
56      private String travelCompanyName;
57  
58      @Column(name = "ACTV_IND", nullable = false, length = 1)
59      @javax.persistence.Convert(converter = BooleanYNConverter.class)
60      @Label("Active")
61      @Description("Whether active or inactive")
62      private boolean active = Boolean.TRUE;
63  
64      public String getTravelCompanyId() {
65          return travelCompanyId;
66      }
67  
68      public void setTravelCompanyId(String travelCompanyId) {
69          this.travelCompanyId = travelCompanyId;
70      }
71  
72      public String getTravelCompanyName() {
73          return travelCompanyName;
74      }
75  
76      public void setTravelCompanyName(String travelCompanyName) {
77          this.travelCompanyName = travelCompanyName;
78      }
79  
80      public boolean isActive() {
81          return active;
82      }
83  
84      public void setActive(boolean active) {
85          this.active = active;
86      }
87  }