本文整理了Java中de.greenrobot.daogenerator.Entity.getProperties()
方法的一些代码示例,展示了Entity.getProperties()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getProperties()
方法的具体详情如下:
包路径:de.greenrobot.daogenerator.Entity
类名称:Entity
方法名:getProperties
[英]Internal property used by templates, don't use during entity definition.
[中]模板使用的内部属性,在实体定义期间不使用。
代码示例来源:origin: Raizlabs/AndroidDatabaseLibraryComparison
public static void main(String[] args) {
Schema schema = new Schema(1, "com.raizlabs.android.databasecomparison.greendao.gen");
Entity simpleAddressItem = getAddressItemEntity(schema, "SimpleAddressItem");
Entity addressItem = getAddressItemEntity(schema, "AddressItem");
Entity contactItem = getContactItemEntity(schema);
Entity addressBook = getAddressBookEntity(schema);
addressItem.addToOne(addressBook, addressItem.getProperties().get(0));
contactItem.addToOne(addressBook, contactItem.getProperties().get(0));
addressBook.addToMany(addressItem, addressItem.getProperties().get(0));
addressBook.addToMany(contactItem, contactItem.getProperties().get(0));
try {
new DaoGenerator().generateAll(schema,
"../app/src/main/java");
} catch (Exception e) {
e.printStackTrace();
}
}
代码示例来源:origin: devinhu/androidone
@Test
public void testMinimalSchema() throws Exception {
Schema schema = new Schema(1, "de.greenrobot.testdao");
Entity adressTable = schema.addEntity("Adresse");
Property idProperty = adressTable.addIdProperty().getProperty();
adressTable.addIntProperty("count").index();
adressTable.addIntProperty("dummy").notNull();
assertEquals(1, schema.getEntities().size());
assertEquals(3, adressTable.getProperties().size());
File daoFile = new File("test-out/de/greenrobot/testdao/" + adressTable.getClassName() + "Dao.java");
daoFile.delete();
assertFalse(daoFile.exists());
new DaoGenerator().generateAll(schema, "test-out");
assertEquals("PRIMARY KEY", idProperty.getConstraints());
assertTrue(daoFile.toString(), daoFile.exists());
}
内容来源于网络,如有侵权,请联系作者删除!