-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoincrement on long #22
Comments
|
that was fast....thanks. |
You should know that SQLite only knows about the datatype "integer" and doesn't have the datatype "long". AFAIK SQLite changes any CREATE TABLE statement containing long types to integers anyway: http://www.sqlite.org/datatype3.html SQLite is very flexible and adapts to the actual data (the definition in CREATE TABLE is not that importantas in other relational databases). So inserting a long value into a integer column works fine. |
Wolfram is right. My code is actually changing Java longs into SQLite Nicolas KLEIN aka Foxykeep On Wed, Dec 4, 2013 at 2:37 AM, Wolfram Rittmeyer
|
I guess the next question I have is: is a SQLite integer the same size as a java long or a java int. if it the same size as a java long then my requested code change is valid (auto-increment on a java long) I guess the question is: are we using the JSON def file just to create a SQLite provider or is this also a way to, one day, auto-generate a data model java class structure. I was using the mdsd-content-provider-generator which reads an ecore model and attempts to generate both the provider and the model. It was an interesting exercise, but it's just too incomplete to be very useful when trying to build a model with complex (or even simple) relationships. An the code is one year old untouched. So, I am warming up to foxykeep's take on creating a provider (very different than mdsd!!) and creating the data object model manually. Probably better that way. Thanks guys. Sent from my iPhone
|
AFAIK there is no limit besides the os limit on the size of sqlite Nicolas Klein aka Foxykeep
|
I'm a newbie to SQLite. So please forgive. But I did receive this error:
Exception in thread "main" java.lang.IllegalArgumentException: Field "eventId" | is_autoincrement can only be used on an integer type field
at com.foxykeep.cpcodegenerator.model.FieldData.(FieldData.java:44)
at com.foxykeep.cpcodegenerator.model.TableData.(TableData.java:40)
at com.foxykeep.cpcodegenerator.model.TableData.getClassesData(TableData.java:66)
at com.foxykeep.cpcodegenerator.Main.main(Main.java:100)
I changed the code on line 44 to
if (dbIsAutoincrement && !type.equals("integer") && !type.equals("long")) {
throw new IllegalArgumentException("Field "" + name + "" | is_autoincrement can "
+ "only be used on an integer type field");
}
My question is...is autoincrement valid only on int types? Is long OK?
The text was updated successfully, but these errors were encountered: