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

Java Condition类代码示例

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

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



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

示例1: fetchUnusedQuotes

import com.orm.query.Condition; //导入依赖的package包/类
@Override
public void fetchUnusedQuotes(final Category category, final Callback<List<Quote>> callback) {
    Condition [] conditions = new Condition[2];
    conditions[0] = Condition.prop(NamingHelper.toSQLNameDefault("used")).eq("0");
    conditions[1] = Condition.prop(NamingHelper.toSQLNameDefault("category")).eq(category.getId());
    final List<Quote> unusedQuotesFromCategory = Select.from(Quote.class).where(conditions).list();
    if (unusedQuotesFromCategory != null && !unusedQuotesFromCategory.isEmpty()) {
        callback.onSuccess(unusedQuotesFromCategory);
    } else if (category.source == Category.Source.BRAINY_QUOTE) {
        fetchNewQuotes(category, new Callback<List<Quote>>() {
            @Override
            public void onSuccess(List<Quote> quotes) {
                callback.onSuccess(quotes);
            }

            @Override
            public void onError(LWQError error) {
                callback.onError(error);
            }
        });
    } else {
        // It's not an error, just no return.
        callback.onSuccess(new ArrayList<Quote>());
    }
}
 
开发者ID:stanidesis,项目名称:quotograph,代码行数:26,代码来源:LWQQuoteControllerBrainyQuoteImpl.java


示例2: bindTo

import com.orm.query.Condition; //导入依赖的package包/类
void bindTo(UserAlbum userAlbum) {
    boundTo = userAlbum;
    imageSourceName.setText(userAlbum.name);
    imageSourceName.setFocusable(true);
    imageSourceName.setFocusableInTouchMode(true);
    removeSource.setVisibility(View.VISIBLE);
    useImageSource.setChecked(userAlbum.active);
    imageSource.setImageBitmap(
            ImageLoader.getInstance().loadImageSync(
                    Select.from(UserPhoto.class)
                            .where (
                                Condition.prop(
                                        NamingHelper.toSQLNameDefault("album")
                                ).eq(userAlbum)
                            ).first().uri)
            );
}
 
开发者ID:stanidesis,项目名称:quotograph,代码行数:18,代码来源:ImageMultiSelectAdapter.java


示例3: deleteStory

import com.orm.query.Condition; //导入依赖的package包/类
public Observable<Object> deleteStory(Story item) {
    return Observable.create(subscriber -> {
        SugarTransactionHelper.doInTansaction(() -> {
            Select.from(Story.class)
                  .where(Condition.prop(StringUtil.toSQLName("mStoryId"))
                                  .eq(item.getStoryId()))
                  .first()
                  .delete();

            StoryDetail storyDetail = Select.from(StoryDetail.class)
                                            .where(Condition.prop(StringUtil.toSQLName(StoryDetail.STORY_DETAIL_ID))
                                                            .eq(item.getStoryId()))
                                            .first();
            Select.from(Comment.class)
                  .where(Condition.prop(StringUtil.toSQLName("mStoryDetail"))
                                  .eq(storyDetail.getId()))
                  .first()
                  .delete();
            storyDetail.delete();
            if (!subscriber.isUnsubscribed()) {
                subscriber.onCompleted();
            }
        });
    });
}
 
开发者ID:dinosaurwithakatana,项目名称:hacker-news-android,代码行数:26,代码来源:StoryListViewModel.java


示例4: getByName

import com.orm.query.Condition; //导入依赖的package包/类
/**
 * Finds transport mode by name.
 * @param name name of the transport mode to be searched
 * @return transport mode with the given name
 */
public static TransportMode getByName(String name) {
    List<TransportMode> modes = Select.from(TransportMode.class)
            .where(Condition.prop("name").eq(name))
            .limit("1")
            .list();

    return modes.get(0);
}
 
开发者ID:mobility-profile,项目名称:Mobility-Profile,代码行数:14,代码来源:TransportModeDao.java


示例5: getRouteSearchesByStartlocation

import com.orm.query.Condition; //导入依赖的package包/类
/**
 * Returns a list of routesearches where the nearestKnownLocation matches the given one.
 *
 * @param startLocation StartLocation of the routesearches
 * @return List of routesearches
 */
public static List<RouteSearch> getRouteSearchesByStartlocation(String startLocation) {
    return Select.from(RouteSearch.class)
            .where(Condition.prop("startlocation").eq(startLocation))
            .orderBy("timestamp DESC")
            .list();
}
 
开发者ID:mobility-profile,项目名称:Mobility-Profile,代码行数:13,代码来源:RouteSearchDao.java


示例6: getRouteSearchesByDestination

import com.orm.query.Condition; //导入依赖的package包/类
/**
 * Returns a list of routesearches where the destination matches the given one.
 *
 * @param destination destination of the routesearches
 * @return List of routesearches
 */
public static List<RouteSearch> getRouteSearchesByDestination(String destination) {
    return Select.from(RouteSearch.class)
            .where(Condition.prop("destination").eq(destination))
            .orderBy("timestamp DESC")
            .list();
}
 
开发者ID:mobility-profile,项目名称:Mobility-Profile,代码行数:13,代码来源:RouteSearchDao.java


示例7: getRouteSearchesByStartlocationAndDestination

import com.orm.query.Condition; //导入依赖的package包/类
/**
 * Returns a list of routesearches where the startlocation and destination matches the given ones.
 *
 * @param startLocation Start location of the routesearch
 * @param destination Destination of the routesearch
 * @return List of routesearches
 */
public static List<RouteSearch> getRouteSearchesByStartlocationAndDestination(String startLocation, String destination) {
    return Select.from(RouteSearch.class)
            .where(Condition.prop("startlocation").eq(startLocation))
            .where(Condition.prop("destination").eq(destination))
            .orderBy("timestamp DESC")
            .list();
}
 
开发者ID:mobility-profile,项目名称:Mobility-Profile,代码行数:15,代码来源:RouteSearchDao.java


示例8: getAll

import com.orm.query.Condition; //导入依赖的package包/类
/**
 * Retrieves all RouteSearches with the given mode
 * @param mode 0 for intracity, 1 for intercity
 * @return list of routeSearches
 */
public static List<RouteSearch> getAll(int mode) {
    return Select.from(RouteSearch.class)
            .where(Condition.prop("mode").eq(mode))
            .orderBy("timestamp DESC")
            .list();
}
 
开发者ID:mobility-profile,项目名称:Mobility-Profile,代码行数:12,代码来源:RouteSearchDao.java


示例9: incrementAppCount

import com.orm.query.Condition; //导入依赖的package包/类
public static void incrementAppCount(String packageName, String name) {
    String identifier = AppPersistent.generateIdentifier(packageName, name);
    AppPersistent appPersistent = Select.from(AppPersistent.class).where(Condition.prop(NamingHelper.toSQLNameDefault("mIdentifier")).eq(identifier)).first();
    if (appPersistent != null) {
        appPersistent.setOpenCount(appPersistent.getOpenCount() + 1);
        appPersistent.save();
    } else {
        AppPersistent newAppPersistent = new AppPersistent(packageName, name, DEFAULT_OPEN_COUNT, DEFAULT_ORDER_NUMBER, DEFAULT_APP_VISIBILITY);
        newAppPersistent.save();
    }
}
 
开发者ID:nicholasrout,项目名称:lens-launcher,代码行数:12,代码来源:AppPersistent.java


示例10: setAppOrderNumber

import com.orm.query.Condition; //导入依赖的package包/类
public static void setAppOrderNumber(String packageName, String name, int orderNumber) {
    String identifier = AppPersistent.generateIdentifier(packageName, name);
    AppPersistent appPersistent = Select.from(AppPersistent.class).where(Condition.prop(NamingHelper.toSQLNameDefault("mIdentifier")).eq(identifier)).first();
    if (appPersistent != null) {
        appPersistent.setOrderNumber(orderNumber);
        appPersistent.save();
    } else {
        AppPersistent newAppPersistent = new AppPersistent(packageName, name, DEFAULT_OPEN_COUNT, DEFAULT_ORDER_NUMBER, DEFAULT_APP_VISIBILITY);
        newAppPersistent.save();
    }
}
 
开发者ID:nicholasrout,项目名称:lens-launcher,代码行数:12,代码来源:AppPersistent.java


示例11: getAppVisibility

import com.orm.query.Condition; //导入依赖的package包/类
public static boolean getAppVisibility(String packageName, String name) {
    String identifier = AppPersistent.generateIdentifier(packageName, name);
    AppPersistent appPersistent = Select.from(AppPersistent.class).where(Condition.prop(NamingHelper.toSQLNameDefault("mIdentifier")).eq(identifier)).first();
    if (appPersistent != null) {
        return appPersistent.isAppVisible();
    } else {
        return true;
    }
}
 
开发者ID:nicholasrout,项目名称:lens-launcher,代码行数:10,代码来源:AppPersistent.java


示例12: setAppVisibility

import com.orm.query.Condition; //导入依赖的package包/类
public static void setAppVisibility(String packageName, String name, boolean mHideApp) {
    String identifier = AppPersistent.generateIdentifier(packageName, name);
    AppPersistent appPersistent = Select.from(AppPersistent.class).where(Condition.prop(NamingHelper.toSQLNameDefault("mIdentifier")).eq(identifier)).first();
    if (appPersistent != null) {
        appPersistent.setAppVisible(mHideApp);
        appPersistent.save();
    } else {
        AppPersistent newAppPersistent = new AppPersistent(packageName, name, DEFAULT_OPEN_COUNT, DEFAULT_ORDER_NUMBER, mHideApp);
        newAppPersistent.save();
    }
}
 
开发者ID:nicholasrout,项目名称:lens-launcher,代码行数:12,代码来源:AppPersistent.java


示例13: getAppOpenCount

import com.orm.query.Condition; //导入依赖的package包/类
public static long getAppOpenCount(String packageName, String name) {
    String identifier = AppPersistent.generateIdentifier(packageName, name);
    AppPersistent appPersistent = Select.from(AppPersistent.class).where(Condition.prop(NamingHelper.toSQLNameDefault("mIdentifier")).eq(identifier)).first();
    if (appPersistent != null) {
        return appPersistent.getOpenCount();
    } else {
        return 0;
    }
}
 
开发者ID:nicholasrout,项目名称:lens-launcher,代码行数:10,代码来源:AppPersistent.java


示例14: exists

import com.orm.query.Condition; //导入依赖的package包/类
public static boolean exists(@NonNull String activityInfoName, @NonNull String packageName) {
    return Select.from(AppsModel.class)
            .where(Condition.prop(NamingHelper.toSQLNameDefault("activityInfoName")).eq(activityInfoName))
            .and(Condition.prop(NamingHelper.toSQLNameDefault("packageName")).eq(packageName))
            .and(Condition.prop(NamingHelper.toSQLNameDefault("folderId")).eq(0))
            .first() != null;
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:8,代码来源:AppsModel.java


示例15: getHours

import com.orm.query.Condition; //导入依赖的package包/类
public static List<String> getHours(Integer day) {
    List<String> hours = new ArrayList<>();
    List<Lesson> lessons = Select.from(Lesson.class)
            .where(Condition.prop("day").eq(day), Condition.prop("hidden").eq("0"))
            .list();

    for (Lesson lesson : lessons) {
        if (hours.indexOf(lesson.getTime()) == -1) {
            hours.add(lesson.getTime());
        }
    }

    return hours;
}
 
开发者ID:luk1337,项目名称:TimeTable2,代码行数:15,代码来源:Utils.java


示例16: getLessonsForHour

import com.orm.query.Condition; //导入依赖的package包/类
public static List<Lesson> getLessonsForHour(Integer day, String time) {
    return Select.from(Lesson.class)
            .where(Condition.prop("day").eq(day),
                    Condition.prop("time").eq(time),
                    Condition.prop("hidden").eq("0"))
            .list();
}
 
开发者ID:luk1337,项目名称:TimeTable2,代码行数:8,代码来源:Utils.java


示例17: onBindViewHolder

import com.orm.query.Condition; //导入依赖的package包/类
@Override
    public void onBindViewHolder(final ViewHolder viewHolder, final int i) {


        List<WilayahDB> wilayahDBs = Select.from(WilayahDB.class)
                .where(Condition.prop("dapil").eq(data.get(i).getId()))
                .list();
        StringBuffer buffer = new StringBuffer();
        int z = 0;
        for (WilayahDB wilayahDB : wilayahDBs) {
            buffer.append(wilayahDB.getNama());
            if (z < wilayahDBs.size() - 1) {
                buffer.append(",");
            }
            z++;
        }
        String wil = buffer.toString();
        viewHolder.nama.setText(wil);
        viewHolder.nama_lengkap.setText(data.get(i).getNama() + " (" + data.get(i).getJumlah_kursi() + " Kursi)");

        viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                HomeListFragment.dataDapil = data.get(i);
                Intent intent = new Intent();
//                data.get(i).setIdDapil(dapils.get(i).getId());
                intent.putExtra(Constant.TAG.DATADAPIL, data.get(i));
                activity.setResult(Activity.RESULT_OK, intent);
                activity.finish();
            }
        });

    }
 
开发者ID:perludem,项目名称:DPR-KITA,代码行数:34,代码来源:AdapterDapil.java


示例18: isArticleInList

import com.orm.query.Condition; //导入依赖的package包/类
/**
 * Has the article already been added to the list
 */
public static boolean isArticleInList(String articleUrl) {
    SendHeadline headline = Select.from(SendHeadline.class)
                                    .where(Condition.prop(SendHeadline.ARTICLE_URL_COL).eq(articleUrl))
                                    .first();
    return headline != null;
}
 
开发者ID:creativedrewy,项目名称:WeaRSS,代码行数:10,代码来源:HeadlinesService.java


示例19: getSavedHeadlines

import com.orm.query.Condition; //导入依赖的package包/类
/**
 * Get the set of headline objects that have been saved from the wearable
 */
public static List<SendHeadline> getSavedHeadlines() {
    return Select.from(SendHeadline.class)
            .where(Condition.prop(SendHeadline.IN_READ_LIST_COL).eq(1))
            .orderBy(SendHeadline.HEADLINE_COL)
            .list();
}
 
开发者ID:creativedrewy,项目名称:WeaRSS,代码行数:10,代码来源:HeadlinesService.java


示例20: doesUserExist

import com.orm.query.Condition; //导入依赖的package包/类
public static boolean doesUserExist(String username, String pwd) {
    User user = Select.from(User.class)
            .where(Condition.prop(StringUtil.toSQLName("username")).eq(username))
            .where(Condition.prop(StringUtil.toSQLName("password")).eq(pwd))
            .first();
    if (user != null)
        return true;
    return false;
}
 
开发者ID:CreaRo,项目名称:dawebmail,代码行数:10,代码来源:User.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java InvalidOffsetException类代码示例发布时间:2022-05-22
下一篇:
Java UpdateAction类代码示例发布时间: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