1 package org.hibernate.mapping; 3 4 import org.hibernate.property.BackrefPropertyAccessor; 5 import org.hibernate.property.PropertyAccessor; 6 7 10 public class Backref extends Property { 11 private String collectionRole; 12 private String entityName; 13 14 public boolean isBackRef() { 15 return true; 16 } 17 public String getCollectionRole() { 18 return collectionRole; 19 } 20 public void setCollectionRole(String collectionRole) { 21 this.collectionRole = collectionRole; 22 } 23 24 public boolean isBasicPropertyAccessor() { 25 return false; 26 } 27 28 public PropertyAccessor getPropertyAccessor(Class clazz) { 29 return new BackrefPropertyAccessor(collectionRole, entityName); 30 } 31 32 public String getEntityName() { 33 return entityName; 34 } 35 public void setEntityName(String entityName) { 36 this.entityName = entityName; 37 } 38 } 39 | Popular Tags |