1 19 package org.apache.cayenne.jpa.map; 20 21 import java.util.ArrayList ; 22 import java.util.Collection ; 23 24 import javax.persistence.AssociationOverride; 25 26 public class JpaAssociationOverride { 27 28 protected String name; 29 protected Collection <JpaJoinColumn> joinColumns; 30 31 public JpaAssociationOverride() { 32 33 } 34 35 public JpaAssociationOverride(AssociationOverride annotation) { 36 this.name = annotation.name(); 37 if (annotation.joinColumns() != null) { 38 39 for (int i = 0; i < annotation.joinColumns().length; i++) { 40 getJoinColumns().add(new JpaJoinColumn(annotation.joinColumns()[i])); 41 } 42 } 43 } 44 45 public Collection <JpaJoinColumn> getJoinColumns() { 46 if (joinColumns == null) { 47 joinColumns = new ArrayList <JpaJoinColumn>(); 48 } 49 return joinColumns; 50 } 51 52 public String getName() { 53 return name; 54 } 55 56 public void setName(String name) { 57 this.name = name; 58 } 59 } 60 | Popular Tags |