當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。