1 19 package org.apache.cayenne.jpa.map; 20 21 import java.util.Collection ; 22 import java.util.LinkedHashSet ; 23 24 import javax.persistence.CascadeType; 25 26 public class JpaCascade { 27 28 protected Collection <CascadeType> cascades; 29 30 public Collection <CascadeType> getCascades() { 31 if (cascades == null) { 32 cascades = new LinkedHashSet <CascadeType>(5); 33 } 34 35 return cascades; 36 } 37 38 public void setCascadeAll(Object value) { 39 getCascades().add(CascadeType.ALL); 40 } 41 42 public void setCascadeMerge(Object value) { 43 getCascades().add(CascadeType.MERGE); 44 } 45 46 public void setCascadePersist(Object value) { 47 getCascades().add(CascadeType.PERSIST); 48 } 49 50 public void setCascadeRefresh(Object value) { 51 getCascades().add(CascadeType.REFRESH); 52 } 53 54 public void setCascadeRemove(Object value) { 55 getCascades().add(CascadeType.REMOVE); 56 } 57 } 58 | Popular Tags |