19 package testsuite.clusterj;
21 import java.math.BigDecimal;
22 import java.math.BigInteger;
23 import java.sql.PreparedStatement;
24 import java.sql.ResultSet;
25 import java.sql.SQLException;
27 import testsuite.clusterj.model.BigIntegerTypes;
28 import testsuite.clusterj.model.IdBase;
62 static int NUMBER_OF_INSTANCES = 10;
71 return NUMBER_OF_INSTANCES;
76 return "bigintegertypes";
81 Class<? extends IdBase> getModelClass() {
88 return BigInteger.valueOf(100000 * i + j);
91 static ColumnDescriptor decimal_null_hash =
new ColumnDescriptor
92 (
"decimal_null_hash",
new InstanceHandler() {
93 public void setFieldValue(
IdBase instance, Object value) {
96 public Object getFieldValue(IdBase instance) {
97 return ((BigIntegerTypes)instance).getDecimal_null_hash();
99 public void setPreparedStatementValue(PreparedStatement preparedStatement,
int j, Object value)
100 throws SQLException {
101 preparedStatement.setBigDecimal(j,
new BigDecimal((BigInteger)value));
103 public Object getResultSetValue(ResultSet rs,
int j)
throws SQLException {
104 return rs.getBigDecimal(j).toBigIntegerExact();
108 static ColumnDescriptor decimal_null_btree =
new ColumnDescriptor
109 (
"decimal_null_btree",
new InstanceHandler() {
110 public void setFieldValue(IdBase instance, Object value) {
111 ((BigIntegerTypes)instance).setDecimal_null_btree((BigInteger)value);
113 public Object getFieldValue(IdBase instance) {
114 return ((BigIntegerTypes)instance).getDecimal_null_btree();
116 public void setPreparedStatementValue(PreparedStatement preparedStatement,
int j, Object value)
117 throws SQLException {
118 preparedStatement.setBigDecimal(j,
new BigDecimal((BigInteger)value));
120 public Object getResultSetValue(ResultSet rs,
int j)
throws SQLException {
121 return rs.getBigDecimal(j).toBigIntegerExact();
124 static ColumnDescriptor decimal_null_both =
new ColumnDescriptor
125 (
"decimal_null_both",
new InstanceHandler() {
126 public void setFieldValue(IdBase instance, Object value) {
127 ((BigIntegerTypes)instance).setDecimal_null_both((BigInteger)value);
129 public BigInteger getFieldValue(IdBase instance) {
130 return ((BigIntegerTypes)instance).getDecimal_null_both();
132 public void setPreparedStatementValue(PreparedStatement preparedStatement,
int j, Object value)
133 throws SQLException {
134 preparedStatement.setBigDecimal(j,
new BigDecimal((BigInteger)value));
136 public Object getResultSetValue(ResultSet rs,
int j)
throws SQLException {
137 return rs.getBigDecimal(j).toBigIntegerExact();
140 static ColumnDescriptor decimal_null_none =
new ColumnDescriptor
141 (
"decimal_null_none",
new InstanceHandler() {
142 public void setFieldValue(IdBase instance, Object value) {
143 ((BigIntegerTypes)instance).setDecimal_null_none((BigInteger)value);
145 public BigInteger getFieldValue(IdBase instance) {
146 return ((BigIntegerTypes)instance).getDecimal_null_none();
148 public void setPreparedStatementValue(PreparedStatement preparedStatement,
int j, Object value)
149 throws SQLException {
150 preparedStatement.setBigDecimal(j,
new BigDecimal((BigInteger)value));
152 public Object getResultSetValue(ResultSet rs,
int j)
throws SQLException {
153 return rs.getBigDecimal(j).toBigIntegerExact();
157 protected static ColumnDescriptor[] columnDescriptors =
new ColumnDescriptor[] {
166 return columnDescriptors;