本文整理匯總了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;
}
示例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");
}
}
示例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();
}
示例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