/* * Transition1.java * * Created on 03 October 2006, 09:07 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package uk.ac.lancs.illos.ejb.play; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; /** * * @author hearnc */ @Entity @NamedQuery(name = "Transition1.findByStateEventFromUser", query = "SELECT distinct t.event FROM Transition t WHERE t.role "+ " = ANY (SELECT u.roles FROM User1 u WHERE u.userName = :uName) AND t.fromState.id = :state") public class Transition1 implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @ManyToOne private Role1 role; @ManyToOne private Event1 event; @ManyToOne private State1 fromState; @ManyToOne private State1 nextState; /** Creates a new instance of Transition1 */ public Transition1() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public int hashCode() { int hash = 0; hash += (this.id != null ? this.id.hashCode() : 0); return hash; } public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Transition1)) { return false; } Transition1 other = (Transition1)object; if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false; return true; } public String toString() { return "uk.ac.lancs.illos.ejb.play.Transition1[id=" + id + "]"; } public void setRole(Role1 role) { this.role = role; } public Role1 getRole() { return role; } }