當前位置: 首頁>>代碼示例>>Java>>正文


Java DataSupport.findAll方法代碼示例

本文整理匯總了Java中org.litepal.crud.DataSupport.findAll方法的典型用法代碼示例。如果您正苦於以下問題:Java DataSupport.findAll方法的具體用法?Java DataSupport.findAll怎麽用?Java DataSupport.findAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.litepal.crud.DataSupport的用法示例。


在下文中一共展示了DataSupport.findAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: queryProvinces

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
/**
 * 查詢全國所有的省,優先從數據庫查詢,如果沒有查詢到再去服務器上查詢
 */
private void queryProvinces() {
    titleText.setText("中國");
    backButton.setVisibility(View.GONE);
    provinceList = DataSupport.findAll(Province.class);
    if (provinceList.size() > 0) {
        dataList.clear();
        for (Province province : provinceList) {
            dataList.add(province.getProvinceName());
        }
        adapter.notifyDataSetChanged();
        listView.setSelection(0);
        currentLevel = LEVEL_PROVINCE;
    } else {
        String address = "http://guolin.tech/api/china";
        queryFromServer(address, "province");
    }
}
 
開發者ID:qiaopeichen,項目名稱:jojoweather,代碼行數:21,代碼來源:chooseAreaFragment.java

示例2: queryProvinces

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
/**
 * 查詢全國所有的省,優先從數據庫查詢,如果沒有查詢到再去服務器上查詢
 */
private void queryProvinces(){
    titleText.setText("中國");
    backButton.setVisibility(View.GONE);
    provinceList= DataSupport.findAll(Province.class);
    if (provinceList.size()>0){
        dataList.clear();
        for (Province province:provinceList) {
            dataList.add(province.getProvinceName());
        }
        adapter.notifyDataSetChanged();
        listView.setSelection(0);
        currentLevel=LEVEL_PROVINCE;
    }else {
        String address="http://guolin.tech/api/china";
        queryFromServer(address,"province");
    }
}
 
開發者ID:Qinlong275,項目名稱:AndroidBookTest,代碼行數:21,代碼來源:ChooseAreaFragment.java

示例3: queryProvinces

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
/**
 * 查詢全國所有的省
 */
private void queryProvinces() {
    titleText.setText("中國");
    backButton.setVisibility(View.GONE);

    provinceList = DataSupport.findAll(Province.class);
    if(provinceList.size() >0){
        dataList.clear();
        for (Province province:provinceList){
            dataList.add(province.getProvinceName());
        }
        adapter.notifyDataSetChanged();
        listView.setSelection(0);
        currentLevel =LEVEL_PROVINCE;
    }else {
        String  address ="http://guolin.tech/api/china";
        queryFromServer(address,"province");
    }
}
 
開發者ID:JakeLes,項目名稱:myCoolWeather,代碼行數:22,代碼來源:ChooseAreaFragment.java

示例4: queryProvinces

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
private void queryProvinces() {
    titleText.setText("中國");
    button.setVisibility(View.GONE);
    provinceList = DataSupport.findAll(Province.class);
    if (provinceList.size() > 0) {
        dataList.clear();
        for (Province province : provinceList) {
            dataList.add(province.getCnProvince());
        }
        adapter.notifyDataSetChanged();
        listView.setSelection(0);
        currentLevel = OWN_LEVEL_PROVINCE;
    } else {
        String address = "https://www.kipmin.cc/h/cityList.json";
        queryFromServer(address, "province");
    }
}
 
開發者ID:kipmin,項目名稱:KipminWeather,代碼行數:18,代碼來源:ChooseAreaFragment.java

示例5: setTodayEvent

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
private void setTodayEvent(){
    List<TodoEvent> todoEventList = DataSupport.findAll(TodoEvent.class);
    Calendar c = Calendar.getInstance();
    int year = c.get(Calendar.YEAR);
    int month = c.get(Calendar.MONTH) + 1;
    int day = c.get(Calendar.DAY_OF_MONTH);
    StringBuilder builder;
    if (day<10){
        builder = new StringBuilder().append(year+"年"+month+"月"+"0"+day+"日");
    }else{
        builder = new StringBuilder().append(year+"年"+month+"月"+day+"日");
    }

    String dayString = builder.toString();
    for (TodoEvent event : todoEventList) {
        if (event.getEventDate().equals(dayString)) {
            tempList.add(event);
        }
    }
}
 
開發者ID:wendyltan,項目名稱:EasyTodo,代碼行數:21,代碼來源:AlarmReceiver.java

示例6: queryProvinces

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
/**
 * 查詢全國所有的省,優先從數據庫查詢,如果沒有查詢到再去服務器上查詢。
 */
private void queryProvinces() {
    titleText.setText("中國");
    backButton.setVisibility(View.GONE);
    provinceList = DataSupport.findAll(Province.class);
    if (provinceList.size() > 0) {
        dataList.clear();
        for (Province province : provinceList) {
            dataList.add(province.getProvinceName());
        }
        adapter.notifyDataSetChanged();
        listView.setSelection(0);
        currentLevel = LEVEL_PROVINCE;
    } else {
        String address = "http://guolin.tech/api/china";
        queryFromServer(address, "province");
    }
}
 
開發者ID:zjutcmos,項目名稱:HappyWeather,代碼行數:21,代碼來源:ChooseAreaFragment.java

示例7: queryProvinces

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
/**
 * 查詢全國所有的省份,優先從數據庫查詢,如果沒有查詢到再去服務器上查詢
 */
private void queryProvinces(){
    titleText.setText("中國");
    backButton.setVisibility(View.GONE);
    provinceList = DataSupport.findAll(Province.class);
    if(provinceList.size()>0){
        dataList.clear();
        for (Province province:provinceList){
            dataList.add(province.getProvinceName());
        }
        adapter.notifyDataSetChanged();
        listView.setSelection(0);
        currentLevel = LEVEL_PROVINCE;
    }else{
        String address = "http://guolin.tech/api/china";
        queryFromServer(address,"province");
    }
}
 
開發者ID:mzhkby,項目名稱:coolweater,代碼行數:21,代碼來源:ChooseAreaFragment.java

示例8: queryProvinces

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
/**
 * 查詢全國所有的省,優先從數據庫查詢,如果沒有查詢到再去服務區上查詢
 */
private void queryProvinces() {
    titleText.setText("中國");
    backButton.setVisibility(View.GONE);
    provinceList = DataSupport.findAll(Province.class);
    if (provinceList.size() > 0){
        dataList.clear();
        for (Province province : provinceList) {
            dataList.add(province.getProvinceName());
        }
        adapter.notifyDataSetChanged();
        listView.setSelection(0);
        currentLevel = LEVEL_PROVINCE;
    }else{
        String address = "http://guolin.tech/api/china";
        queryFromServer(address,"province");
    }
}
 
開發者ID:smartbeng,項目名稱:YunPengWeather,代碼行數:21,代碼來源:ChooseAreaFragment.java

示例9: PillBoxAdapter

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
public PillBoxAdapter(Context context) {
    this.medicines = DataSupport.findAll(Medicine.class);
    this.context = context;

    Collections.sort(medicines, new Comparator<Medicine>() {
        @Override
        public int compare(Medicine o1, Medicine o2) {
            return o1.getName().compareTo(o2.getName()) ;
        }
    });
}
 
開發者ID:jcolladosp,項目名稱:ePills,代碼行數:12,代碼來源:PillBoxAdapter.java

示例10: initViews

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
public void initViews(){
    List<Collect> collects= DataSupport.findAll(Collect.class);
    recyclerView= (RecyclerView) findViewById(R.id.recycler_view);
    LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);
    recyclerView.setLayoutManager(linearLayoutManager);
    CollectionAdapter collectionAdapter=new CollectionAdapter(this,collects);
    recyclerView.addItemDecoration(new MyItemDecoration());
    recyclerView.setAdapter(collectionAdapter);
}
 
開發者ID:zhaoweihaoChina,項目名稱:MrTranslator,代碼行數:10,代碼來源:CollectionActivity.java

示例11: fillContent

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
private void fillContent() {
    List<Artical> allArticals = DataSupport.findAll(Artical.class);

    for (Artical a:allArticals){
        titleData.add(a.getArticalTitle());
        bodyData.add(a.getArticalBody());
    }
    contentAdapter.notifyDataSetChanged();
}
 
開發者ID:ChenTianSaber,項目名稱:DailyZhiHu,代碼行數:10,代碼來源:DownloadFragment.java

示例12: getSelectLabel

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
public static List<String> getSelectLabel() {
    List<LabelType> list = DataSupport.findAll(LabelType.class);
    List<String> labelList = new ArrayList();
    for (LabelType labelType : list) {
        labelList.add(labelType.getType());
    }

    return labelList;
}
 
開發者ID:monkeywiiu,項目名稱:Discover,代碼行數:10,代碼來源:LitePalUtil.java

示例13: onResume

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
@Override
protected void onResume() {
    super.onResume();

    List<User> users = DataSupport.findAll(User.class);
    String starRoutes = users.get(user.getId() - 1).getStarRoutes();

    // 去除前綴 ,
    boolean key = false;
    String ID = "";
    for (int i = 0; i < starRoutes.length(); i++) {
        if(starRoutes.charAt(i) >= '0' && starRoutes.charAt(i) <= '9') {
            key = true;
        }

        if (key) {
            ID += starRoutes.charAt(i);
        }
    }

    // 更新用戶
    User tmp = new User();
    tmp.setStarRoutes(ID);
    tmp.update(user.getId());
    user = DataSupport.find(User.class, user.getId());

    loadAllRoutes();
}
 
開發者ID:yuhodev,項目名稱:login,代碼行數:29,代碼來源:Index.java

示例14: testFindMul

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
public void testFindMul() {
	short isbn1 = 30017;
	Book book1 = new Book();
	book1.setArea(1.5f);
	book1.setBookName("Android Second Line");
	book1.setIsbn(isbn1);
	book1.setLevel('B');
	book1.setPages(434);
	book1.setPrice(40.99);
	book1.setPublished(true);
	book1.save();
	short isbn2 = 30014;
	Book book2 = new Book();
	book2.setArea(8.8f);
	book2.setBookName("Android Third Line");
	book2.setIsbn(isbn2);
	book2.setLevel('C');
	book2.setPages(411);
	book2.setPrice(35.99);
	book2.setPublished(false);
	book2.save();
	List<Book> bookList = DataSupport.findAll(Book.class, book1.getId(), book2.getId());
	assertEquals(2, bookList.size());
	for (Book book : bookList) {
		if (book.getId() == book1.getId()) {
			assertEquals(1.5f, book.getArea());
			assertEquals("Android Second Line", book.getBookName());
			assertEquals(isbn1, book.getIsbn());
			assertEquals('B', book.getLevel());
			assertTrue(434 == book.getPages());
			assertEquals(40.99, book.getPrice());
			assertTrue(book.isPublished());
			assertTrue(book.isSaved());
			continue;
		} else if (book.getId() == book2.getId()) {
			assertEquals(8.8f, book.getArea());
			assertEquals("Android Third Line", book.getBookName());
			assertEquals(isbn2, book.getIsbn());
			assertEquals('C', book.getLevel());
			assertTrue(411 == book.getPages());
			assertEquals(35.99, book.getPrice());
			assertFalse(book.isPublished());
			assertTrue(book.isSaved());
			continue;
		}
		fail();
	}
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:49,代碼來源:QueryBasicTest.java

示例15: getGroups

import org.litepal.crud.DataSupport; //導入方法依賴的package包/類
public synchronized List<Groups> getGroups() {
    return DataSupport.findAll(Groups.class);
}
 
開發者ID:GitLqr,項目名稱:LQRWeChat,代碼行數:4,代碼來源:DBManager.java


注:本文中的org.litepal.crud.DataSupport.findAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。