1 19 20 21 package org.apache.cayenne.jpa.conf; 22 23 import javax.persistence.Column; 24 import javax.persistence.JoinColumn; 25 import javax.persistence.Table; 26 27 import org.apache.cayenne.jpa.JpaProviderException; 28 29 34 @Table 35 abstract class AnnotationPrototypes { 36 37 static final Column column; 38 static final JoinColumn joinColumn; 39 static final Table table; 40 41 static { 42 43 table = AnnotationPrototypes.class.getAnnotation(Table.class); 44 45 try { 46 column = AnnotationPrototypes.class 47 .getDeclaredField("annotatedColumn") 48 .getAnnotation(Column.class); 49 50 joinColumn = AnnotationPrototypes.class.getDeclaredField( 51 "annotatedJoinColumn").getAnnotation(JoinColumn.class); 52 } 53 catch (NoSuchFieldException e) { 54 throw new JpaProviderException("No annotated field found", e); 55 } 56 } 57 58 @Column 59 Object annotatedColumn; 60 61 @JoinColumn 62 Object annotatedJoinColumn; 63 64 public static Column getColumn() { 65 return column; 66 } 67 68 public static JoinColumn getJoinColumn() { 69 return joinColumn; 70 } 71 72 public static Table getTable() { 73 return table; 74 } 75 } 76 | Popular Tags |