1 19 20 package org.apache.cayenne.map; 21 22 29 class ClientObjRelationship extends ObjRelationship { 30 31 String reverseRelationshipName; 32 33 boolean clientReadOnly; 36 boolean clientToMany; 37 38 ClientObjRelationship(String name, String reverseRelationshipName, boolean toMany, 39 boolean readOnly) { 40 41 super(name); 42 this.clientToMany = toMany; 43 this.clientReadOnly = readOnly; 44 this.reverseRelationshipName = reverseRelationshipName; 45 } 46 47 public boolean isToMany() { 48 return clientToMany; 49 } 50 51 public boolean isReadOnly() { 52 return clientReadOnly; 53 } 54 55 public String getReverseRelationshipName() { 56 return reverseRelationshipName; 57 } 58 59 public ObjRelationship getReverseRelationship() { 60 if (reverseRelationshipName == null) { 61 return null; 62 } 63 64 Entity target = getTargetEntity(); 65 if (target == null) { 66 return null; 67 } 68 69 return (ObjRelationship) target.getRelationship(reverseRelationshipName); 70 } 71 } 72 | Popular Tags |