• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Select类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ollie.query.Select的典型用法代码示例。如果您正苦于以下问题:Java Select类的具体用法?Java Select怎么用?Java Select使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Select类属于ollie.query包,在下文中一共展示了Select类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testAddressItems

import ollie.query.Select; //导入依赖的package包/类
public static void testAddressItems(Context context) {
	Delete.from(SimpleAddressItem.class).execute();

	final Collection<SimpleAddressItem> ollieModels =
			Generator.getAddresses(SimpleAddressItem.class, MainActivity.LOOP_COUNT);

	long startTime = System.currentTimeMillis();
	// Reuse method so we don't have to write
	TransactionManager.transact(Ollie.getDatabase(), new Runnable() {
		@Override
		public void run() {
			Saver.saveAll(ollieModels);
		}
	});
	EventBus.getDefault().post(new LogTestDataEvent(startTime, FRAMEWORK_NAME, MainActivity.SAVE_TIME));

	startTime = System.currentTimeMillis();
	Collection<SimpleAddressItem> activeAndroidModelLoad =
			Select.from(SimpleAddressItem.class).fetch();
	EventBus.getDefault().post(new LogTestDataEvent(startTime, FRAMEWORK_NAME, MainActivity.LOAD_TIME));

	Delete.from(SimpleAddressItem.class).execute();
}
 
开发者ID:Raizlabs,项目名称:AndroidDatabaseLibraryComparison,代码行数:24,代码来源:OllieTester.java


示例2: getTagsNamesPerIds

import ollie.query.Select; //导入依赖的package包/类
private List<String> getTagsNamesPerIds(@NonNull List<String> tagsIds) {
    boolean addSeparator = false;
    List<String> args = new ArrayList<>();

    StringBuilder whereStr = new StringBuilder("_id IN (");
    for (String tagId : tagsIds) {
        if (addSeparator) {
            whereStr.append(",");
        } else {
            addSeparator = true;
        }

        whereStr.append("?");
        args.add(tagId);
    }
    whereStr.append(")");

    List<Tag> tags = Select.from(Tag.class).where(whereStr.toString(), args.toArray(new String[args.size()])).fetch();
    List<String> tagsNames = new ArrayList<>(tags.size());
    for (Tag tag : tags) {
        tagsNames.add(tag.name);
    }
    return tagsNames;
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:25,代码来源:BaggersDao.java


示例3: getAddresses

import ollie.query.Select; //导入依赖的package包/类
@Override
public Collection<AddressItem> getAddresses() {
    if (addresses == null) {
        addresses = Select.from(AddressItem.class).where("addressBook = ?", id).fetch();
    }
    return addresses;
}
 
开发者ID:Raizlabs,项目名称:AndroidDatabaseLibraryComparison,代码行数:8,代码来源:AddressBook.java


示例4: getContacts

import ollie.query.Select; //导入依赖的package包/类
@Override
public Collection<Contact> getContacts() {
    if (contacts == null) {
        contacts = Select.from(Contact.class).where("addressBook = ?", id).fetch();
    }
    return contacts;
}
 
开发者ID:Raizlabs,项目名称:AndroidDatabaseLibraryComparison,代码行数:8,代码来源:AddressBook.java


示例5: testAddressBooks

import ollie.query.Select; //导入依赖的package包/类
public static void testAddressBooks(Context context) {
	Delete.from(AddressItem.class).execute();
	Delete.from(Contact.class).execute();
	Delete.from(AddressBook.class).execute();

	Collection<AddressBook> addressBooks = Generator.createAddressBooks(AddressBook.class, Contact.class, AddressItem.class, MainActivity.ADDRESS_BOOK_COUNT);

	long startTime = System.currentTimeMillis();
	final Collection<AddressBook> finalAddressBooks = addressBooks;
	TransactionManager.transact(Ollie.getDatabase(), new Runnable()
	{
		@Override
		public void run()
		{
			Saver.saveAll(finalAddressBooks);
		}
	});
	EventBus.getDefault().post(new LogTestDataEvent(startTime, FRAMEWORK_NAME, MainActivity.SAVE_TIME));

	startTime = System.currentTimeMillis();
	addressBooks = Select.from(AddressBook.class).fetch();
	Loader.loadAllInnerData(addressBooks);
	EventBus.getDefault().post(new LogTestDataEvent(startTime, FRAMEWORK_NAME, MainActivity.LOAD_TIME));

	Delete.from(AddressItem.class).execute();
	Delete.from(Contact.class).execute();
	Delete.from(AddressBook.class).execute();
}
 
开发者ID:Raizlabs,项目名称:AndroidDatabaseLibraryComparison,代码行数:29,代码来源:OllieTester.java


示例6: getLocations

import ollie.query.Select; //导入依赖的package包/类
public List<Location> getLocations() {
    List<Location> locations = Select.from(Location.class).fetch();
    for (Location location : locations) {
        fillLocationData(location);
    }
    return locations;
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:8,代码来源:LocationsDao.java


示例7: fillBaggerData

import ollie.query.Select; //导入依赖的package包/类
private void fillBaggerData(@NonNull Bagger bagger, @NonNull List<String> tagsIds) {
    // contacts
    bagger.contacts = Select.from(Contact.class).where("contacts.bagger_id=?", bagger.id).fetchSingle();
    if (bagger.contacts == null) {
        bagger.contacts = new Contact();
    }

    // cities
    List<City> cities = Select.from(City.class).innerJoin(BaggerCity.class).on("cities._id=baggers_cities.city_id").where("baggers_cities.bagger_id=?", bagger.id).fetch();
    bagger.cities = new ArrayList<>();
    for (City city : cities) {
        bagger.cities.add(city.name);
    }

    // sessions
    List<Session> sessions = Select.from(Session.class).where("bagger_id=?", bagger.id).fetch();
    for (Session session : sessions) {
        List<Tag> tags = Select.from(Tag.class).innerJoin(SessionTag.class).on("tags._id=sessions_tags.tag_id").where("sessions_tags.session_id=?", session.id).fetch();
        session.tags = new ArrayList<>();
        for (Tag tag : tags) {
            session.tags.add(tag.name);
        }
    }
    bagger.sessions = filterSessionsMatchingTags(sessions, tagsIds);

    // websites
    bagger.websites = Select.from(Website.class).where("bagger_id=?", bagger.id).fetch();
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:29,代码来源:BaggersDao.java


示例8: loadVideos

import ollie.query.Select; //导入依赖的package包/类
@Override
public void loadVideos() {

    // Load the videos from the database
    Select.from(Video.class)
            .observable()
            .subscribe(new Action1<List<Video>>() {
                @Override
                public void call(List<Video> videos) {
                    mView.setVideos(videos);
                }
            });


}
 
开发者ID:52inc,项目名称:android-Showcase,代码行数:16,代码来源:HomePresenterImpl.java


示例9: findAll

import ollie.query.Select; //导入依赖的package包/类
public static List<Article> findAll() {
    return Select.from(Article.class).fetch();
}
 
开发者ID:gotokatsuya,项目名称:Easy,代码行数:4,代码来源:ArticleRepository.java


示例10: hasData

import ollie.query.Select; //导入依赖的package包/类
public boolean hasData() {
    return Select.from(Location.class).fetchSingle() != null;
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:4,代码来源:LocationsDao.java


示例11: fillLocationData

import ollie.query.Select; //导入依赖的package包/类
private void fillLocationData(@NonNull Location location) {
    location.audience = Select.from(Audience.class).where("audiences.location_id=?", location.id).fetchSingle();
    location.interests = Select.from(Interest.class).innerJoin(LocationInterest.class).on("interests._id=locations_interests.interest_id").where("locations_interests.location_id=?", location.id).fetch();
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:5,代码来源:LocationsDao.java


示例12: hasData

import ollie.query.Select; //导入依赖的package包/类
public boolean hasData() {
    return Select.from(City.class).fetchSingle() != null;
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:4,代码来源:CitiesDao.java


示例13: getCities

import ollie.query.Select; //导入依赖的package包/类
public List<City> getCities() {
    return Select.from(City.class).orderBy("name ASC").fetch();
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:4,代码来源:CitiesDao.java


示例14: getCityByLatLng

import ollie.query.Select; //导入依赖的package包/类
public City getCityByLatLng(String lat, String lng) {
    return Select.from(City.class).where("lat=? AND lng=?", lat, lng).fetchSingle();
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:4,代码来源:CitiesDao.java


示例15: hasData

import ollie.query.Select; //导入依赖的package包/类
public boolean hasData() {
    return Select.from(Bagger.class).fetchSingle() != null;
}
 
开发者ID:Nilhcem,项目名称:bblfr-android,代码行数:4,代码来源:BaggersDao.java


示例16: find

import ollie.query.Select; //导入依赖的package包/类
/**
 * <p>
 * Find a record by id.
 * </p>
 *
 * @param cls The model class.
 * @param id  The model Id.
 * @return The query result.
 */
public static final <T extends Model> T find(Class<T> cls, Long id) {
	return Select.from(cls).where(_ID + "=?", id).fetchSingle();
}
 
开发者ID:pardom,项目名称:Ollie,代码行数:13,代码来源:Model.java



注:本文中的ollie.query.Select类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ScanPolicy类代码示例发布时间:2022-05-22
下一篇:
Java Faces类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap