001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.labs;
017
018import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
019import org.kuali.rice.krad.bo.DataObjectBase;
020import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
021import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
022import org.kuali.rice.krad.data.provider.annotation.Description;
023import org.kuali.rice.krad.data.provider.annotation.Label;
024import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType;
025import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews;
026import org.kuali.rice.krad.data.provider.annotation.UifValidCharactersConstraintBeanName;
027
028import javax.persistence.Column;
029import javax.persistence.Entity;
030import javax.persistence.GeneratedValue;
031import javax.persistence.Id;
032import javax.persistence.Table;
033import java.io.Serializable;
034
035/**
036 * Labs version of {@code TravelCompany} to show {@code allowsNewOrCopy} functionality.
037 *
038 * @author Kuali Rice Team (rice.collab@kuali.org)
039 */
040@Entity
041@Table(name = "TRVL_CO_T")
042@UifAutoCreateViews({UifAutoCreateViewType.INQUIRY, UifAutoCreateViewType.LOOKUP})
043public class LabsTravelCompany extends DataObjectBase implements MutableInactivatable, Serializable {
044
045    @Id @Column(name = "CO_ID", length = 40)
046    @GeneratedValue(generator = "TRVL_CO_ID_S")
047    @PortableSequenceGenerator(name = "TRVL_CO_ID_S")
048    @Label("id")
049    @Description("Unique identifier for company")
050    @UifValidCharactersConstraintBeanName("AlphaNumericPatternConstraint")
051    private String travelCompanyId;
052
053    @Column(name = "CO_NM", length = 40)
054    @Label("Company name")
055    @Description("Company Name")
056    private String travelCompanyName;
057
058    @Column(name = "ACTV_IND", nullable = false, length = 1)
059    @javax.persistence.Convert(converter = BooleanYNConverter.class)
060    @Label("Active")
061    @Description("Whether active or inactive")
062    private boolean active = Boolean.TRUE;
063
064    public String getTravelCompanyId() {
065        return travelCompanyId;
066    }
067
068    public void setTravelCompanyId(String travelCompanyId) {
069        this.travelCompanyId = travelCompanyId;
070    }
071
072    public String getTravelCompanyName() {
073        return travelCompanyName;
074    }
075
076    public void setTravelCompanyName(String travelCompanyName) {
077        this.travelCompanyName = travelCompanyName;
078    }
079
080    public boolean isActive() {
081        return active;
082    }
083
084    public void setActive(boolean active) {
085        this.active = active;
086    }
087}