本文整理汇总了Java中com.j256.ormlite.dao.Dao.queryForEq方法的典型用法代码示例。如果您正苦于以下问题:Java Dao.queryForEq方法的具体用法?Java Dao.queryForEq怎么用?Java Dao.queryForEq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.j256.ormlite.dao.Dao
的用法示例。
在下文中一共展示了Dao.queryForEq方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSuspectedApps
import com.j256.ormlite.dao.Dao; //导入方法依赖的package包/类
protected boolean checkSuspectedApps(String packageName) {
boolean matched = true;
if (!_settings.isAdvancedMode()) {
try {
Dao<SuspectedApp, Integer> suspectedAppDao = DatabaseHelper.getHelper(_context.getApplicationContext()).getSuspectedAppDao();
List<SuspectedApp> res = suspectedAppDao.queryForEq("packageName", packageName);
if (res.size() == 0) {
Log.i(TAG, String.format("Skipping %s since not in suspected app list and is probably a FP", packageName));
matched = false;
} else {
Log.d(TAG, String.format("Process %s found in suspected apps", packageName));
matched = true;
}
} catch (SQLException e) {
Log.e(TAG, String.format("SQL exception: %s", e.getMessage()));
matched = false;
}
}
return matched;
}
示例2: onCreate
import com.j256.ormlite.dao.Dao; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// This is here because onStart is not called when BIND_AUTO_CREATE is used
mContext = this;
localBroadcastManager = LocalBroadcastManager.getInstance(this);
final OrmHandler ormHandler = OpenHelperManager.getHelper(this, OrmHandler.class);
Dao<Track, String> dbTrack;
try {
dbTrack = ormHandler.getDao(Track.class);
mTrackList = dbTrack.queryForAll();
mBucketList = dbTrack.queryForEq("bucket", true);
} catch (SQLException e) {
e.printStackTrace();
}
}
示例3: getBucketedTracks
import com.j256.ormlite.dao.Dao; //导入方法依赖的package包/类
public void getBucketedTracks() {
bucketBool = true;
OrmHandler orm = OpenHelperManager.getHelper(mContext, OrmHandler.class);
try {
Dao<Track, String> mTrack = orm.getDao(Track.class);
mTrackList = mTrack.queryForEq("bucket", true);
} catch (SQLException e) {
e.printStackTrace();
}
OpenHelperManager.releaseHelper();
notifyDataSetChanged();
}