private ReferentialAction mapConstraint(ConstraintMode constraint) { switch (constraint) { case NO_CONSTRAINT: return ReferentialAction.NO_ACTION; default: case CONSTRAINT: case PROVIDER_DEFAULT: return ReferentialAction.CASCADE; } }
@Cascade(org.hibernate.annotations.CascadeType.ALL) @OneToOne(fetch = FetchType.LAZY) // disable foreign key, to be able to remove runtime data @JoinColumn(name = "ENV_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) public ScriptData getEnvScript() { return envScript; }
@Cascade(org.hibernate.annotations.CascadeType.ALL) @OneToOne(fetch = FetchType.LAZY) // disable foreign key, to be able to remove runtime data @JoinColumn(name = "SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) public ScriptData getScript() { return script; }
@Cascade(CascadeType.ALL) @OneToOne(fetch = FetchType.LAZY) // disable foreign key, to be able to remove runtime data @JoinColumn(name = "PRE_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) public ScriptData getPreScript() { return preScript; }
@Cascade(CascadeType.ALL) @OneToOne(fetch = FetchType.LAZY) // disable foreign key, to be able to remove runtime data @JoinColumn(name = "POST_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) public ScriptData getPostScript() { return postScript; }
@Cascade(CascadeType.ALL) @OneToOne(fetch = FetchType.LAZY) // disable foreign key, to be able to remove runtime data @JoinColumn(name = "CLEAN_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) public ScriptData getCleanScript() { return cleanScript; }
@Cascade(CascadeType.ALL) @OneToOne(fetch = FetchType.LAZY) // disable foreign key, to be able to remove runtime data @JoinColumn(name = "FLOW_SCRIPT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) public ScriptData getFlowScript() { return flowScript; }
@ManyToOne(fetch = FetchType.LAZY, optional = true) @JoinColumn(name = "approval" , nullable = true, foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT)) public Approvals getApprovals() { return this.approvals; }
@Override public ConstraintMode value() { return ConstraintMode.CONSTRAINT; }