1 package org.hibernate.cfg; 2 3 import java.util.Map ; 4 5 import org.hibernate.mapping.Join; 6 7 12 public class IndexColumn 13 extends Ejb3Column { 14 15 private int base; 16 17 public IndexColumn(boolean isImplicit, 19 String sqlType, 20 int length, 21 int precision, 22 int scale, 23 String name, 24 boolean nullable, 25 boolean unique, 26 boolean insertable, 27 boolean updatable, 28 String secondaryTableName, 29 Map <String , Join> joins, 30 PropertyHolder propertyHolder, 31 Mappings mappings) { 32 super(); 33 setImplicit(isImplicit); 34 setSqlType(sqlType); 35 setLength( length ); 36 setPrecision( precision ); 37 setScale( scale ); 38 setColumnName(name); 39 setNullable( nullable ); 40 setUnique( unique ); 41 setInsertable( insertable ); 42 setUpdatable( updatable ); 43 setSecondaryTableName( secondaryTableName ); 44 setPropertyHolder(propertyHolder); 45 setJoins(joins); 46 setMappings(mappings); 47 bind(); 48 50 } 51 52 public int getBase() { 53 return base; 54 } 55 56 public void setBase(int base) { 57 this.base = base; 58 } 59 60 public static IndexColumn buildColumnFromAnnotation(org.hibernate.annotations.IndexColumn ann, 61 PropertyHolder propertyHolder, 62 PropertyInferredData inferredData, 63 ExtendedMappings mappings) { 64 IndexColumn column; 65 if (ann != null) { 66 String sqlType = AnnotationBinder.isDefault( ann.columnDefinition() ) ? null : ann.columnDefinition(); 67 String name = AnnotationBinder.isDefault( ann.name() ) ? inferredData.getPropertyName() : ann.name(); 68 column = new IndexColumn(false, sqlType, 0, 0, 0, name, ann.nullable(), 69 false, true, true, null, null, propertyHolder, mappings); 70 column.setBase( ann.base() ); 71 } 72 else { 73 column = new IndexColumn(true, null, 0, 0, 0, null, true, 74 false, true, true, null, null, propertyHolder, mappings); 75 } 76 return column; 77 } 78 } 79
| Popular Tags
|