当前位置: 首页>>代码示例>>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;未经允许,请勿转载。