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

The following examples show how to use de.greenrobot.daogenerator.Entity#addIdProperty() . 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: EhDaoGenerator.java    From MHViewer with Apache License 2.0 6 votes vote down vote up
private static void addQuickSearch(Schema schema) {
    Entity entity = schema.addEntity("QuickSearch");
    entity.setTableName("QUICK_SEARCH");
    entity.setClassNameDao("QuickSearchDao");
    entity.addIdProperty();
    entity.addStringProperty("name");
    entity.addIntProperty("mode").notNull();
    entity.addIntProperty("category").notNull();
    entity.addStringProperty("keyword");
    entity.addIntProperty("advanceSearch").notNull();
    entity.addIntProperty("minRating").notNull();
    // Since 4
    entity.addIntProperty("pageFrom").notNull();
    // Since 4
    entity.addIntProperty("pageTo").notNull();
    entity.addLongProperty("time").notNull();
}
 
Example 2
Source File: NMBDaoGenerator.java    From Nimingban with Apache License 2.0 6 votes vote down vote up
private static void addACForum(Schema schema) {
    Entity entity = schema.addEntity("ACForumRaw");
    entity.setTableName("AC_FORUM");
    entity.setClassNameDao("ACForumDao");
    entity.addIdProperty();
    entity.addStringProperty("forumid");
    entity.addStringProperty("displayname");
    entity.addIntProperty("priority");
    entity.addBooleanProperty("visibility");

    // @since 4
    entity.addStringProperty("msg");

    // @since 5
    entity.addBooleanProperty("official");

    // @since 6
    entity.addIntProperty("frequency");
}
 
Example 3
Source File: HttpCookieDaoGenerator.java    From Nimingban with Apache License 2.0 6 votes vote down vote up
private static void addHttpCookie(Schema schema) {
    Entity entity = schema.addEntity("HttpCookieRaw");
    entity.setTableName("HTTP_COOKIE");
    entity.setClassNameDao("HttpCookieDao");
    entity.addIdProperty();
    entity.addStringProperty("name");
    entity.addStringProperty("value");
    entity.addStringProperty("comment");
    entity.addStringProperty("commentURL");
    entity.addBooleanProperty("discard");
    entity.addStringProperty("domain");
    entity.addLongProperty("maxAge");
    entity.addStringProperty("path");
    entity.addStringProperty("portList");
    entity.addBooleanProperty("secure");
    entity.addIntProperty("version");
    entity.addStringProperty("url");
    entity.addLongProperty("whenCreated");
}
 
Example 4
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 5
Source File: EhDaoGenerator.java    From EhViewer with Apache License 2.0 6 votes vote down vote up
private static void addQuickSearch(Schema schema) {
    Entity entity = schema.addEntity("QuickSearch");
    entity.setTableName("QUICK_SEARCH");
    entity.setClassNameDao("QuickSearchDao");
    entity.addIdProperty();
    entity.addStringProperty("name");
    entity.addIntProperty("mode").notNull();
    entity.addIntProperty("category").notNull();
    entity.addStringProperty("keyword");
    entity.addIntProperty("advanceSearch").notNull();
    entity.addIntProperty("minRating").notNull();
    // Since 4
    entity.addIntProperty("pageFrom").notNull();
    // Since 4
    entity.addIntProperty("pageTo").notNull();
    entity.addLongProperty("time").notNull();
}
 
Example 6
Source File: NMBDaoGenerator.java    From Nimingban with Apache License 2.0 5 votes vote down vote up
private static void addDraft(Schema schema) {
    Entity entity = schema.addEntity("DraftRaw");
    entity.setTableName("DRAFT");
    entity.setClassNameDao("DraftDao");
    entity.addIdProperty();
    entity.addStringProperty("content");
    entity.addLongProperty("time");
}
 
Example 7
Source File: EhDaoGenerator.java    From MHViewer with Apache License 2.0 5 votes vote down vote up
private static void addDownloadLabel(Schema schema) {
    Entity entity = schema.addEntity("DownloadLabel");
    entity.setTableName("DOWNLOAD_LABELS");
    entity.setClassNameDao("DownloadLabelDao");
    entity.addIdProperty();
    entity.addStringProperty("label");
    entity.addLongProperty("time").notNull();
}
 
Example 8
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 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: Generator.java    From AndroidDatabaseLibraryComparison with MIT License 5 votes vote down vote up
private static Entity getContactItemEntity(Schema schema) {
    Entity contactItem = schema.addEntity("Contact");
    contactItem.addIdProperty();
    contactItem.addStringProperty("name");
    contactItem.addStringProperty("email");
    return contactItem;
}
 
Example 11
Source File: NMBDaoGenerator.java    From Nimingban with Apache License 2.0 5 votes vote down vote up
/**
 * @since 3
 */
private static void addACCommonPost(Schema schema) {
    Entity entity = schema.addEntity("ACCommonPostRaw");
    entity.setTableName("AC_COMMON_POST");
    entity.setClassNameDao("ACCommonPostDao");
    entity.addIdProperty();
    entity.addStringProperty("name");
    entity.addStringProperty("postid");
}
 
Example 12
Source File: Generator.java    From AndroidDatabaseLibraryComparison with MIT License 5 votes vote down vote up
static Entity getAddressItemEntity(Schema schema, String name) {
    Entity simpleAddressItem = schema.addEntity(name);
    simpleAddressItem.addIdProperty();
    simpleAddressItem.addStringProperty("name");
    simpleAddressItem.addStringProperty("address");
    simpleAddressItem.addStringProperty("city");
    simpleAddressItem.addStringProperty("state");
    simpleAddressItem.addLongProperty("phone");
    return simpleAddressItem;
}
 
Example 13
Source File: Generator.java    From AndroidDatabaseLibraryComparison with MIT License 5 votes vote down vote up
static Entity getAddressBookEntity(Schema schema) {
    Entity addressBook = schema.addEntity("AddressBook");
    addressBook.addIdProperty();
    addressBook.addStringProperty("name");
    addressBook.addStringProperty("author");
    return addressBook;
}
 
Example 14
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 15
Source File: NMBDaoGenerator.java    From Nimingban with Apache License 2.0 5 votes vote down vote up
/**
 * @since 2
 */
private static void addACRecord(Schema schema) {
    Entity entity = schema.addEntity("ACRecordRaw");
    entity.setTableName("AC_RECORD");
    entity.setClassNameDao("ACRecordDao");
    entity.addIdProperty();
    entity.addIntProperty("type");
    entity.addStringProperty("recordid");
    entity.addStringProperty("postid");
    entity.addStringProperty("content");
    entity.addStringProperty("image");
    entity.addLongProperty("time");
}
 
Example 16
Source File: BrainphaserDaoGenerator.java    From BrainPhaser with GNU General Public License v3.0 5 votes vote down vote up
public static Entity createUserEntity(Schema schema) {
    Entity user = schema.addEntity("User");
    user.addIdProperty();
    user.addStringProperty("name").notNull();
    user.addStringProperty("avatar").notNull();
    user.setHasKeepSections(true);

    return user;
}
 
Example 17
Source File: EhDaoGenerator.java    From MHViewer with Apache License 2.0 5 votes vote down vote up
private static void addFilter(Schema schema) {
    Entity entity = schema.addEntity("Filter");
    entity.setTableName("FILTER");
    entity.setClassNameDao("FilterDao");
    entity.addIdProperty();
    entity.addIntProperty("mode").notNull();
    entity.addStringProperty("text");
    // Since 3
    entity.addBooleanProperty("enable");
}
 
Example 18
Source File: GreenDaoGenerator.java    From Dota2Helper with Apache License 2.0 4 votes vote down vote up
public static void addNews(Schema schema) {
    Entity news = schema.addEntity("GreenNews");
    news.addIdProperty();
    news.addStringProperty("newslistjson");
}
 
Example 19
Source File: DaoGeneration.java    From NBAPlus with Apache License 2.0 4 votes vote down vote up
public static void addNews(Schema schema) {
    Entity news = schema.addEntity("GreenNews");
    news.addIdProperty();
    news.addStringProperty("newslist");
    news.addStringProperty("type");
}
 
Example 20
Source File: DaoGeneration.java    From NBAPlus with Apache License 2.0 4 votes vote down vote up
public static void addStats(Schema schema) {
    Entity stat = schema.addEntity("GreenStat");
    stat.addIdProperty();
    stat.addStringProperty("statentity");
    stat.addStringProperty("statkind");
}