当前位置: 首页>>代码示例>>Java>>正文


Java Property类代码示例

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


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

示例1: getFollowers

import de.greenrobot.dao.Property; //导入依赖的package包/类
@Override
public List<BUser> getFollowers() {
    List<BUser> users = new ArrayList<BUser>();

    List<FollowerLink> followers = DaoCore.fetchEntitiesWithProperties(FollowerLink.class,
            new Property[]{FollowerLinkDao.Properties.LinkOwnerBUserDaoId, FollowerLinkDao.Properties.Type},
            getId(), FollowerLink.Type.FOLLOWER);

    for (FollowerLink f : followers)
    {
        if (f!=null)
            users.add(f.getBUser());
    }

    return users;
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:17,代码来源:BUser.java

示例2: getFollows

import de.greenrobot.dao.Property; //导入依赖的package包/类
@Override
public List<BUser> getFollows() {
    List<BUser> users = new ArrayList<BUser>();

    List<FollowerLink> followers = DaoCore.fetchEntitiesWithProperties(FollowerLink.class,
            new Property[]{FollowerLinkDao.Properties.LinkOwnerBUserDaoId, FollowerLinkDao.Properties.Type},
            getId(), FollowerLink.Type.FOLLOWS);

    for (FollowerLink f : followers)
    {
        if (f!=null)
            users.add(f.getBUser());
    }

    return users;
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:17,代码来源:BUser.java

示例3: getGBActivitySamples

import de.greenrobot.dao.Property; //导入依赖的package包/类
protected List<T> getGBActivitySamples(int timestamp_from, int timestamp_to, int activityType) {
    if (getRawKindSampleProperty() == null && activityType != ActivityKind.TYPE_ALL) {
        // if we do not have a raw kind property we cannot query anything else then TYPE_ALL
        return Collections.emptyList();
    }
    QueryBuilder<T> qb = getSampleDao().queryBuilder();
    Property timestampProperty = getTimestampSampleProperty();
    Device dbDevice = DBHelper.findDevice(getmDevice(), getSession());
    if (dbDevice == null) {
        // no device, no samples
        return Collections.emptyList();
    }
    Property deviceProperty = getDeviceIdentifierSampleProperty();
    qb.where(deviceProperty.eq(dbDevice.getId()), timestampProperty.ge(timestamp_from))
        .where(timestampProperty.le(timestamp_to), getClauseForActivityType(qb, activityType));
    List<T> samples = qb.build().list();
    for (T sample : samples) {
        sample.setProvider(this);
    }
    return samples;
}
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:22,代码来源:AbstractSampleProvider.java

示例4: getActivityTypeConditions

import de.greenrobot.dao.Property; //导入依赖的package包/类
private WhereCondition getActivityTypeConditions(QueryBuilder qb, int[] dbActivityTypes) {
    // What a crappy QueryBuilder API ;-( QueryBuilder.or(WhereCondition[]) with a runtime array length
    // check would have worked just fine.
    if (dbActivityTypes.length == 0) {
        return null;
    }
    Property rawKindProperty = getRawKindSampleProperty();
    if (dbActivityTypes.length == 1) {
        return rawKindProperty.eq(dbActivityTypes[0]);
    }
    if (dbActivityTypes.length == 2) {
        return qb.or(rawKindProperty.eq(dbActivityTypes[0]),
                rawKindProperty.eq(dbActivityTypes[1]));
    }
    final int offset = 2;
    int len = dbActivityTypes.length - offset;
    WhereCondition[] trailingConditions = new WhereCondition[len];
    for (int i = 0; i < len; i++) {
        trailingConditions[i] = rawKindProperty.eq(dbActivityTypes[i + offset]);
    }
    return qb.or(rawKindProperty.eq(dbActivityTypes[0]),
            rawKindProperty.eq(dbActivityTypes[1]),
            trailingConditions);
}
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:25,代码来源:AbstractSampleProvider.java

示例5: orderAscOrDesc

import de.greenrobot.dao.Property; //导入依赖的package包/类
private transient void orderAscOrDesc(String s, Property aproperty[])
{
    int i = aproperty.length;
    for (int j = 0; j < i; j++)
    {
        Property property = aproperty[j];
        checkOrderBuilder();
        append(orderBuilder, property);
        if (java/lang/String.equals(property.type))
        {
            orderBuilder.append(" COLLATE LOCALIZED");
        }
        orderBuilder.append(s);
    }

}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:17,代码来源:QueryBuilder.java

示例6: getDBLuaFileByVersion

import de.greenrobot.dao.Property; //导入依赖的package包/类
private String getDBLuaFileByVersion(String s)
{
    LuaZipFileDao luazipfiledao = DaoManager.getInstance().getLuaZipFileDao();
    int j = (int)luazipfiledao.count();
    Debug.i("chenee", (new StringBuilder()).append("lzipDao.count:").append(j).toString());
    if (j > 0)
    {
        QueryBuilder querybuilder = luazipfiledao.queryBuilder();
        Property aproperty[] = new Property[1];
        aproperty[0] = de.greenrobot.daobracelet.LuaZipFileDao.Properties.Version;
        querybuilder.orderDesc(aproperty);
        querybuilder.where(de.greenrobot.daobracelet.LuaZipFileDao.Properties.Version.eq(s), new WhereCondition[0]);
        LuaZipFile luazipfile = (LuaZipFile)querybuilder.listLazy().get(0);
        String s1 = luazipfile.getVersion();
        Debug.i("chenee", (new StringBuilder()).append("luaZipFile.version:").append(s1).toString());
        return unzip(luazipfile.getZipFile());
    } else
    {
        Debug.e("chenee", (new StringBuilder()).append("read DB zip failed,version:").append(s).toString());
        return null;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:23,代码来源:LuaManager.java

示例7: onClick

import de.greenrobot.dao.Property; //导入依赖的package包/类
@Override
public void onClick(View v) {
	switch (v.getId()) {
	case R.id.reorder_ok_button:
		RadioGroup radioGroup = (RadioGroup) getView().findViewById(R.id.reorder_radiogroup);
		int checkedRadioButtonId = radioGroup.getCheckedRadioButtonId();
		boolean asc = true;
		if(checkedRadioButtonId == R.id.reorder_desc_rbutton)
			asc = false;
		Property property = spinnerAdapter.getItem(spinner.getSelectedItemPosition());
		if(listener != null)
			listener.onReordering(property, asc);
	default:
		dismiss();
	}
}
 
开发者ID:leofarage,项目名称:ckl-challenge,代码行数:17,代码来源:ReorderingDialog.java

示例8: reflectProperties

import de.greenrobot.dao.Property; //导入依赖的package包/类
private static Property[] reflectProperties(Class<? extends AbstractDao<?, ?>> daoClass)
        throws ClassNotFoundException, IllegalArgumentException, IllegalAccessException {
    Class<?> propertiesClass = Class.forName(daoClass.getName() + "$Properties");
    Field[] fields = propertiesClass.getDeclaredFields();

    ArrayList<Property> propertyList = new ArrayList<Property>();
    final int modifierMask = Modifier.STATIC | Modifier.PUBLIC;
    for (Field field : fields) {
        // There might be other fields introduced by some tools, just ignore them (see issue #28)
        if ((field.getModifiers() & modifierMask) == modifierMask) {
            Object fieldValue = field.get(null);
            if (fieldValue instanceof Property) {
                propertyList.add((Property) fieldValue);
            }
        }
    }

    Property[] properties = new Property[propertyList.size()];
    for (Property property : propertyList) {
        if (properties[property.ordinal] != null) {
            throw new DaoException("Duplicate property ordinals");
        }
        properties[property.ordinal] = property;
    }
    return properties;
}
 
开发者ID:itsmechlark,项目名称:greendao-cipher,代码行数:27,代码来源:DaoConfig.java

示例9: hasUser

import de.greenrobot.dao.Property; //导入依赖的package包/类
public boolean hasUser(BUser user){

        com.braunster.chatsdk.dao.UserThreadLink data =
                DaoCore.fetchEntityWithProperties(com.braunster.chatsdk.dao.UserThreadLink.class,
                        new Property[]{UserThreadLinkDao.Properties.BThreadDaoId, UserThreadLinkDao.Properties.BUserDaoId}, getId(), user.getId());

/*        for (BUser u : getUsers())
        {
            if (u.getId().longValue() ==  user.getId().longValue())
               return true;
        }*/

        return data != null;
    }
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:15,代码来源:BThread.java

示例10: hasThread

import de.greenrobot.dao.Property; //导入依赖的package包/类
public boolean hasThread(BThread thread){
    com.braunster.chatsdk.dao.UserThreadLink data =
            DaoCore.fetchEntityWithProperties(com.braunster.chatsdk.dao.UserThreadLink.class,
                    new Property[]{UserThreadLinkDao.Properties.BThreadDaoId, UserThreadLinkDao.Properties.BUserDaoId}, thread.getId(), getId());

    return data != null;
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:8,代码来源:BUser.java

示例11: fetchEntityWithProperty

import de.greenrobot.dao.Property; //导入依赖的package包/类
/** Fetch an entity for given property and value. If more then one found the first will be returned.*/
public static <T extends Entity> T fetchEntityWithProperty(Class<T> c, Property property,Object value){
    QueryBuilder<T> qb = daoSession.queryBuilder(c);
    qb.where(property.eq(value));

    List<T> list = qb.list();
    if (list != null && list.size()>0)
        return list.get(0) ;
    else return null;
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:11,代码来源:DaoCore.java

示例12: fetchEntityWithProperties

import de.greenrobot.dao.Property; //导入依赖的package包/类
public static <T extends Entity> T fetchEntityWithProperties(Class<T> c, Property properties[],Object... values){
    List<T> list = fetchEntitiesWithPropertiesAndOrder(c, null, -1, properties, values);

    if (list == null || list.size() == 0)
        return null;

    return list.get(0);
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:9,代码来源:DaoCore.java

示例13: fetchEntitiesWithPropertiesAndOrder

import de.greenrobot.dao.Property; //导入依赖的package包/类
public static <T extends Entity> List<T>  fetchEntitiesWithPropertiesAndOrder(Class<T> c, Property whereOrder, int order, Property properties[], Object... values){

        if (values == null || properties == null)
            throw new NullPointerException("You must have at least one value and one property");

        if (values.length != properties.length)
            throw new IllegalArgumentException("Values size should match properties size");

        QueryBuilder<T> qb = daoSession.queryBuilder(c);
        qb.where(properties[0].eq(values[0]));

        for (int i = 0 ; i < values.length ; i++)
            qb.where(properties[i].eq(values[i]));

        if (whereOrder != null && order != -1)
            switch (order)
            {
                case ORDER_ASC:
                    qb.orderAsc(whereOrder);
                    break;

                case ORDER_DESC:
                    qb.orderDesc(whereOrder);
                    break;
            }

        return qb.list();
    }
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:29,代码来源:DaoCore.java

示例14: fetchEntitiesWithPropertiesAndOrderAndLimit

import de.greenrobot.dao.Property; //导入依赖的package包/类
public static <T extends Entity> List<T>  fetchEntitiesWithPropertiesAndOrderAndLimit(Class<T> c, int limit, Property whereOrder, int order, Property properties[], Object... values){

        if (values == null || properties == null)
            throw new NullPointerException("You must have at least one value and one property");

        if (values.length != properties.length)
            throw new IllegalArgumentException("Values size should match properties size");

        QueryBuilder<T> qb = daoSession.queryBuilder(c);
        qb.where(properties[0].eq(values[0]));

        if (values.length > 1)
            for (int i = 0 ; i < values.length ; i++)
                qb.where(properties[i].eq(values[i]));

        if (whereOrder != null && order != -1)
            switch (order)
            {
                case ORDER_ASC:
                    qb.orderAsc(whereOrder);
                    break;

                case ORDER_DESC:
                    qb.orderDesc(whereOrder);
                    break;
            }

        if (limit != -1)
            qb.limit(limit);

        return qb.listLazy();
    }
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:33,代码来源:DaoCore.java

示例15: getList

import de.greenrobot.dao.Property; //导入依赖的package包/类
public static List getList(AbstractDao dao, Property orderProperty, WhereCondition cond, WhereCondition... condMore) {
    setIfLog();
    List indexFavList = dao.queryBuilder()
            .where(cond, condMore)
            .orderAsc(orderProperty)
            .list();
    return indexFavList;
}
 
开发者ID:DroidKOF,项目名称:pineapple,代码行数:9,代码来源:GreenDaoUtils.java


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