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


Java Property类代码示例

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


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

示例1: reflectProperties

import org.greenrobot.greendao.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:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:DaoConfig.java

示例2: setUp

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    super.setUp();
    Property[] columns = daoAccess.getProperties();
    for (Property column : columns) {
        if (column.primaryKey) {
            if (pkColumn != null) {
                throw new RuntimeException("Test does not work with multiple PK columns");
            }
            pkColumn = column;
        }
    }
    if (pkColumn == null) {
        throw new RuntimeException("Test does not work without a PK column");
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:AbstractDaoTestSinglePk.java

示例3: testMockitoMocks

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Test
public void testMockitoMocks() {
    mock(DaoMaster.class).newSession();
    mock(DaoSession.class).getDatabase();
    mock(Database.class).getRawDatabase();
    mock(DatabaseStatement.class).execute();
    mock(IdentityScope.class).clear();
    mock(AbstractDao.class).queryBuilder();
    mock(MinimalEntityDao.class).queryBuilder();
    mock(MinimalEntity.class).getId();
    mock(Query.class).forCurrentThread();
    mock(QueryBuilder.class).build();
    mock(CountQuery.class).forCurrentThread();
    mock(DeleteQuery.class).forCurrentThread();
    mock(Join.class).getTablePrefix();
    mock(LazyList.class).getLoadedCount();
    mock(WhereCondition.class).appendValuesTo(null);
    mock(Property.class).isNull();
    mock(DaoException.class).getMessage();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:OptionalDepedenciesTest.java

示例4: getAll

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<T> getAll(long deviceId) {

    if (deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:20,代码来源:CommonEventDaoImpl.java

示例5: getFirstN

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<T> getFirstN(int amount, long deviceId) {

    if (amount <= 0 || deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(property.eq(deviceId))
                    .limit(amount)
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:CommonEventDaoImpl.java

示例6: getAllByEventId

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbCalendarReminderSensor> getAllByEventId(long eventId, long deviceId) {

    if (eventId <= 0 || deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.EventId.eq(eventId))
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:CalendarReminderSensorDaoImpl.java

示例7: getAllUpdated

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbCalendarSensor> getAllUpdated(long deviceId) {

    if (deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.IsUpdated.eq(Boolean.TRUE))
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:CalendarSensorDaoImpl.java

示例8: getAll

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbContactNumberSensor> getAll(Long contactId, long deviceId) {

    if (contactId == null || deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.ContactId.eq(contactId))
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:ContactNumberSensorDaoImpl.java

示例9: getAll

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbContactEmailSensor> getAll(Long contactId, long deviceId) {

    if (contactId == null || deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.ContactId.eq(contactId))
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:ContactEmailSensorDaoImpl.java

示例10: getAllUpdated

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbContactSensor> getAllUpdated(long deviceId) {

    if (deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.IsUpdated.eq(Boolean.TRUE))
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:ContactSensorDaoImpl.java

示例11: getAllUpdated

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbCallLogSensor> getAllUpdated(long deviceId) {

    if (deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.IsUpdated.eq(Boolean.TRUE))
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:CallLogSensorDaoImpl.java

示例12: getAllBackground

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbNetworkTrafficSensor> getAllBackground(long deviceId) {

    if (deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.Background.eq(Boolean.TRUE))
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:NetworkTrafficSensorDaoImpl.java

示例13: getAllForeground

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbNetworkTrafficSensor> getAllForeground(long deviceId) {

    if (deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.Background.eq(Boolean.FALSE))
                    .where(property.eq(deviceId))
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:21,代码来源:NetworkTrafficSensorDaoImpl.java

示例14: getFirstNBackground

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbNetworkTrafficSensor> getFirstNBackground(int amount, long deviceId) {

    if (amount <= 0 || deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.Background.eq(Boolean.TRUE))
                    .where(property.eq(deviceId))
                    .limit(amount)
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:22,代码来源:NetworkTrafficSensorDaoImpl.java

示例15: getFirstNForeground

import org.greenrobot.greendao.Property; //导入依赖的package包/类
@Override
public List<DbNetworkTrafficSensor> getFirstNForeground(int amount, long deviceId) {

    if (amount <= 0 || deviceId < 0) {
        return Collections.emptyList();
    }

    for (Property property : properties) {
        if (property.name.equals(DEVICE_ID_FIELD_NAME)) {
            return dao
                    .queryBuilder()
                    .where(Properties.Background.eq(Boolean.FALSE))
                    .where(property.eq(deviceId))
                    .limit(amount)
                    .build()
                    .list();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:22,代码来源:NetworkTrafficSensorDaoImpl.java


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