Date column as TEXT in pre-existing database

46 views
Skip to first unread message

sebastijanp

unread,
Jul 12, 2012, 11:46:23 AM7/12/12
to gree...@googlegroups.com
Hi

I have a pre-existing database that I copy from assets dir to sd card.
I have a table with date column and I store it as TEXT in the format yyyy-MM-dd HH:mm:ss.

I noticed that you use long for storing date:

stmt.bindLong(2, WorkingDate.getTime());

Is there a way to map the date property to date as TEXT column type in database?

I tried with t.addDateProperty("workingDate").columnName("WorkingDate").columnType("TEXT");

But it still generates the above long type bind.

Regards,
Sebastijan

Markus Junginger

unread,
Jul 12, 2012, 12:02:22 PM7/12/12
to gree...@googlegroups.com
The Date type currently always maps to a long value. There's already a ticket to for text based Datess, but this is currently supported.

My suggestion: bind the text to a String property and use keep sections to create a custom Date or long property that maps from/to the string property.

Markus

sebastijanp

unread,
Jul 12, 2012, 12:43:52 PM7/12/12
to gree...@googlegroups.com

AAA great...nice feature:) It is working! Thank you.

Sebastijan
Reply all
Reply to author
Forward
0 new messages