本文整理了Java中de.greenrobot.daogenerator.Entity.addDateProperty()
方法的一些代码示例,展示了Entity.addDateProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.addDateProperty()
方法的具体详情如下:
包路径:de.greenrobot.daogenerator.Entity
类名称:Entity
方法名:addDateProperty
暂无
代码示例来源:origin: yangblocker/GreenDao-SQLCipher
private static void addNote(Schema schema) {
Entity note = schema.addEntity("Note");
note.addIdProperty();
note.addStringProperty("text").notNull();
note.addStringProperty("comment");
note.addDateProperty("date");
}
代码示例来源:origin: tangqi92/MyGreenDAO
/**
* @param schema
*/
private static void addNote(Schema schema) {
// 一个实体(类)就关联到数据库中的一张表,此处表名为「Note」(既类名)
Entity note = schema.addEntity("Note");
// 你也可以重新给表命名
// note.setTableName("NODE");
// greenDAO 会自动根据实体类的属性值来创建表字段,并赋予默认值
// 接下来你便可以设置表中的字段:
note.addIdProperty();
note.addStringProperty("text").notNull();
// 与在 Java 中使用驼峰命名法不同,默认数据库中的命名是使用大写和下划线来分割单词的。
// For example, a property called “creationDate” will become a database column “CREATION_DATE”.
note.addStringProperty("comment");
note.addDateProperty("date");
}
}
代码示例来源:origin: ghbhaha/MyWeather
private static void addForeCast(Schema schema) {
Entity weekForeCast = schema.addEntity("WeekForeCast");
weekForeCast.addStringProperty("areaid");
weekForeCast.addDateProperty("weatherDate");
weekForeCast.addStringProperty("weatherConditionStart");
weekForeCast.addStringProperty("weatherConditionEnd");
weekForeCast.addIntProperty("tempH");
weekForeCast.addIntProperty("tempL");
weekForeCast.addStringProperty("fx");
weekForeCast.addStringProperty("fj");
weekForeCast.addIntProperty("rainPerCent");
}
代码示例来源:origin: ghbhaha/MyWeather
private static void addRealWeather(Schema schema) {
Entity realWeather = schema.addEntity("RealWeather");
realWeather.addStringProperty("areaid");
realWeather.addStringProperty("areaName");
realWeather.addStringProperty("weatherCondition");
realWeather.addStringProperty("fx");
realWeather.addStringProperty("fj");
realWeather.addIntProperty("temp");
realWeather.addIntProperty("feeltemp");
realWeather.addIntProperty("shidu");
realWeather.addStringProperty("sunrise");
realWeather.addStringProperty("sundown");
realWeather.addDateProperty("lastUpdate");
}
代码示例来源:origin: devinhu/androidone
@SuppressWarnings("unused")
private static void addCustomerOrder(Schema schema) {
Entity customer = schema.addEntity("Customer");
customer.addIdProperty();
customer.addStringProperty("name").notNull();
Entity order = schema.addEntity("Order");
order.setTableName("ORDERS"); // "ORDER" is a reserved keyword
order.addIdProperty();
Property orderDate = order.addDateProperty("date").getProperty();
Property customerId = order.addLongProperty("customerId").notNull().getProperty();
order.addToOne(customer, customerId);
ToMany customerToOrders = customer.addToMany(order, customerId);
customerToOrders.setName("orders");
customerToOrders.orderAsc(orderDate);
}
代码示例来源:origin: yangblocker/GreenDao-SQLCipher
private static void addCustomerOrder(Schema schema) {
Entity customer = schema.addEntity("Customer");
customer.addIdProperty();
customer.addStringProperty("name").notNull();
Entity order = schema.addEntity("Order");
order.setTableName("ORDERS"); // "ORDER" is a reserved keyword
order.addIdProperty();
Property orderDate = order.addDateProperty("date").getProperty();
Property customerId = order.addLongProperty("customerId").notNull().getProperty();
order.addToOne(customer, customerId);
ToMany customerToOrders = customer.addToMany(order, customerId);
customerToOrders.setName("orders");
customerToOrders.orderAsc(orderDate);
}
内容来源于网络,如有侵权,请联系作者删除!