Tuesday, July 2, 2013

[android help] OrmLite, calendar and timestamp


OrmLite, calendar and timestamp



I am having a problem with some OrmLite mapping with java fields in android.


1.I have Calendar type in java class, and in SQLlite the same field defined as TimeStamp, when I run a method findAll() I get folowing exception:
ORMLite can't store unknown class class java.util.Calendar for field 'Start'. Serializable fields must specify dataType=DataType.SERIALIZABLE


if I use setDataType(DataType.SERIALIZABLE); I'm getting this error:
java.sql.SQLException: Could not read serialized object from byte array: [50, 48,


Also I have tried with the TIME_STAMP (DataType.TIME_STAMP) but then I'm getting this error: Field class java.util.Calendar for field FieldType:name=Start,class=PeriodTest is not valid for type com.j256.ormlite.field.types.TimeStampType@416f9ea0, maybe should be class java.sql.Timestamp


2.I have the same problem with the TimeStamp java class.


Does anybody know the solution for these two cases?


Thanx in advance, Oggie



.

stackoverflow.comm



No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...