本文整理匯總了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();
}