Database API - Long values

2 views
Skip to first unread message

Shawn

unread,
Aug 3, 2010, 2:55:15 AM8/3/10
to gwt-mobile-webkit-users
To say store a Long value, the only thing I can see to do is convert
it to a String.

I tried using INTEGER and then getting back a Long but it throws an
error about expecting an Object but getting a numeral.

Any suggestions on handling Longs? It's a key in the database so I'm
thinking a String isn't the best.

Nice work by the way. Your project dovetails nicely with GWT best
practices and using a command pattern!

Shawn

Bart Guijt

unread,
Aug 3, 2010, 6:02:33 AM8/3/10
to gwt-mobile-...@googlegroups.com
Hi Shawn,

Thanks for your interest in the project!

Long types are particularly difficult to manage due to the lack of such a type in Javascript (JS numbers are *always* of type Float, 64 bit, which does not correspond to Java Longs which are 64-bit integers - see also http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompatibility.html).

Are the ID's to store really that large? Perhaps if you would use int types in GWT code, and map them to INTEGER SQL types, wouldn't that work?

Cheers,
Bart.



--
You received this message because you are subscribed to the Google Groups "gwt-mobile-webkit-users" group.
To post to this group, send email to gwt-mobile-...@googlegroups.com.
To unsubscribe from this group, send email to gwt-mobile-webkit...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-mobile-webkit-users?hl=en.




--
Bart Guijt
GSM: 06-30408987


"ceterum censeo Apple regulam faciendam"

Shawn Brown

unread,
Aug 3, 2010, 6:38:36 AM8/3/10
to gwt-mobile-...@googlegroups.com
> Thanks for your interest in the project!

Thanks for the good work.

> Are the ID's to store really that large? Perhaps if you would use int types
> in GWT code, and map them to INTEGER SQL types, wouldn't that work?

No they't like 1 or 2 or 3.

However, I can't say what big table on appengine will return to me.
It seems incremental and I'll likely not exceed an int value but ...
the id I get from appengine is a long and so I should code for any
value.

String is a hassle but ... my app isn't database intensive.

I wonder if the error would be ignored when really deployed. I need
to code it though in hosted mode. Will try a test of Long in
deployment later.

Shawn

Reply all
Reply to author
Forward
0 new messages