| 1 | |
package org.kuali.student.r2.core.class1.state.model; |
| 2 | |
|
| 3 | |
import javax.persistence.Entity; |
| 4 | |
import javax.persistence.JoinColumn; |
| 5 | |
import javax.persistence.ManyToOne; |
| 6 | |
import javax.persistence.NamedQueries; |
| 7 | |
import javax.persistence.NamedQuery; |
| 8 | |
import javax.persistence.Table; |
| 9 | |
|
| 10 | |
import org.kuali.student.r2.common.entity.MetaEntity; |
| 11 | |
|
| 12 | |
@Entity |
| 13 | |
@Table(name = "KSEN_STATEPROCESS_RELTN") |
| 14 | |
@NamedQueries({@NamedQuery(name = "StateProcess.getInitialValidStates", query = "select spr.nextState from StateLifecycleRelationEntity spr where spr.priorState.id is null and spr.process.id=:processKey"), @NamedQuery(name = "StateProcess.getNextHappyState", query = "select spr.nextState from StateLifecycleRelationEntity spr where spr.priorState.id=:stateKey and spr.process.id=:processKey"), @NamedQuery(name = "StateProcess.getStateLifecycleRelationsByState", query = "select spr from StateLifecycleRelationEntity spr where spr.priorState.id=:stateKey or spr.nextState.id=:stateKey"), @NamedQuery(name = "StateProcess.getStateLifecycleRelationsByLifecycle", query = "select spr from StateLifecycleRelationEntity spr where spr.process.id=:lifecycleKey")}) |
| 15 | 0 | public class StateLifecycleRelationEntity extends MetaEntity { |
| 16 | |
@ManyToOne |
| 17 | |
@JoinColumn(name = "PROCESS_KEY") |
| 18 | |
private LifecycleEntity process; |
| 19 | |
|
| 20 | |
@ManyToOne |
| 21 | |
@JoinColumn(name = "PRIOR_STATEKEY") |
| 22 | |
private StateEntity priorState; |
| 23 | |
|
| 24 | |
@ManyToOne |
| 25 | |
@JoinColumn(name = "NEXT_STATEKEY") |
| 26 | |
private StateEntity nextState; |
| 27 | |
|
| 28 | |
public StateEntity getPriorState() { |
| 29 | 0 | return priorState; |
| 30 | |
} |
| 31 | |
|
| 32 | |
public void setPriorState(StateEntity priorState) { |
| 33 | 0 | this.priorState = priorState; |
| 34 | 0 | } |
| 35 | |
|
| 36 | |
public LifecycleEntity getProcess() { |
| 37 | 0 | return process; |
| 38 | |
} |
| 39 | |
|
| 40 | |
public void setProcess(LifecycleEntity process) { |
| 41 | 0 | this.process = process; |
| 42 | 0 | } |
| 43 | |
|
| 44 | |
public StateEntity getNextState() { |
| 45 | 0 | return nextState; |
| 46 | |
} |
| 47 | |
|
| 48 | |
public void setNextState(StateEntity nextState) { |
| 49 | 0 | this.nextState = nextState; |
| 50 | 0 | } |
| 51 | |
} |