1 23 24 30 31 package com.sun.jdo.spi.persistence.support.sqlstore.sql.generator; 32 33 import org.netbeans.modules.dbschema.ColumnElement; 34 import com.sun.jdo.api.persistence.support.FieldMapping; 35 36 38 public class ColumnRef extends Object implements FieldMapping { 39 private ColumnElement columnElement; 43 44 private QueryTable table; 48 49 private Object value; 55 56 private int index; 60 61 private String name; 65 66 public ColumnRef(ColumnElement columnElement, 67 QueryTable table) { 68 this.columnElement = columnElement; 69 name = columnElement.getName().getName(); 70 this.table = table; 71 } 72 73 public ColumnRef(ColumnElement columnElement, 74 Object value) { 75 this.columnElement = columnElement; 76 name = columnElement.getName().getName(); 77 this.value = value; 78 } 79 80 83 public ColumnElement getColumnElement() { 84 return columnElement; 85 } 86 87 90 public int getIndex() { 91 return index; 92 } 93 94 97 public void setIndex(int value) { 98 this.index = value; 99 } 100 101 104 public Object getValue() { 105 return value; 106 } 107 108 111 public QueryTable getQueryTable() { 112 return table; 113 } 114 115 118 public String getName() { 119 return name; 120 } 121 122 126 public int getColumnType() { 127 return columnElement.getType(); 128 } 129 130 133 public String getColumnName() { 134 return name; 135 } 136 137 140 public int getColumnLength() { 141 Integer len = columnElement.getLength(); 142 return (len != null) ? len.intValue(): -1; 143 } 144 145 } 147 | Popular Tags |