English 中文(简体)
不装载Query Buildinger的外国歌唱
原标题:ForeignCollection not loading with Query Builder

我在一次海底应用中尝试了红利,并遇到了一个问题:

我在物体上设立了外国藏书,并指定了某些物体。 我可以使用所有问题。 农林局调查这些物体的方法,并按预期归还:

allTeams = getHelper().getTeamDao().queryForAll();
for(ScrumTeam team : allTeams) {
    if(team.getMembers() == null || team.getMembers().size() == 0) {
        log("No Members");
    } else {
        log(team.getMembers().size()+" Members");
    }
}

这项工作按预期进行,在小组中印刷“2名成员”或“3名成员”,这是正确的数据。

显然,我要对数据进行分类,我发现的这样做的方法是使用查询系统:

allTeams = getHelper().getTeamDao().queryBuilder().selectColumns("id", "name").orderBy("name", true).query();
for(ScrumTeam team : allTeams) {
    if(team.getMembers() == null || team.getMembers().size() == 0) {
        log("No Members");
    } else {
        log(team.getMembers().size()+" Members");
    }
}

The above code outputs "No members", but i can access other data of the team (id and name) perfectly. I tried setting eager to true and false on the collection, but neither worked. Investigating further, I found out, that the members array is not initialized (null). Is this a bug, or am I using the Library incorrectly? Is there a way to fetch the ForeigCollection manually?

感谢你们的答复!

最佳回答

利息。 问题是,你将栏目限制在<代码>id”和,名称“:ORML,因此没有为你创建ForeignCollection

这在430版中是固定的。 我们增加了在<条码>中指定/code>栏名的能力。 这里围绕这一点fix:

https://forge.net/tierer/?func=detail&aid=3428751&group_id=297653&atid=1255989

页: 1

...selectColumns("id", "name", "members")...

The docs for the selectColumns ( methods:

http://ormlite.com/docs/select-columns

引文:

WARNING: 如果你具体说明返回的栏目,那么,任何外国收集的田地都将被送回为无效,除非其外选场。 姓名也列在名单上。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签