1 19 20 package org.apache.cayenne.jpa.map; 21 22 import javax.persistence.FetchType; 23 24 public abstract class JpaRelationship extends JpaAttribute { 25 26 protected String targetEntityName; 27 protected FetchType fetch; 28 protected JpaCascade cascade; 29 30 public abstract boolean isToMany(); 31 32 public FetchType getFetch() { 33 return fetch; 34 } 35 36 public void setFetch(FetchType fetch) { 37 this.fetch = fetch; 38 } 39 40 public String getTargetEntityName() { 41 return targetEntityName; 42 } 43 44 public void setTargetEntityName(String targetEntityName) { 45 this.targetEntityName = targetEntityName; 46 } 47 48 public JpaCascade getCascade() { 49 return cascade; 50 } 51 52 public void setCascade(JpaCascade cascades) { 53 this.cascade = cascades; 54 } 55 56 @Override 57 public String toString() { 58 String className = getClass().getName(); 59 return className.substring(className.lastIndexOf('.') + 1) + ":" + name; 60 } 61 } 62 | Popular Tags |