org.hibernate.annotations.CascadeType Java Examples
The following examples show how to use
org.hibernate.annotations.CascadeType.
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: AnnotationBinder.java From lams with GNU General Public License v2.0 | 5 votes |
private static EnumSet<CascadeType> convertToHibernateCascadeType(javax.persistence.CascadeType[] ejbCascades) { EnumSet<CascadeType> hibernateCascadeSet = EnumSet.noneOf( CascadeType.class ); if ( ejbCascades != null && ejbCascades.length > 0 ) { for ( javax.persistence.CascadeType cascade : ejbCascades ) { switch ( cascade ) { case ALL: hibernateCascadeSet.add( CascadeType.ALL ); break; case PERSIST: hibernateCascadeSet.add( CascadeType.PERSIST ); break; case MERGE: hibernateCascadeSet.add( CascadeType.MERGE ); break; case REMOVE: hibernateCascadeSet.add( CascadeType.REMOVE ); break; case REFRESH: hibernateCascadeSet.add( CascadeType.REFRESH ); break; case DETACH: hibernateCascadeSet.add( CascadeType.DETACH ); break; } } } return hibernateCascadeSet; }
Example #2
Source File: TimingLocation.java From pikatimer with GNU General Public License v3.0 | 5 votes |
@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 #3
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@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 #4
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@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 #5
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@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 #6
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@Cascade(CascadeType.ALL) @OneToMany(fetch = FetchType.LAZY, mappedBy = "taskData") @OnDelete(action = OnDeleteAction.CASCADE) @OrderColumn(name = "SCRIPT_ORDER") public List<SelectionScriptData> getSelectionScripts() { return selectionScripts; }
Example #7
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@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 #8
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@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 #9
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@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 #10
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@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 #11
Source File: TaskData.java From scheduling with GNU Affero General Public License v3.0 | 5 votes |
@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 #12
Source File: AnnotationBinder.java From lams with GNU General Public License v2.0 | 4 votes |
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 |
@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 |
@Cascade(CascadeType.ALL) @OneToMany(fetch = FetchType.LAZY, mappedBy = "taskData") @OnDelete(action = OnDeleteAction.CASCADE) public Map<String, TaskDataVariable> getVariables() { return variables; }
Example #15
Source File: Event.java From tutorials with MIT License | 4 votes |
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.DELETE }) public Set<String> getGuestList() { return guestList; }