android - ORMLite does not support GregorianCalendar to be mapped -


i'm going use ormlite have found useful... however, have found disadvantage.

i have class has gregoriancalendar type attribute, mapped follows:

@databasefield(datatype = datatype.date_string) private gregoriancalendar fechanacimiento; 

when run app, gets crashed message in logcat:

07-31 20:52:47.629: e/androidruntime(11808): fatal exception: main 07-31 20:52:47.629: e/androidruntime(11808): java.lang.runtimeexception: unable start activity componentinfo{com.joninazio.euskofest/com.joninazio.euskofest.ui.menuprincipalactivity}: java.lang.illegalargumentexception: field class java.util.gregoriancalendar field fieldtype:name=fechacreacion,class=usuario not valid type com.j256.ormlite.field.types.datestringtype@40dca268, maybe should class [b 07-31 20:52:47.629: e/androidruntime(11808): @ android.app.activitythread.performlaunchactivity(activitythread.java:2308)

it seems gregoriancalendar not supported ormlite can seen here: http://ormlite.com/data_types.shtml, states ormlite's date corresponds java's java.util.date...

and question why supporting deprecated class?

do have solution not change gregoriancalendar? perhaps changing annotation

@databasefield(datatype = datatype.string) 

?

thank in advance.

i have solved trick:

  • the data persisted change date class. change or create new setters , getters.
  • create gregoriancalendar attribute, 1 not persisted (without annotations).
  • modify setter of date attribute, assign gregoriancalendar date's value converted.

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -