18 package testsuite.clusterj;
20 import java.sql.PreparedStatement;
21 import java.sql.ResultSet;
22 import java.sql.SQLException;
23 import java.sql.Timestamp;
25 import org.junit.Ignore;
27 import testsuite.clusterj.model.IdBase;
28 import testsuite.clusterj.model.TimestampAsSqlTimestampTypes;
60 setAutoCommit(connection,
false);
63 static int NUMBER_OF_INSTANCES = 10;
72 return NUMBER_OF_INSTANCES;
77 return "timestamptypes";
82 Class<? extends IdBase> getModelClass() {
92 public void testWriteJDBCReadNDB() {
97 public void testWriteNDBReadJDBC() {
102 public void testWriteJDBCReadJDBC() {
107 public void testWriteNDBReadNDB() {
112 static ColumnDescriptor not_null_hash =
new ColumnDescriptor
113 (
"timestamp_not_null_hash",
new InstanceHandler() {
114 public void setFieldValue(IdBase instance, Object value) {
115 ((TimestampAsSqlTimestampTypes)instance).setTimestamp_not_null_hash((Timestamp)value);
117 public Object getFieldValue(IdBase instance) {
118 return ((TimestampAsSqlTimestampTypes)instance).getTimestamp_not_null_hash();
120 public void setPreparedStatementValue(PreparedStatement preparedStatement,
int j, Object value)
121 throws SQLException {
122 preparedStatement.setTimestamp(j, (Timestamp)value);
124 public Object getResultSetValue(ResultSet rs,
int j)
throws SQLException {
125 return rs.getTimestamp(j);
129 static ColumnDescriptor not_null_btree =
new ColumnDescriptor
130 (
"timestamp_not_null_btree",
new InstanceHandler() {
131 public void setFieldValue(IdBase instance, Object value) {
132 ((TimestampAsSqlTimestampTypes)instance).setTimestamp_not_null_btree((Timestamp)value);
134 public Object getFieldValue(IdBase instance) {
135 return ((TimestampAsSqlTimestampTypes)instance).getTimestamp_not_null_btree();
137 public void setPreparedStatementValue(PreparedStatement preparedStatement,
int j, Object value)
138 throws SQLException {
139 preparedStatement.setTimestamp(j, (Timestamp)value);
141 public Object getResultSetValue(ResultSet rs,
int j)
throws SQLException {
142 return rs.getTimestamp(j);
145 static ColumnDescriptor not_null_both =
new ColumnDescriptor
146 (
"timestamp_not_null_both",
new InstanceHandler() {
147 public void setFieldValue(IdBase instance, Object value) {
148 ((TimestampAsSqlTimestampTypes)instance).setTimestamp_not_null_both((Timestamp)value);
150 public Timestamp getFieldValue(IdBase instance) {
151 return ((TimestampAsSqlTimestampTypes)instance).getTimestamp_not_null_both();
153 public void setPreparedStatementValue(PreparedStatement preparedStatement,
int j, Object value)
154 throws SQLException {
155 preparedStatement.setTimestamp(j, (Timestamp)value);
157 public Object getResultSetValue(ResultSet rs,
int j)
throws SQLException {
158 return rs.getTimestamp(j);
161 static ColumnDescriptor not_null_none =
new ColumnDescriptor
162 (
"timestamp_not_null_none",
new InstanceHandler() {
163 public void setFieldValue(IdBase instance, Object value) {
164 ((TimestampAsSqlTimestampTypes)instance).setTimestamp_not_null_none((Timestamp)value);
166 public Timestamp getFieldValue(IdBase instance) {
167 return ((TimestampAsSqlTimestampTypes)instance).getTimestamp_not_null_none();
169 public void setPreparedStatementValue(PreparedStatement preparedStatement,
int j, Object value)
170 throws SQLException {
171 preparedStatement.setTimestamp(j, (Timestamp)value);
173 public Object getResultSetValue(ResultSet rs,
int j)
throws SQLException {
174 return rs.getTimestamp(j);
178 protected static ColumnDescriptor[] columnDescriptors =
new ColumnDescriptor[] {
187 return columnDescriptors;