问题描述
好吧,我正在尝试选择entitie_id = *some id*
Well I'm trying to select all entities where entitie_id = *some id*
我使用以下规则进行此操作:
I do this with this rule:
List<NodeSugar> nodesugars = NodeSugar.find(NodeSugar.class, "entitie_id = ? ", String.valueOf(nodeid));
我知道我应该得到一些结果,但会出现错误.这个错误:
I know I should get some results back and I get an error.this error:
E/SQLiteLog﹕ (1) no such column: entitie_id
我知道该列存在是因为我可以在代码的不同部分进行设置.
I know the column exists because I can set it in a different part of code.
我要去哪里错了?
推荐答案
您应该可以使用"entitieid"进行查询.
You should be able to query with "entitieid".
Sugar ORM在表中创建列时会进行一些转换.这是一个基本示例:
Sugar ORM does some conversion when it creates the columns in the tables. Here is a basic example:
String firstName; //creates column first_name
int entitie_id; //creates column entitieid
文档仅指定从驼峰大小写到下划线分隔的转换.我不得不弄清楚另一个.
The documentation only specifies the conversion from camel case to underscore separation. I had to figure the other one out.
这篇关于Android的Sugar ORM找不到我的列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!