當前位置: 首頁>>代碼示例>>Java>>正文


Java Entity.addStringProperty方法代碼示例

本文整理匯總了Java中de.greenrobot.daogenerator.Entity.addStringProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Entity.addStringProperty方法的具體用法?Java Entity.addStringProperty怎麽用?Java Entity.addStringProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在de.greenrobot.daogenerator.Entity的用法示例。


在下文中一共展示了Entity.addStringProperty方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addNote

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
/**
 * @param schema
 */
private static void addNote(Schema schema) {
    Entity note = schema.addEntity("Note");
    note.addIdProperty();
    note.addIntProperty("note_id");//筆記編號
    note.addStringProperty("guid");//用戶ID
    note.addIntProperty("status");//狀態
    note.addStringProperty("tag");//類型
    note.addStringProperty("label");//標題
    note.addStringProperty("content");//內容
    note.addStringProperty("imagePath");//圖片目錄
    note.addStringProperty("voicePath");//聲音目錄
    note.addLongProperty("createTime");//創建時間
    note.addLongProperty("lastOprTime");//最後修改時間

    Entity tag = schema.addEntity("Tag");//標簽類型
    tag .addIdProperty();
    tag.addStringProperty("tag");
    tag.addIntProperty("size");
}
 
開發者ID:lpy19930103,項目名稱:MinimalismJotter,代碼行數:23,代碼來源:NoteDaoGenerator.java

示例2: addDialog

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static Entity addDialog(Schema schema){
    Entity dialog = schema.addEntity("Dialog");
    dialog.addIdProperty().primaryKey().autoincrement();
    dialog.addStringProperty("dialog_id");
    dialog.addStringProperty("created_at");
    dialog.addStringProperty("updated_at");
    dialog.addStringProperty("last_message");
    dialog.addLongProperty("last_message_date_sent");
    dialog.addIntProperty("last_message_user_id");
    dialog.addStringProperty("name");
    dialog.addStringProperty("photo");
    dialog.addStringProperty("occupants_ids");
    dialog.addIntProperty("type");
    dialog.addIntProperty("unread_messages_count");
    dialog.addStringProperty("xmpp_room_jid");
    return dialog;
}
 
開發者ID:ukevgen,項目名稱:BizareChat,代碼行數:18,代碼來源:InitDao.java

示例3: addMessage

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static Entity addMessage(Schema schema){
    Entity message = schema.addEntity("Message");
    message.addIdProperty().primaryKey().autoincrement();
    message.addStringProperty("message_id");
    message.addStringProperty("created_at");
    message.addStringProperty("updated_at");
    message.addStringProperty("attachments");
    message.addStringProperty("read_ids");
    message.addStringProperty("delivered_ids");
    message.addStringProperty("chat_dialog_id");
    message.addLongProperty("date_sent");
    message.addStringProperty("message");
    message.addStringProperty("recipient_id");
    message.addIntProperty("sender_id");
    message.addIntProperty("read");
    return message;
}
 
開發者ID:ukevgen,項目名稱:BizareChat,代碼行數:18,代碼來源:InitDao.java

示例4: addUser

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static Entity addUser(Schema schema){
    Entity user = schema.addEntity("User");
    user.addIdProperty().primaryKey().autoincrement();
    user.addIntProperty("user_id");
    user.addStringProperty("full_name");
    user.addStringProperty("email");
    user.addStringProperty("login");
    user.addStringProperty("phone");
    user.addStringProperty("website");
    user.addStringProperty("created_at");
    user.addStringProperty("updated_at");
    user.addStringProperty("last_request_at");
    user.addStringProperty("external_user_id");
    user.addLongProperty("facebook_id");
    user.addStringProperty("twitter_id");
    user.addIntProperty("twitter_digits_id");
    user.addIntProperty("blob_id");
    user.addStringProperty("custom_data");
    user.addStringProperty("user_tags");
    return user;
}
 
開發者ID:ukevgen,項目名稱:BizareChat,代碼行數:22,代碼來源:InitDao.java

示例5: addMusic

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addMusic(Schema schema) {
    Entity music = schema.addEntity("Music");
    music.addIdProperty();
    music.addStringProperty("mediaType");//eg: mp3
    music.addStringProperty("musicType");//eg:兒歌,英文
    music.addStringProperty("url");
    music.addStringProperty("singer");
    music.addStringProperty("author");
    music.addStringProperty("poster_url");//海報url
    music.addStringProperty("lyrics_url");//歌詞url
    music.addStringProperty("name");
    music.addLongProperty("size");
    music.addStringProperty("albums");//專輯
    music.addIntProperty("quality");
    music.setSuperclass("cn.bmob.v3.BmobObject");
}
 
開發者ID:DroidKOF,項目名稱:pineapple,代碼行數:17,代碼來源:PineappleGenerator.java

示例6: addHtml

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
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);
    }
 
開發者ID:qq137712630,項目名稱:MeiZiNews,代碼行數:27,代碼來源:DBClass.java

示例7: addNote

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
/**
 * @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");
}
 
開發者ID:Thereisnospon,項目名稱:BlogReader,代碼行數:19,代碼來源:DataDaoGenerator.java

示例8: addMeal

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addMeal(Schema schema, Entity food) {
    Entity meal = schema.addEntity("MealEntity");
    meal.setSuperclass("MealEntityBase");
    meal.addIdProperty().autoincrement().primaryKey();
    meal.addDateProperty("date").notNull();
    meal.addIntProperty("mealtime").notNull();
    meal.addIntProperty("grams").notNull();
    meal.addDoubleProperty("calories").notNull();
    meal.addDoubleProperty("fats").notNull();
    meal.addDoubleProperty("carbohydrates").notNull();
    meal.addDoubleProperty("proteins").notNull();
    meal.addStringProperty("foodName");

    Property foodId = meal.addLongProperty("foodId").getProperty();
    meal.addToOne(food, foodId);
}
 
開發者ID:andreshj87,項目名稱:CleanFit,代碼行數:17,代碼來源:GreenDAOGenerator.java

示例9: addAccountTable

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addAccountTable(Schema schema) {

        Entity table = schema.addEntity("Green_AccountBean");
        table.setHasKeepSections(true);
        table.setTableName(AccountTable.ACCOUNT_TABLE);
        table.implementsSerializable();

        table.addLongProperty(AccountTable.UID).primaryKey();
        table.addStringProperty(AccountTable.USER_NAME);
        table.addStringProperty(AccountTable.USER_PWD);
        table.addStringProperty(AccountTable.COOKIE);
        table.addStringProperty(AccountTable.OAUTH_TOKEN);
        table.addLongProperty(AccountTable.OAUTH_TOKEN_EXPIRES_TIME);
        table.addStringProperty(AccountTable.ACCESS_TOKEN_HACK);
        table.addLongProperty(AccountTable.ACCESS_TOKEN_HACK_EXPIRES_TIME);
        table.addStringProperty(AccountTable.G_SID);
        table.addIntProperty(AccountTable.NAVIGATION_POSITION);
        table.addStringProperty(AccountTable.USER_INFO_JSON);
    }
 
開發者ID:andforce,項目名稱:iBeebo,代碼行數:20,代碼來源:GreenDaoGen.java

示例10: addData

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addData(Schema schema){
    //一個實體類就代表一張表,此處表名為HaveRead
    Entity haveReadNews = schema.addEntity("HaveRead");

    //生成表的字段
    haveReadNews.addIdProperty();
    haveReadNews.addStringProperty("title");
    haveReadNews.addStringProperty("imageUrl");
    haveReadNews.addStringProperty("url");

    Entity collectNews = schema.addEntity("Collect");

    collectNews.addIdProperty().autoincrement();
    collectNews.addStringProperty("title");
    collectNews.addStringProperty("imageUrl");
    collectNews.addStringProperty("url");
    collectNews.addDateProperty("time");
}
 
開發者ID:Tangyingqi,項目名稱:Jiemian,代碼行數:19,代碼來源:MyDaoGenerator.java

示例11: addDownloads

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addDownloads(Schema schema) {
    Entity entity = schema.addEntity("DownloadInfo");
    entity.setTableName("DOWNLOADS");
    entity.setClassNameDao("DownloadsDao");
    entity.setSuperclass("GalleryInfo");
    // GalleryInfo data
    entity.addLongProperty("gid").primaryKey().notNull();
    entity.addStringProperty("token");
    entity.addStringProperty("title");
    entity.addStringProperty("titleJpn");
    entity.addStringProperty("thumb");
    entity.addIntProperty("category").notNull();
    entity.addStringProperty("posted");
    entity.addStringProperty("uploader");
    entity.addFloatProperty("rating").notNull();
    entity.addStringProperty("simpleLanguage");
    // DownloadInfo data
    entity.addIntProperty("state").notNull();
    entity.addIntProperty("legacy").notNull();
    entity.addLongProperty("time").notNull();
    entity.addStringProperty("label");
}
 
開發者ID:seven332,項目名稱:EhViewer,代碼行數:23,代碼來源:EhDaoGenerator.java

示例12: addHistoryInfo

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addHistoryInfo(Schema schema) {
    Entity entity = schema.addEntity("HistoryInfo");
    entity.setTableName("HISTORY");
    entity.setClassNameDao("HistoryDao");
    entity.setSuperclass("GalleryInfo");
    // GalleryInfo data
    entity.addLongProperty("gid").primaryKey().notNull();
    entity.addStringProperty("token");
    entity.addStringProperty("title");
    entity.addStringProperty("titleJpn");
    entity.addStringProperty("thumb");
    entity.addIntProperty("category").notNull();
    entity.addStringProperty("posted");
    entity.addStringProperty("uploader");
    entity.addFloatProperty("rating").notNull();
    entity.addStringProperty("simpleLanguage");
    // HistoryInfo data
    entity.addIntProperty("mode").notNull();
    entity.addLongProperty("time").notNull();
}
 
開發者ID:seven332,項目名稱:EhViewer,代碼行數:21,代碼來源:EhDaoGenerator.java

示例13: addLocalFavorites

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addLocalFavorites(Schema schema) {
    Entity entity = schema.addEntity("LocalFavoriteInfo");
    entity.setTableName("LOCAL_FAVORITES");
    entity.setClassNameDao("LocalFavoritesDao");
    entity.setSuperclass("GalleryInfo");
    // GalleryInfo data
    entity.addLongProperty("gid").primaryKey().notNull();
    entity.addStringProperty("token");
    entity.addStringProperty("title");
    entity.addStringProperty("titleJpn");
    entity.addStringProperty("thumb");
    entity.addIntProperty("category").notNull();
    entity.addStringProperty("posted");
    entity.addStringProperty("uploader");
    entity.addFloatProperty("rating").notNull();
    entity.addStringProperty("simpleLanguage");
    // LocalFavoriteInfo data
    entity.addLongProperty("time").notNull();
}
 
開發者ID:seven332,項目名稱:EhViewer,代碼行數:20,代碼來源:EhDaoGenerator.java

示例14: addBookmarks

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addBookmarks(Schema schema) {
    Entity entity = schema.addEntity("BookmarkInfo");
    entity.setTableName("BOOKMARKS");
    entity.setClassNameDao("BookmarksBao");
    entity.setSuperclass("GalleryInfo");
    // GalleryInfo data
    entity.addLongProperty("gid").primaryKey().notNull();
    entity.addStringProperty("token");
    entity.addStringProperty("title");
    entity.addStringProperty("titleJpn");
    entity.addStringProperty("thumb");
    entity.addIntProperty("category").notNull();
    entity.addStringProperty("posted");
    entity.addStringProperty("uploader");
    entity.addFloatProperty("rating").notNull();
    entity.addStringProperty("simpleLanguage");
    // Bookmark data
    entity.addIntProperty("page").notNull();
    entity.addLongProperty("time").notNull();
}
 
開發者ID:seven332,項目名稱:EhViewer,代碼行數:21,代碼來源:EhDaoGenerator.java

示例15: main

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
public static void main(String args[]) throws Exception {
    Schema schema = new Schema(3, "greendao");

    Entity verses = schema.addEntity("Verse");
    verses.setTableName("verses");
    verses.addIdProperty().columnName("_rowid_");
    verses.addIntProperty("chapter");
    verses.addIntProperty("verse");
    verses.addStringProperty("book");
    verses.addStringProperty("header");
    verses.addStringProperty("subheader");
    verses.addStringProperty("text");

    Entity books = schema.addEntity("Book");
    books.addLongProperty("indice").primaryKey().unique();
    books.setTableName("books");
    books.addStringProperty("name");
    books.addStringProperty("abbreviation");
    books.addStringProperty("testament");

    new DaoGenerator().generateAll(schema, args[0]);
}
 
開發者ID:diegoponciano,項目名稱:biblia-ccb,代碼行數:23,代碼來源:BibliaDaoGenerator.java


注:本文中的de.greenrobot.daogenerator.Entity.addStringProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。