All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.tsl2.nano.cursus.persistence.ERuleEffectus Maven / Gradle / Ivy

The newest version!
package de.tsl2.nano.cursus.persistence;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

import de.tsl2.nano.bean.annotation.Attributes;
import de.tsl2.nano.bean.annotation.Presentable;
import de.tsl2.nano.bean.annotation.ValueExpression;
import de.tsl2.nano.cursus.effectus.RuleEffectus;
import de.tsl2.nano.service.util.IPersistable;

@Entity
@ValueExpression("{ruleName}: {res}")
@Attributes(names = { "ruleName", "res" })
@Presentable(label = "ΔRule-Effectus", icon = "icons/attach.png")
public class ERuleEffectus extends RuleEffectus implements IPersistable {
	private static final long serialVersionUID = 1L;

	String id;
	EExsecutio exsecutio;

	public ERuleEffectus() {
	}

	public ERuleEffectus(ERes res, boolean fixed, String ruleName) {
		super(res, fixed, ruleName);
	}

	@Id
	@GeneratedValue
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Override
	public boolean isFixed() {
		return super.isFixed();
	}

	public void setFixed(boolean fixed) {
		this.fixed = fixed;
	}

	@Override
	protected Object evaluateNewValue() {
		return getRuleName() != null ? super.evaluateNewValue() : null;
	}

	@OneToOne
	@JoinColumn
	public ERes getRes() {
		return (ERes) res;
	}

	public void setRes(ERes res) {
		this.res = res;
	}

	@ManyToOne
	@JoinColumn
	public EExsecutio getExsecutio() {
		return exsecutio;
	}

	public void setExsecutio(EExsecutio exsecutio) {
		this.exsecutio = exsecutio;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy