RafficMaleo / android-active-record

Automatically exported from code.google.com/p/android-active-record
0 stars 0 forks source link

Timestamp fields saved corrupted #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create an entity with a sql.Timestamp field
2. give it a date
3. do a .save
4. read the entity with the findAll function

What is the expected output? What do you see instead?
The Timestamp fields contains a wrong value

What version of the product are you using? On what operating system?
r147

Please provide any additional information below.
if in the file ActiveRecordBase.java you add these lines; it seems to start 
working fine:

=if (column.getType().getSuperclass() == ActiveRecordBase.class)
=  values.put(CamelNotationHelper.toSQLName(column.getName()),
=      column.get(this) != null ? String
=          .valueOf(((ActiveRecordBase) column
=              .get(this))._id) : "0");
+else if (column.getType().toString().equals("class +java.sql.Timestamp"))
+  values.put(CamelNotationHelper.toSQLName(column.getName()),
+      String.valueOf(((Timestamp)column.get(this)).getTime()));
=else
=  values.put(CamelNotationHelper.toSQLName(column.getName()),
=      String.valueOf(column.get(this)));

Original issue reported on code.google.com by opa...@gmail.com on 2 Jun 2011 at 6:54