File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
fj-core/src/main/java/org/fugerit/java/core/db Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,17 @@ public ObjectField(Object value) {
169169 * @see it.finanze.secin.shared.dao.Field#setField(java.sql.PreparedStatement, int)
170170 */
171171 public void setField (PreparedStatement ps , int index ) throws SQLException {
172- ps .setObject (index , this .value );
172+ if ( this .value == null ) {
173+ ps .setObject (index , this .value );
174+ } else if ( this .value instanceof java .sql .Date ) {
175+ ps .setDate (index , ((java .sql .Date )this .value ));
176+ } else if ( this .value instanceof java .sql .Timestamp ) {
177+ ps .setTimestamp (index , ((java .sql .Timestamp )this .value ));
178+ } else if ( this .value instanceof java .util .Date ) {
179+ ps .setTimestamp (index , new java .sql .Timestamp ( ((java .util .Date )this .value ).getTime () ) );
180+ } else {
181+ ps .setObject (index , this .value );
182+ }
173183 }
174184
175185 private Object value ;
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ public class SelectHelper extends QueryHelper {
2525
2626 public static final String COMPARE_LT_EQUAL = " <= " ;
2727
28+ public static final String COMPARE_GT_EQUAL = " >= " ;
29+
2830 public static final String ORDER_ASC = "ASC" ;
2931
3032 public static final String ORDER_DESC = "DESC" ;
You can’t perform that action at this time.
0 commit comments