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

Java Condition类代码示例

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

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



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

示例1: getModelsOfType

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
private List<EpisodeBaseModel> getModelsOfType(Class<?> model, String type, List<EpisodeBaseModel> existing, boolean uniqueSeries) {
    FlowCursorList<EpisodeBaseModel> cursor = new FlowCursorList<>(false, EpisodeBaseModel.class,
            Condition.column(EpisodeBaseModel$Table.DATA_TYPE).eq(type));
    Map<String, EpisodeBaseModel> all = new HashMap<>();
    for (int i = 0, k = cursor.getCount(); i < k; i++) {
        EpisodeBaseModel ep = (EpisodeBaseModel) createInstanceOf(model);
        if (ep != null) {
            int index = existing.indexOf(ep);
            if (index > -1) {
                ep = existing.get(index);
            } else {
                EpisodeBaseModel item = cursor.getItem(i);
                item.unserialize();
                ep.merge(item);
            }
            if (uniqueSeries) {
                all.put(ep.getSeriesTitle(), ep);
            } else {
                all.put(ep.getHref(), ep);
            }
        }
    }
    cursor.close();
    return new ArrayList<>(all.values());
}
 
开发者ID:nextux,项目名称:sbs-android-tv,代码行数:26,代码来源:ContentDatabaseCache.java


示例2: findProgramStageSection

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Find the associated programStageSection (tab)UID given a dataelement UID
 *
 * @return
 */
public String findProgramStageSection() {

    List<ProgramStageSection> programStageSections = new Select().from(ProgramStageSection.class).as("pss")
            .join(ProgramStageDataElement.class, Join.JoinType.LEFT).as("psde")
            .on(Condition.column(ColumnAlias.columnWithTable("pss", ProgramStageSection$Table.ID))
                    .eq(ColumnAlias.columnWithTable("psde", ProgramStageDataElement$Table.PROGRAMSTAGESECTION)))
            .where(Condition.column(ColumnAlias.columnWithTable("psde", ProgramStageDataElement$Table.DATAELEMENT)).eq(getDataElement().getUid()))
            .queryList();
    if (programStageSections == null) {
        return null;
    }
    for(ProgramStageSection programStageSection:programStageSections){
        if(MetaDataController.getProgramStage(programStageSection.getProgramStage()).getProgram().getUid().equals(programUid))
            return programStageSection.getUid();
    }
    return null;
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:23,代码来源:DataElementExtended.java


示例3: findProgramStageDataElementByDataElementExtended

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Find the associated ProgramStageDataElement (tab) given a DataElementExtended
 *
 * @param dataElementExtended
 * @return
 */
public static ProgramStageDataElement findProgramStageDataElementByDataElementExtended(DataElementExtended dataElementExtended) {
    String dataElementUID=dataElementExtended.getDataElement().getUid();
    String programUID=dataElementExtended.getProgramUid();
    //Find the right 'uid' of the dataelement program
    List <ProgramStageDataElement> programDES = new Select().from(ProgramStageDataElement.class).as("psde")
            .where(Condition.column(ColumnAlias.columnWithTable("psde", ProgramStageDataElement$Table.DATAELEMENT)).eq(dataElementUID))
            .queryList();
    if (programDES == null) {
        return null;
    }
    for(ProgramStageDataElement programStageDataElement:programDES){
        if(MetaDataController.getProgramStage(programStageDataElement.getProgramStage()).getProgram().getUid().equals(programUID))
            return programStageDataElement;
    }
    return null;
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:23,代码来源:DataElementExtended.java


示例4: findOrganisationUnitAttributeValueByCode

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Finds the value of an attribute with the given code in a dataElement
 * @param code
 * @return
 */
public  String findOrganisationUnitAttributeValueByCode(String code){

    OrganisationUnitAttributeValue organisationUnitAttributeValue = new Select().from(OrganisationUnitAttributeValue.class).as("o")
            .join(Attribute.class, Join.JoinType.LEFT).as("a")
            .on(Condition.column(ColumnAlias.columnWithTable("o", OrganisationUnitAttributeValue$Table.ATTRIBUTEID))
                    .eq(ColumnAlias.columnWithTable("a", Attribute$Table.ID)))
            .where(Condition.column(ColumnAlias.columnWithTable("a", Attribute$Table.CODE))
                    .eq(code))
            .and(Condition.column(ColumnAlias.columnWithTable("o", OrganisationUnitAttributeValue$Table.ORGANISATIONUNIT)).is(this.getOrgUnit().getId()))
            .querySingle();

    if(organisationUnitAttributeValue==null){
        return "";
    }
    return organisationUnitAttributeValue.getValue();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:22,代码来源:OrganisationUnitExtended.java


示例5: getProductivityPosition

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
public Integer getProductivityPosition() {

        ProgramAttributeValue programAttributeValue = new Select().from(ProgramAttributeValue.class).as("p")
                .join(Attribute.class, Join.JoinType.LEFT).as("a")
                .on(Condition.column(ColumnAlias.columnWithTable("p", ProgramAttributeValue$Table.ATTRIBUTEID))
                        .eq(ColumnAlias.columnWithTable("a", Attribute$Table.ID)))
                .where(Condition.column(ColumnAlias.columnWithTable("a", Attribute$Table.CODE))
                        .eq(PROGRAM_PRODUCTIVITY_POSITION_ATTRIBUTE_CODE))
                .and(Condition.column(ColumnAlias.columnWithTable("p", ProgramAttributeValue$Table.PROGRAM)).is(this.getProgram().getUid()))
                .querySingle();

        if(programAttributeValue==null){
            return null;
        }

        try {
            return Integer.parseInt(programAttributeValue.getValue());
        }catch(Exception ex){
            Log.e(TAG, String.format("getProductivityPosition(%s) -> %s", this.getProgram().getUid(), ex.getMessage()));
            return null;
        }
    }
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:23,代码来源:ProgramExtended.java


示例6: getProductivity

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Helper method to get the productivity for a given survey.
 * If its orgunit + program combination does NOT have a productivity value then returns 0
 * @param survey
 * @return
 */
public static Integer getProductivity(Survey survey){
    if(survey==null){
        return DEFAULT_PRODUCTIVITY;
    }

    OrgUnit orgUnit = survey.getOrgUnit();
    if(orgUnit==null){
        return DEFAULT_PRODUCTIVITY;
    }

    Program program = survey.getProgram();
    if(program==null){
        return DEFAULT_PRODUCTIVITY;
    }

    OrgUnitProgramRelation orgUnitProgramRelation = new Select().from(OrgUnitProgramRelation.class)
            .where(Condition.column(OrgUnitProgramRelation$Table.ID_ORG_UNIT).eq(orgUnit.getId_org_unit()))
            .and(Condition.column(OrgUnitProgramRelation$Table.ID_PROGRAM).eq(program.getId_program())).querySingle();

    if(orgUnitProgramRelation==null){
        return DEFAULT_PRODUCTIVITY;
    }

    return orgUnitProgramRelation.getProductivity();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:32,代码来源:OrgUnitProgramRelation.java


示例7: listAllByTabsWithoutCs

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
public static List<Question> listAllByTabsWithoutCs(List<Tab> tabs) {

        if (tabs == null || tabs.size() == 0) {
            return new ArrayList();
        }

        Iterator<Tab> iterator = tabs.iterator();
        In in = Condition.column(ColumnAlias.columnWithTable("t", Tab$Table.ID_TAB)).in(Long.toString(iterator.next().getId_tab()));
        while (iterator.hasNext()) {
            in.and(Long.toString(iterator.next().getId_tab()));
        }

        return new Select().from(Question.class).as("q")
                .join(Header.class, Join.JoinType.LEFT).as("h")
                .on(Condition.column(ColumnAlias.columnWithTable("q", Question$Table.ID_HEADER))
                        .eq(ColumnAlias.columnWithTable("h", Header$Table.ID_HEADER)))
                .join(Tab.class, Join.JoinType.LEFT).as("t")
                .on(Condition.column(ColumnAlias.columnWithTable("h", Header$Table.ID_TAB))
                        .eq(ColumnAlias.columnWithTable("t", Tab$Table.ID_TAB)))
                .where(in)
                .and(Condition.column(Question$Table.ID_COMPOSITE_SCORE).isNull())
                .orderBy(Tab$Table.ORDER_POS)
                .orderBy(Question$Table.ORDER_POS).queryList();
    }
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:25,代码来源:Question.java


示例8: listAllByTabs

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
public static List<Question> listAllByTabs(List<Tab> tabs) {

        if (tabs == null || tabs.size() == 0) {
            return new ArrayList();
        }

        Iterator<Tab> iterator = tabs.iterator();
        In in = Condition.column(ColumnAlias.columnWithTable("t", Tab$Table.ID_TAB)).in(Long.toString(iterator.next().getId_tab()));
        while (iterator.hasNext()) {
            in.and(Long.toString(iterator.next().getId_tab()));
        }

        return new Select().from(Question.class).as("q")
                .join(Header.class, Join.JoinType.LEFT).as("h")
                .on(Condition.column(ColumnAlias.columnWithTable("q", Question$Table.ID_HEADER))
                        .eq(ColumnAlias.columnWithTable("h", Header$Table.ID_HEADER)))
                .join(Tab.class, Join.JoinType.LEFT).as("t")
                .on(Condition.column(ColumnAlias.columnWithTable("h", Header$Table.ID_TAB))
                        .eq(ColumnAlias.columnWithTable("t", Tab$Table.ID_TAB)))
                .where(in)
                .orderBy(Tab$Table.ORDER_POS)
                .orderBy(Question$Table.ORDER_POS).queryList();
    }
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:24,代码来源:Question.java


示例9: listByProgram

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Returns all the questions that belongs to a program
 *
 * @param program
 * @return
 */
public static List<Question> listByProgram(Program program) {
    if (program == null || program.getId_program() == null) {
        return new ArrayList();
    }


    //return Question.findWithQuery(Question.class, LIST_ALL_BY_PROGRAM, program.getId().toString());


    return new Select().all().from(Question.class).as("q")
            .join(Header.class, Join.JoinType.LEFT).as("h")
            .on(Condition.column(ColumnAlias.columnWithTable("q", Question$Table.ID_HEADER))
                    .eq(ColumnAlias.columnWithTable("h", Header$Table.ID_HEADER)))
            .join(Tab.class, Join.JoinType.LEFT).as("t")
            .on(Condition.column(ColumnAlias.columnWithTable("h", Header$Table.ID_TAB))
                    .eq(ColumnAlias.columnWithTable("t", Tab$Table.ID_TAB)))
            .where(Condition.column(ColumnAlias.columnWithTable("t", Tab$Table.ID_PROGRAM))
                    .eq(program.getId_program()))
            .orderBy(Tab$Table.ORDER_POS)
            .orderBy(Question$Table.ORDER_POS).queryList();

}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:29,代码来源:Question.java


示例10: parentSavedValues

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
public List<Value> parentSavedValues(Float idSurvey){

        List<Value> values = new Select().from(Value.class).as("v")
                .join(QuestionOption.class, Join.JoinType.LEFT).as("qo")
                .on(
                        Condition.column(ColumnAlias.columnWithTable("v", Value$Table.ID_QUESTION))
                                .eq(ColumnAlias.columnWithTable("qo", QuestionOption$Table.ID_QUESTION)),
                        Condition.column(ColumnAlias.columnWithTable("v", Value$Table.ID_OPTION))
                                .eq(ColumnAlias.columnWithTable("qo", QuestionOption$Table.ID_OPTION)))
                .join(Match.class, Join.JoinType.LEFT).as("m")
                .on(
                        Condition.column(ColumnAlias.columnWithTable("qo", QuestionOption$Table.ID_MATCH))
                                .eq(ColumnAlias.columnWithTable("m", Match$Table.ID_MATCH)))
                .join(QuestionRelation.class, Join.JoinType.LEFT).as("qr")
                .on(
                        Condition.column(ColumnAlias.columnWithTable("m", Match$Table.ID_QUESTION_RELATION))
                                .eq(ColumnAlias.columnWithTable("qr", QuestionRelation$Table.ID_QUESTION_RELATION)))
                //Parent child relationship
                .where(Condition.column(ColumnAlias.columnWithTable("qr", QuestionRelation$Table.OPERATION)).eq(1))
                //For the given survey
                .and(Condition.column(ColumnAlias.columnWithTable("v", Value$Table.ID_SURVEY)).eq(idSurvey))
                //The child question in the relationship is 'this'
                .and(Condition.column(ColumnAlias.columnWithTable("qr", QuestionRelation$Table.ID_QUESTION)).eq(this.getId_question()))
                .queryList();
        return values;
    }
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:27,代码来源:Question.java


示例11: getCollections

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
private LinkedHashMap<String, List<EpisodeBaseModel>> getCollections(Class<?> model, List<EpisodeBaseModel> existing) {
    LinkedHashMap<String, List<EpisodeBaseModel>> collections = new LinkedHashMap<>();
    FlowCursorList<EpisodeBaseModel> cursor = new FlowCursorList<>(false,
            (new Select()).from(EpisodeBaseModel.class)
                    .where(Condition.column(EpisodeBaseModel$Table.DATA_TYPE).eq(TYPE_COLLECTIONS))
                    .orderBy(true, EpisodeBaseModel$Table.DATA_COLLECTION_INDEX));
    for (int i = 0, k = cursor.getCount(); i < k; i++) {
        EpisodeBaseModel item = cursor.getItem(i);
        item.unserialize();
        int index = existing.indexOf(item);
        EpisodeBaseModel ep;
        if (index > -1) {
            ep = existing.get(index);
        } else {
            ep = (EpisodeBaseModel) createInstanceOf(model);
            if (ep != null) {
                ep.merge(item);
            }
        }
        if (ep != null) {
            if (!collections.containsKey(item.DATA_COLLECTION_KEY)) {
                collections.put(item.DATA_COLLECTION_KEY, new ArrayList<EpisodeBaseModel>());
            }
            collections.get(item.DATA_COLLECTION_KEY).add(ep);
        }
    }
    for (Map.Entry<String, List<EpisodeBaseModel>> collection : collections.entrySet()) {
        Log.d(TAG, "Loaded collection: " + collection.getKey() + " => " + collection.getValue().size());
    }
    return collections;
}
 
开发者ID:nextux,项目名称:sbs-android-tv,代码行数:32,代码来源:ContentDatabaseCache.java


示例12: hasConflict

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Checks whether the given event contains errors in SDK FailedItem table or has been successful.
 * If not return null, it is becouse this item had a conflict.
 * @param localId
 * @return
 */
private FailedItem hasConflict(long localId){
    return  new Select()
            .from(FailedItem.class)
            .where(Condition.column(FailedItem$Table.ITEMID)
                    .is(localId)).querySingle();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:13,代码来源:ConvertToSDKVisitor.java


示例13: getValues

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
@OneToMany(methods = {OneToMany.Method.SAVE, OneToMany.Method.DELETE}, variableName = "values")
public List<Value> getValues() {
    if(values==null){
        values = new Select()
                .from(Value.class)
                .where(Condition.column(Value$Table.ID_QUESTION)
                        .eq(this.getId_question())).queryList();
    }
    return values;
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:11,代码来源:Question.java


示例14: getCompositeScoreChildren

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
public List<CompositeScore> getCompositeScoreChildren() {
    if (this.compositeScoreChildren == null){
        this.compositeScoreChildren = new Select()
                .from(CompositeScore.class)
                .where(Condition.column(CompositeScore$Table.ID_PARENT).eq(this.getId_composite_score()))
                .orderBy(CompositeScore$Table.ORDER_POS)
                .queryList();
    }
    return this.compositeScoreChildren;
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:11,代码来源:CompositeScore.java


示例15: findProgramStageSectionUIDByDataElementUID

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Find the associated programStageSection (tab)UID given a dataelement UID
 *
 * @param dataElementUID
 * @return
 */
public static String findProgramStageSectionUIDByDataElementUID(String dataElementUID) {
    //Find the right 'uid' of the dataelement program
    ProgramStageSection programSS = new Select().from(ProgramStageSection.class).as("pss")
            .join(ProgramStageDataElement.class, Join.JoinType.LEFT).as("psde")
            .on(Condition.column(ColumnAlias.columnWithTable("pss", ProgramStageSection$Table.ID))
                    .eq(ColumnAlias.columnWithTable("psde", ProgramStageDataElement$Table.PROGRAMSTAGESECTION)))
            .where(Condition.column(ColumnAlias.columnWithTable("psde", ProgramStageDataElement$Table.DATAELEMENT)).eq(dataElementUID))
            .querySingle();
    if (programSS == null) {
        return null;
    }
    return programSS.getUid();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:20,代码来源:DataElementExtended.java


示例16: getChildren

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
public List<OrgUnit> getChildren(){
    if(this.children==null){
        this.children = new Select().from(OrgUnit.class)
                .where(Condition.column(OrgUnit$Table.ID_PARENT).eq(this.getId_org_unit())).queryList();
    }
    return children;
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:8,代码来源:OrgUnit.java


示例17: findProgramStageSectionOrderDataElementOrderByDataElementUID

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Find the order from dataelement in programStage
 *
 * @param dataElementUID
 * @return
 */
public static String findProgramStageSectionOrderDataElementOrderByDataElementUID(String dataElementUID) {
    //Find the right 'uid' of the dataelement program
    ProgramStageSection programSS = new Select().from(ProgramStageSection.class).as("pss")
            .join(ProgramStageDataElement.class, Join.JoinType.LEFT).as("psd")
            .on(Condition.column(ColumnAlias.columnWithTable("psd", ProgramStageDataElement$Table.PROGRAMSTAGESECTION))
                    .eq(ColumnAlias.columnWithTable("pss", ProgramStageSection$Table.ID)))
            .where(Condition.column(ColumnAlias.columnWithTable("psd", ProgramStageDataElement$Table.DATAELEMENT)).eq(dataElementUID))
            .querySingle();
    if (programSS == null) {
        return null;
    }
    return programSS.getSortOrder()+"";
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:20,代码来源:DataElementExtended.java


示例18: findLocalCopy

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Returns a media that holds a reference to the same resource with an already downloaded copy of the file.
 * @return
 */
public Media findLocalCopy(){
    return new Select().from(Media.class)
            .where(Condition.column(Media$Table.FILENAME).isNotNull())
            .and(Condition.column(Media$Table.ID_MEDIA).isNot(this.id_media))
            .and(Condition.column(Media$Table.RESOURCE_URL).is(this.resource_url))
            .querySingle();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:12,代码来源:Media.java


示例19: getOrganisationUnitGroups

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Get all the OU groups given a OU id
 * @param id
 * @return
 */
public static List<OrganisationUnitGroup> getOrganisationUnitGroups(String id){
    return new Select()
            .from(OrganisationUnitGroup.class)
            .where(Condition.column(OrganisationUnitGroup$Table.ORGANISATIONUNITID)
                    .eq(id))
            .queryList();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:13,代码来源:OrganisationUnitExtended.java


示例20: getOrganisationUnit

import com.raizlabs.android.dbflow.sql.builder.Condition; //导入依赖的package包/类
/**
 * Get an OU given its id
 * @param id
 * @return
 */
public static OrganisationUnit getOrganisationUnit(String id){
    return new Select()
            .from(OrganisationUnit.class)
            .where(Condition.column(OrganisationUnit$Table.ID)
                    .eq(id))
            .querySingle();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:13,代码来源:OrganisationUnitExtended.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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