/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ec.gob.mcds.seguridades.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
*
* @author christian
*/
@Entity
@Table(name = "sch_seguridades.rol_menu")
@NamedQueries({
@NamedQuery(name = "RolMenu.findAll", query = "SELECT r FROM RolMenu r")})
public class RolMenu implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "rol_men_id", nullable = false)
private Long rolMenId;
@JoinColumn(name = "rol_id", referencedColumnName = "rol_id", nullable = false)
@ManyToOne(optional = false, fetch = FetchType.LAZY)
private Rol rol;
@JoinColumn(name = "men_id", referencedColumnName = "men_id", nullable = false)
@ManyToOne(optional = false, fetch = FetchType.LAZY)
private Menu menu;
public RolMenu() {
}
public RolMenu(Long rolMenId) {
this.rolMenId = rolMenId;
}
public Long getRolMenId() {
return rolMenId;
}
public void setRolMenId(Long rolMenId) {
this.rolMenId = rolMenId;
}
public Rol getRol() {
return rol;
}
public void setRol(Rol rol) {
this.rol = rol;
}
public Menu getMenu() {
return menu;
}
public void setMenu(Menu menu) {
this.menu = menu;
}
@Override
public int hashCode() {
int hash = 0;
hash += (rolMenId != null ? rolMenId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof RolMenu)) {
return false;
}
RolMenu other = (RolMenu) object;
if ((this.rolMenId == null && other.rolMenId != null) || (this.rolMenId != null && !this.rolMenId.equals(other.rolMenId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "ec.gob.mcds.model.RolMenu[rolMenId=" + rolMenId + "]";
}
}