Note that there are some explanatory texts on larger screens.

plurals
  1. POORMLite does not support GregorianCalendar to be mapped
    primarykey
    data
    text
    <p>I'm going to use ORMLite as I have found it very useful... However, I have found a disadvantage.</p> <p>I have a class which has a GregorianCalendar type attribute, which is mapped as follows:</p> <pre><code>@DatabaseField(dataType = DataType.DATE_STRING) private GregorianCalendar fechaNacimiento; </code></pre> <p>When I run my app, it gets crashed with that message in logcat:</p> <blockquote> <p>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 to start activity ComponentInfo{com.joninazio.euskofest/com.joninazio.euskofest.ui.MenuPrincipalActivity}: java.lang.IllegalArgumentException: Field class java.util.GregorianCalendar for field FieldType:name=fechaCreacion,class=Usuario is not valid for type com.j256.ormlite.field.types.DateStringType@40dca268, maybe should be class [B 07-31 20:52:47.629: E/AndroidRuntime(11808): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)</p> </blockquote> <p>It seems that GregorianCalendar is not supported by OrmLite as it can be seen here: <a href="http://ormlite.com/data_types.shtml" rel="nofollow">http://ormlite.com/data_types.shtml</a>, which states that OrmLite's DATE corresponds to Java's java.util.Date... </p> <p>And my question is why supporting a deprecated class?</p> <p>Do you have any solution not to change GregorianCalendar? Perhaps changing the annotation to </p> <pre><code>@DatabaseField(dataType = DataType.STRING) </code></pre> <p>?</p> <p>Thank you in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload