/** * Set the given value as a parameter to the statement. */ public void setTimestamp(PreparedStatement stmnt, int idx, Timestamp val, Calendar cal, Column col) throws SQLException { val = StateManagerImpl.roundTimestamp(val, datePrecision); if (cal == null) stmnt.setTimestamp(idx, val); else stmnt.setTimestamp(idx, val, cal); }
/** * Set the given value as a parameter to the statement. */ public void setTimestamp(PreparedStatement stmnt, int idx, Timestamp val, Calendar cal, Column col) throws SQLException { val = StateManagerImpl.roundTimestamp(val, datePrecision); if (cal == null) stmnt.setTimestamp(idx, val); else stmnt.setTimestamp(idx, val, cal); }
/** * Set the given value as a parameter to the statement. */ public void setTimestamp(PreparedStatement stmnt, int idx, Timestamp val, Calendar cal, Column col) throws SQLException { val = StateManagerImpl.roundTimestamp(val, datePrecision); if (cal == null) stmnt.setTimestamp(idx, val); else stmnt.setTimestamp(idx, val, cal); }
/** * Set the given value as a parameter to the statement. */ public void setTimestamp(PreparedStatement stmnt, int idx, Timestamp val, Calendar cal, Column col) throws SQLException { val = StateManagerImpl.roundTimestamp(val, datePrecision); if (cal == null) stmnt.setTimestamp(idx, val); else stmnt.setTimestamp(idx, val, cal); }
private void assignVersionField(Object version) { if (version instanceof Timestamp) { if (_datePrecision == -1) { try { OpenJPAConfiguration conf = _broker.getConfiguration(); Class confCls = Class.forName("org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl"); if (confCls.isAssignableFrom(conf.getClass())) { Object o = conf.getClass().getMethod("getDBDictionaryInstance").invoke(conf, (Object[]) null); _datePrecision = o.getClass().getField("datePrecision").getInt(o); } else { _datePrecision = 1000; } } catch (Throwable e) { _datePrecision = 1000; } } version = roundTimestamp((Timestamp) version, _datePrecision); } _version = version; FieldMetaData vfield = _meta.getVersionField(); if (vfield != null) store(vfield.getIndex(), JavaTypes.convert(version, vfield.getTypeCode())); }
private void assignVersionField(Object version) { if (version instanceof Timestamp) { if (_datePrecision == -1) { try { OpenJPAConfiguration conf = _broker.getConfiguration(); Class confCls = Class.forName("org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl"); if (confCls.isAssignableFrom(conf.getClass())) { Object o = conf.getClass().getMethod("getDBDictionaryInstance").invoke(conf, (Object[]) null); _datePrecision = o.getClass().getField("datePrecision").getInt(o); } else { _datePrecision = 1000; } } catch (Throwable e) { _datePrecision = 1000; } } version = roundTimestamp((Timestamp) version, _datePrecision); } _version = version; FieldMetaData vfield = _meta.getVersionField(); if (vfield != null) store(vfield.getIndex(), JavaTypes.convert(version, vfield.getTypeCode())); }
private void assignVersionField(Object version) { if (version instanceof Timestamp) { if (_datePrecision == -1) { try { OpenJPAConfiguration conf = _broker.getConfiguration(); Class confCls = Class.forName("org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl"); if (confCls.isAssignableFrom(conf.getClass())) { Object o = conf.getClass().getMethod("getDBDictionaryInstance").invoke(conf, (Object[]) null); _datePrecision = o.getClass().getField("datePrecision").getInt(o); } else { _datePrecision = 1000; } } catch (Throwable e) { _datePrecision = 1000; } } version = roundTimestamp((Timestamp) version, _datePrecision); } _version = version; FieldMetaData vfield = _meta.getVersionField(); if (vfield != null) store(vfield.getIndex(), JavaTypes.convert(version, vfield.getTypeCode())); }
private void assignVersionField(Object version) { if (version instanceof Timestamp) { if (_datePrecision == -1) { try { OpenJPAConfiguration conf = _broker.getConfiguration(); Class confCls = Class.forName("org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl"); if (confCls.isAssignableFrom(conf.getClass())) { Object o = conf.getClass().getMethod("getDBDictionaryInstance").invoke(conf, (Object[]) null); _datePrecision = o.getClass().getField("datePrecision").getInt(o); } else { _datePrecision = 1000; } } catch (Throwable e) { _datePrecision = 1000; } } version = roundTimestamp((Timestamp) version, _datePrecision); } _version = version; FieldMetaData vfield = _meta.getVersionField(); if (vfield != null) store(vfield.getIndex(), JavaTypes.convert(version, vfield.getTypeCode())); }