本文整理匯總了Java中com.orm.SugarRecord.listAll方法的典型用法代碼示例。如果您正苦於以下問題:Java SugarRecord.listAll方法的具體用法?Java SugarRecord.listAll怎麽用?Java SugarRecord.listAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.orm.SugarRecord
的用法示例。
在下文中一共展示了SugarRecord.listAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: listAllSameTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
SimpleExtendedModel simple = new SimpleExtendedModel();
save(simple);
RelationshipMixedBModel nested = new RelationshipMixedBModel(simple);
save(nested);
for (int i = 1; i <= 100; i++) {
save(new NestedMixedABModel(nested));
}
List<NestedMixedABModel> models = SugarRecord.listAll(NestedMixedABModel.class);
assertEquals(100, models.size());
for (NestedMixedABModel model : models) {
assertEquals(nested.getId(), model.getNested().getId());
assertEquals(simple.getId(), model.getNested().getSimple().getId());
}
}
示例2: listAllSameTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
SimpleExtendedModel simple = new SimpleExtendedModel();
save(simple);
RelationshipMixedBModel nested = new RelationshipMixedBModel(simple);
save(nested);
for (int i = 1; i <= 100; i++) {
save(new NestedMixedBBModel(nested));
}
List<NestedMixedBBModel> models = SugarRecord.listAll(NestedMixedBBModel.class);
assertEquals(100, models.size());
for (NestedMixedBBModel model : models) {
assertEquals(nested.getId(), model.getNested().getId());
assertEquals(simple.getId(), model.getNested().getSimple().getId());
}
}
示例3: listAllDifferentTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
for (int i = 1; i <= 100; i++) {
SimpleExtendedModel simple = new SimpleExtendedModel();
save(simple);
RelationshipMixedBModel nested = new RelationshipMixedBModel(simple);
save(nested);
save(new NestedMixedBBModel(nested));
}
List<NestedMixedBBModel> models = SugarRecord.listAll(NestedMixedBBModel.class);
assertEquals(100, models.size());
for (NestedMixedBBModel model : models) {
assertEquals(model.getId(), model.getNested().getId());
assertEquals(model.getId(), model.getNested().getSimple().getId());
}
}
示例4: listAllSameTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
save(simple);
RelationshipAnnotatedModel nested = new RelationshipAnnotatedModel(simple);
save(nested);
for (int i = 1; i <= 100; i++) {
save(new NestedAnnotatedModel(nested));
}
List<NestedAnnotatedModel> models = SugarRecord.listAll(NestedAnnotatedModel.class);
assertEquals(100, models.size());
for (NestedAnnotatedModel model : models) {
assertEquals(nested.getId(), model.getNested().getId());
assertEquals(simple.getId(), model.getNested().getSimple().getId());
}
}
示例5: listAllDifferentTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
for (int i = 1; i <= 100; i++) {
SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
save(simple);
RelationshipAnnotatedModel nested = new RelationshipAnnotatedModel(simple);
save(nested);
save(new NestedAnnotatedModel(nested));
}
List<NestedAnnotatedModel> models = SugarRecord.listAll(NestedAnnotatedModel.class);
assertEquals(100, models.size());
for (NestedAnnotatedModel model : models) {
assertEquals(model.getId(), model.getNested().getId());
assertEquals(model.getId(), model.getNested().getSimple().getId());
}
}
示例6: listAllDifferentTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
for (int i = 1; i <= 100; i++) {
SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
save(simple);
RelationshipMixedAModel nested = new RelationshipMixedAModel(simple);
save(nested);
save(new NestedMixedBAModel(nested));
}
List<NestedMixedBAModel> models = SugarRecord.listAll(NestedMixedBAModel.class);
assertEquals(100, models.size());
for (NestedMixedBAModel model : models) {
assertEquals(model.getId(), model.getNested().getId());
assertEquals(model.getId(), model.getNested().getSimple().getId());
}
}
示例7: listAllSameTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
save(simple);
RelationshipMixedAModel nested = new RelationshipMixedAModel(simple);
save(nested);
for (int i = 1; i <= 100; i++) {
save(new NestedMixedAAModel(nested));
}
List<NestedMixedAAModel> models = SugarRecord.listAll(NestedMixedAAModel.class);
assertEquals(100, models.size());
for (NestedMixedAAModel model : models) {
assertEquals(nested.getId(), model.getNested().getId());
assertEquals(simple.getId(), model.getNested().getSimple().getId());
}
}
示例8: listAllDifferentTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
for (int i = 1; i <= 100; i++) {
SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
save(simple);
RelationshipMixedAModel nested = new RelationshipMixedAModel(simple);
save(nested);
save(new NestedMixedAAModel(nested));
}
List<NestedMixedAAModel> models = SugarRecord.listAll(NestedMixedAAModel.class);
assertEquals(100, models.size());
for (NestedMixedAAModel model : models) {
assertEquals(model.getId(), model.getNested().getId());
assertEquals(model.getId(), model.getNested().getSimple().getId());
}
}
示例9: listAllSameTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
save(simple);
RelationshipMixedAModel nested = new RelationshipMixedAModel(simple);
save(nested);
for (int i = 1; i <= 100; i++) {
save(new NestedMixedBAModel(nested));
}
List<NestedMixedBAModel> models = SugarRecord.listAll(NestedMixedBAModel.class);
assertEquals(100, models.size());
for (NestedMixedBAModel model : models) {
assertEquals(nested.getId(), model.getNested().getId());
assertEquals(simple.getId(), model.getNested().getSimple().getId());
}
}
示例10: listAllDifferentTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
for (int i = 1; i <= 100; i++) {
SimpleExtendedModel simple = new SimpleExtendedModel();
save(simple);
RelationshipExtendedModel nested = new RelationshipExtendedModel(simple);
save(nested);
save(new NestedExtendedModel(nested));
}
List<NestedExtendedModel> models = SugarRecord.listAll(NestedExtendedModel.class);
assertEquals(100, models.size());
for (NestedExtendedModel model : models) {
assertEquals(model.getId(), model.getNested().getId());
assertEquals(model.getId(), model.getNested().getSimple().getId());
}
}
示例11: initGoogleAccount
import com.orm.SugarRecord; //導入方法依賴的package包/類
private void initGoogleAccount() {
if (!AccountHolder.isAccountNameSaved(this)) {
pickAccount();
return;
}
// circles were already loaded
String ourGoogleId = AccountHolder.getSavedGoogleId(this);
List<Contact> forAdapter = SugarRecord.listAll(Contact.class);
if (forAdapter.isEmpty()) { // nothing to load, didn't select account?
pickAccount();
return;
}
ListIterator<Contact> itr = forAdapter.listIterator();
while (itr.hasNext()) { // remove us from list, also populate contacts map
Contact c = itr.next();
mContacts.put(c.getNativeId(), c);
if (c.getNativeId().equals(ourGoogleId)) {
mCurrentPerson = c;
itr.remove();
}
}
if(mCurrentPerson == null) { // didn't find ourselves, error?
pickAccount();
return;
}
// successfully loaded cicrles and ourselves from cache
mPersonList.setAdapter(new AccountsAdapter(this, forAdapter));
mFloatingMenu.showMenu(true);
mProgress.animate().alpha(0.0f).setDuration(0).start();
supportInvalidateOptionsMenu();
}
示例12: listAllDifferentTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
for (int i = 1; i <= 100; i++) {
SimpleExtendedModel simple = new SimpleExtendedModel();
save(simple);
save(new RelationshipExtendedModel(simple));
}
List<RelationshipExtendedModel> models =
SugarRecord.listAll(RelationshipExtendedModel.class);
assertEquals(100, models.size());
for (RelationshipExtendedModel model : models) {
assertEquals(model.getId(), model.getSimple().getId());
}
}
示例13: listAllSameTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllSameTest() throws Exception {
SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
save(simple);
for (int i = 1; i <= 100; i++) {
save(new RelationshipAnnotatedModel(simple));
}
List<RelationshipAnnotatedModel> models =
SugarRecord.listAll(RelationshipAnnotatedModel.class);
assertEquals(100, models.size());
for (RelationshipAnnotatedModel model : models) {
assertEquals(simple.getId(), model.getSimple().getId());
}
}
示例14: listAllDifferentTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllDifferentTest() throws Exception {
for (int i = 1; i <= 100; i++) {
SimpleAnnotatedModel simple = new SimpleAnnotatedModel();
save(simple);
save(new RelationshipAnnotatedModel(simple));
}
List<RelationshipAnnotatedModel> models =
SugarRecord.listAll(RelationshipAnnotatedModel.class);
assertEquals(100, models.size());
for (RelationshipAnnotatedModel model : models) {
assertEquals(model.getId(), model.getSimple().getId());
}
}
示例15: listAllTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void listAllTest() throws Exception {
for (int i = 1; i <= 100; i++) {
save(new SimpleExtendedModel());
}
List<SimpleExtendedModel> models = SugarRecord.listAll(SimpleExtendedModel.class);
assertEquals(100, models.size());
for (long i = 1; i <= 100; i++) {
assertEquals(new Long(i), models.get((int) i - 1).getId());
}
}