Java Code Examples for de.greenrobot.daogenerator.Entity#addDateProperty()

The following examples show how to use de.greenrobot.daogenerator.Entity#addDateProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DBClass.java    From MeiZiNews with MIT License 6 votes vote down vote up
private static void addHtml(Schema schema) {

        // 实体类
        Entity mHtmlEntity = schema.addEntity("HtmlEntity");//表名

        //列名
        mHtmlEntity.addIdProperty();//主键id
        mHtmlEntity.addStringProperty("url");//连接
        mHtmlEntity.addStringProperty("type");//类型
        mHtmlEntity.addStringProperty("title");//标题
        mHtmlEntity.addStringProperty("html");//html
        mHtmlEntity.addStringProperty("summary");//总结
        mHtmlEntity.addStringProperty("collect");//是否收藏



        mHtmlEntity.addDateProperty("hireDate");


        // 收藏实体类
        Entity mCollectEntity = schema.addEntity("CollectEntity");//表名
        mCollectEntity.addIdProperty();//主键id
        Property htmlID =   mCollectEntity.addLongProperty("html_id").getProperty();//收藏的id
        mCollectEntity.addStringProperty("collect");//是否收藏
        mCollectEntity.addToOne(mHtmlEntity, htmlID);
    }
 
Example 2
Source File: BrainphaserDaoGenerator.java    From BrainPhaser with GNU General Public License v3.0 5 votes vote down vote up
public static Entity createCompletedEntity(Schema schema) {
    Entity completed = schema.addEntity("Completion");
    completed.addIdProperty();
    completed.addIntProperty("stage");
    completed.addDateProperty("lastCompleted");

    return completed;
}
 
Example 3
Source File: BrainphaserDaoGenerator.java    From BrainPhaser with GNU General Public License v3.0 5 votes vote down vote up
public static Entity createStatisticsEntity(Schema schema) {
    Entity completed = schema.addEntity("Statistics");
    completed.addIdProperty();
    completed.addBooleanProperty("succeeded");
    completed.addDateProperty("time");

    return completed;
}
 
Example 4
Source File: BrainphaserDaoGenerator.java    From BrainPhaser with GNU General Public License v3.0 5 votes vote down vote up
public static Entity createSettingsEntity(Schema schema) {
    Entity settings = schema.addEntity("Settings");

    settings.addIdProperty();
    settings.addDateProperty("timeBoxStage1");
    settings.addDateProperty("timeBoxStage2");
    settings.addDateProperty("timeBoxStage3");
    settings.addDateProperty("timeBoxStage4");
    settings.addDateProperty("timeBoxStage5");
    settings.addDateProperty("timeBoxStage6");

    return settings;
}
 
Example 5
Source File: DBClass02.java    From MeiZiNews with MIT License 5 votes vote down vote up
private static void addCollect(Schema schema) {

        // 实体类
        Entity mCollectEntity = schema.addEntity("CollectEntity");//表名

        //列名
        mCollectEntity.addIdProperty();//主键id
        mCollectEntity.addStringProperty("url");//连接
        mCollectEntity.addStringProperty("type");//连接类型
        mCollectEntity.addStringProperty("text");//名字

        mCollectEntity.addDateProperty("hireDate");
    }
 
Example 6
Source File: DBClass02.java    From MeiZiNews with MIT License 5 votes vote down vote up
private static void addTokyopornVideo(Schema schema) {

        // 实体类
        Entity mTokyopornVideoEntity = schema.addEntity("TokyopornVideoEntity");//表名

        //列名
        mTokyopornVideoEntity.addIdProperty();//主键id
        mTokyopornVideoEntity.addStringProperty("url");//连接
        mTokyopornVideoEntity.addStringProperty("html");//html
        mTokyopornVideoEntity.addStringProperty("text");//名字
        mTokyopornVideoEntity.addStringProperty("videoUrl");//video url

        mTokyopornVideoEntity.addDateProperty("hireDate");
    }
 
Example 7
Source File: MyDaoGenerator.java    From MyWeather with Apache License 2.0 5 votes vote down vote up
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");
}
 
Example 8
Source File: MyDaoGenerator.java    From MyWeather with Apache License 2.0 5 votes vote down vote up
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");
}
 
Example 9
Source File: DbDaoGenerator.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
private static void addNote(Schema schema) {
    Entity note = schema.addEntity("Brand");
    note.addIdProperty();
    note.addStringProperty("brandName").notNull();
    note.addStringProperty("brandId").notNull();
    note.addDateProperty("brandImageUri");
    note.addStringProperty("brandInfos");
    note.setHasKeepSections(true);
    note.setSkipGeneration(true);
}
 
Example 10
Source File: DbDaoGenerator.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
private static void addNote(Schema schema) {
    Entity note = schema.addEntity("Brand");
    note.addIdProperty();
    note.addStringProperty("brandName").notNull();
    note.addStringProperty("brandId").notNull();
    note.addDateProperty("brandImageUri");
    note.addStringProperty("brandInfos");
    note.setHasKeepSections(true);
    note.setSkipGeneration(true);
}
 
Example 11
Source File: Generator.java    From android-opensource-library-56 with Apache License 2.0 5 votes vote down vote up
private static void createTodoSchema(Schema schema){
    Entity todo = schema.addEntity("Todo");
    Property id = todo.addIdProperty().getProperty();
    todo.addStringProperty("todo");
    todo.addDateProperty("addDate").notNull();
    todo.addDateProperty("endDate");
    todo.addIntProperty("status").notNull().unique();
}