1 24 package org.riotfamily.revolt.definition; 25 26 import java.util.ArrayList ; 27 import java.util.Collection ; 28 29 33 public class Index extends Identifier { 34 35 private Collection columns; 36 37 private boolean unique; 38 39 public Index() { 40 } 41 42 public Index(String name) { 43 super(name); 44 } 45 46 public Index(String name, String [] columnNames, boolean unique) { 47 super(name); 48 this.unique = unique; 49 setColumnNames(columnNames); 50 } 51 52 public Collection getColumns() { 53 return this.columns; 54 } 55 56 public void setColumnNames(String [] names) { 57 columns = new ArrayList (); 58 for (int i = 0; i < names.length; i++) { 59 columns.add(new Identifier(names[i])); 60 } 61 } 62 63 public boolean isUnique() { 64 return this.unique; 65 } 66 67 public void setUnique(boolean unique) { 68 this.unique = unique; 69 } 70 71 } 72 | Popular Tags |