Sugar ORM for Android cant find my column name

后端 未结 3 1733
-上瘾入骨i
-上瘾入骨i 2021-02-09 00:25

Well I\'m trying to select all entities where entitie_id = *some id*

I do this with this rule:

List nodesugars = NodeSugar.         


        
3条回答
  •  星月不相逢
    2021-02-09 00:43

    You can use NamingHelper.toSQLNameDefault() to wrap column names when building queries. Try:

    List nodesugars = NodeSugar.find(NodeSugar.class, NamingHelper.toSQLNameDefault("entitie_id") + " = ? ", String.valueOf(nodeid));
    

    NamingHelper is used in the Sugar ORM library to create tables and column names:

    https://github.com/satyan/sugar/blob/master/library/src/main/java/com/orm/helper/NamingHelper.java

提交回复
热议问题