1 19 20 21 package org.apache.cayenne.jpa.map; 22 23 import java.util.ArrayList ; 24 import java.util.Collection ; 25 26 import javax.persistence.UniqueConstraint; 27 28 public class JpaUniqueConstraint { 29 30 protected Collection <String > columnNames; 31 32 public JpaUniqueConstraint() { 33 34 } 35 36 public JpaUniqueConstraint(UniqueConstraint annotation) { 37 getColumnNames(); 39 40 for (int i = 0; i < annotation.columnNames().length; i++) { 41 columnNames.add(annotation.columnNames()[i]); 42 } 43 } 44 45 public Collection <String > getColumnNames() { 46 if (columnNames == null) { 47 columnNames = new ArrayList <String >(2); 48 } 49 return columnNames; 50 } 51 } 52 | Popular Tags |