1 28 29 package com.caucho.amber.field; 30 31 import com.caucho.amber.table.LinkColumns; 32 import com.caucho.amber.type.RelatedType; 33 import com.caucho.config.ConfigException; 34 import com.caucho.log.Log; 35 import com.caucho.util.L10N; 36 37 import javax.persistence.CascadeType; 38 import java.util.logging.Logger ; 39 40 41 44 public class AssociationField extends CollectionField { 45 private static final L10N L = new L10N(AssociationField.class); 46 protected static final Logger log = Log.open(AssociationField.class); 47 48 private LinkColumns _linkColumns; 49 50 private boolean _hasJoinColumns; 51 52 private boolean _hasInverseJoinColumns; 53 54 public AssociationField(RelatedType relatedType, 55 String name, 56 CascadeType[] cascadeTypes) 57 throws ConfigException 58 { 59 super(relatedType, name, cascadeTypes); 60 } 61 62 public AssociationField(RelatedType relatedType) 63 { 64 super(relatedType); 65 } 66 67 71 public boolean hasJoinColumns() 72 { 73 return _hasJoinColumns; 74 } 75 76 80 public void setJoinColumns(boolean hasJoinColumns) 81 { 82 _hasJoinColumns = hasJoinColumns; 83 } 84 85 89 public boolean hasInverseJoinColumns() 90 { 91 return _hasInverseJoinColumns; 92 } 93 94 98 public void setInverseJoinColumns(boolean hasInverseJoinColumns) 99 { 100 _hasInverseJoinColumns = hasInverseJoinColumns; 101 } 102 105 public void setColumn(LinkColumns columns) 106 { 107 _linkColumns = columns; 108 } 109 110 113 public LinkColumns getColumn() 114 { 115 return _linkColumns; 116 } 117 118 121 public String generateTargetSelect(String id) 122 { 123 return getColumn().generateSelectSQL(id); 124 } 125 } 126 | Popular Tags |