org.hibernate.annotations.Cascade Java Examples

The following examples show how to use org.hibernate.annotations.Cascade. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TimingLocation.java    From pikatimer with GNU General Public License v3.0 5 votes vote down vote up
@OneToMany(mappedBy="timingLocation",fetch = FetchType.EAGER)
@Fetch(FetchMode.SELECT)
@Cascade(CascadeType.DELETE)
public List<TimingLocationInput> getInputs() {
    //return associatedSplits.sorted((Split o1, Split o2) -> o1.getPosition().compareTo(o2.getPosition()));
    return timingInputList;
}
 
Example #2
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #3
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #4
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@Column(name = "EXECUTER_INFORMATION_DATA", length = Integer.MAX_VALUE)
@Cascade(CascadeType.ALL)
@Type(type = "org.hibernate.type.SerializableToBlobType", parameters = @org.hibernate.annotations.Parameter(name = SerializableToBlobType.CLASS_NAME, value = "java.lang.Object"))
@OnDelete(action = OnDeleteAction.CASCADE)
public ExecuterInformationData getExecuterInformationData() {
    return executerInformationData;
}
 
Example #5
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@Cascade(CascadeType.ALL)
@OneToMany(fetch = FetchType.LAZY, mappedBy = "taskData")
@OnDelete(action = OnDeleteAction.CASCADE)
@OrderColumn(name = "SCRIPT_ORDER")
public List<SelectionScriptData> getSelectionScripts() {
    return selectionScripts;
}
 
Example #6
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@Cascade(CascadeType.ALL)
@OneToMany(fetch = FetchType.LAZY, mappedBy = "taskData")
@OnDelete(action = OnDeleteAction.CASCADE)
@OrderColumn(name = "DS_SELECTOR_ORDER")
public List<SelectorData> getDataspaceSelectors() {
    return dataspaceSelectors;
}
 
Example #7
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #8
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #9
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #10
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #11
Source File: HRPlanningDO.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Get the entries for this planned week.
 */
@OneToMany(cascade = { CascadeType.ALL}, fetch = FetchType.EAGER, orphanRemoval = true)
@JoinColumn(name = "planning_fk")
@Cascade(value = org.hibernate.annotations.CascadeType.SAVE_UPDATE)
public List<HRPlanningEntryDO> getEntries()
{
  return this.entries;
}
 
Example #12
Source File: AnnotationBinder.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private static String getCascadeStrategy(
		javax.persistence.CascadeType[] ejbCascades,
		Cascade hibernateCascadeAnnotation,
		boolean orphanRemoval,
		boolean forcePersist) {
	EnumSet<CascadeType> hibernateCascadeSet = convertToHibernateCascadeType( ejbCascades );
	CascadeType[] hibernateCascades = hibernateCascadeAnnotation == null ?
			null :
			hibernateCascadeAnnotation.value();

	if ( hibernateCascades != null && hibernateCascades.length > 0 ) {
		hibernateCascadeSet.addAll( Arrays.asList( hibernateCascades ) );
	}

	if ( orphanRemoval ) {
		hibernateCascadeSet.add( CascadeType.DELETE_ORPHAN );
		hibernateCascadeSet.add( CascadeType.REMOVE );
	}
	if ( forcePersist ) {
		hibernateCascadeSet.add( CascadeType.PERSIST );
	}

	StringBuilder cascade = new StringBuilder();
	for ( CascadeType aHibernateCascadeSet : hibernateCascadeSet ) {
		switch ( aHibernateCascadeSet ) {
			case ALL:
				cascade.append( "," ).append( "all" );
				break;
			case SAVE_UPDATE:
				cascade.append( "," ).append( "save-update" );
				break;
			case PERSIST:
				cascade.append( "," ).append( "persist" );
				break;
			case MERGE:
				cascade.append( "," ).append( "merge" );
				break;
			case LOCK:
				cascade.append( "," ).append( "lock" );
				break;
			case REFRESH:
				cascade.append( "," ).append( "refresh" );
				break;
			case REPLICATE:
				cascade.append( "," ).append( "replicate" );
				break;
			case EVICT:
			case DETACH:
				cascade.append( "," ).append( "evict" );
				break;
			case DELETE:
				cascade.append( "," ).append( "delete" );
				break;
			case DELETE_ORPHAN:
				cascade.append( "," ).append( "delete-orphan" );
				break;
			case REMOVE:
				cascade.append( "," ).append( "delete" );
				break;
		}
	}
	return cascade.length() > 0 ?
			cascade.substring( 1 ) :
			"none";
}
 
Example #13
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 4 votes vote down vote up
@Cascade(CascadeType.ALL)
@OneToMany(mappedBy = "taskData")
@OnDelete(action = OnDeleteAction.CASCADE)
public Set<EnvironmentModifierData> getEnvModifiers() {
    return envModifiers;
}
 
Example #14
Source File: TaskData.java    From scheduling with GNU Affero General Public License v3.0 4 votes vote down vote up
@Cascade(CascadeType.ALL)
@OneToMany(fetch = FetchType.LAZY, mappedBy = "taskData")
@OnDelete(action = OnDeleteAction.CASCADE)
public Map<String, TaskDataVariable> getVariables() {
    return variables;
}
 
Example #15
Source File: JobData.java    From scheduling with GNU Affero General Public License v3.0 4 votes vote down vote up
@Cascade(org.hibernate.annotations.CascadeType.ALL)
@OneToMany(fetch = FetchType.LAZY, mappedBy = "jobData")
@OnDelete(action = OnDeleteAction.CASCADE)
public Map<String, JobDataVariable> getVariables() {
    return variables;
}
 
Example #16
Source File: Event.java    From tutorials with MIT License 4 votes vote down vote up
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.DELETE })
public Set<String> getGuestList() {
    return guestList;
}