/**
* Copyright 2014 Comcast Cable Communications Management, LLC
*
* This file is part of CATS.
*
* CATS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CATS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CATS. If not, see <http://www.gnu.org/licenses/>.
*/
package com.comcast.cats.keymanager.entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* RemoteType generated by hbm2java. Added Named queries, additional
* constructors, getters and setters.
*
* @author thusai000
*
*/
@Entity
@Table(name = "remote_type", catalog = "keymanager")
@NamedQueries( { @NamedQuery(name = "RemoteType.FindByName", query = "SELECT rt FROM RemoteType rt "
+ "WHERE rt.remoteTypeName =:remoteType") })
public class RemoteType implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 5037634018639551420L;
private Integer remoteTypeId;
private String remoteTypeName;
private String remoteTypeDescription;
private Set<KeyCodes> keyCodes = new HashSet<KeyCodes>(0);
private Set<KeyLayout> keyLayouts = new HashSet<KeyLayout>(0);
/**
* Default constructor.
*/
public RemoteType() {
}
/**
* @param remoteTypeName
*/
public RemoteType(String remoteTypeName) {
this.remoteTypeName = remoteTypeName;
}
/**
* @param remoteTypeName
* @param remoteTypeDescription
*/
public RemoteType(String remoteTypeName, String remoteTypeDescription) {
this.remoteTypeName = remoteTypeName;
this.remoteTypeDescription = remoteTypeDescription;
}
/**
* @param remoteTypeId
* @param remoteTypeName
* @param remoteTypeDescription
*/
public RemoteType(Integer remoteTypeId, String remoteTypeName,
String remoteTypeDescription) {
this.remoteTypeId = remoteTypeId;
this.remoteTypeName = remoteTypeName;
this.remoteTypeDescription = remoteTypeDescription;
}
/**
* @param remoteTypeId
* @param remoteTypeName
* @param remoteTypeDescription
* @param keyCodes
* @param keyLayouts
*/
public RemoteType(Integer remoteTypeId, String remoteTypeName,
String remoteTypeDescription, Set<KeyCodes> keyCodes,
Set<KeyLayout> keyLayouts) {
this.remoteTypeId = remoteTypeId;
this.remoteTypeName = remoteTypeName;
this.remoteTypeDescription = remoteTypeDescription;
this.keyCodes = keyCodes;
this.keyLayouts = keyLayouts;
}
/**
* @return
*/
@Id
@GeneratedValue
@Column(name = "remote_type_id", unique = true, nullable = false)
public Integer getRemoteTypeId() {
return this.remoteTypeId;
}
/**
* @param remoteTypeId
*/
public void setRemoteTypeId(Integer remoteTypeId) {
this.remoteTypeId = remoteTypeId;
}
/**
* @return
*/
@Column(name = "remote_type_name", nullable = false, length = 45)
public String getRemoteTypeName() {
return this.remoteTypeName;
}
/**
* @param remoteTypeName
*/
public void setRemoteTypeName(String remoteTypeName) {
this.remoteTypeName = remoteTypeName;
}
/**
* @return
*/
@Column(name = "remote_type_description", length = 45)
public String getRemoteTypeDescription() {
return this.remoteTypeDescription;
}
/**
* @param remoteTypeDescription
*/
public void setRemoteTypeDescription(String remoteTypeDescription) {
this.remoteTypeDescription = remoteTypeDescription;
}
/**
* @return
*/
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "remoteType")
public Set<KeyCodes> getKeyCodes() {
return this.keyCodes;
}
/**
* @param keyCodes
*/
public void setKeyCodes(Set<KeyCodes> keyCodes) {
this.keyCodes = keyCodes;
}
/**
* @return
*/
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "remoteType")
public Set<KeyLayout> getKeyLayouts() {
return this.keyLayouts;
}
/**
* @param keyLayouts
*/
public void setKeyLayouts(Set<KeyLayout> keyLayouts) {
this.keyLayouts = keyLayouts;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return ("\n" + this.remoteTypeId + ": " + this.remoteTypeName);
}
}