GreenDao的基本使用

一.背景

之前用dbFlow,但是因?yàn)槟承┰虿贿m合所有機(jī)型,所以準(zhǔn)備用GreenDao,所以現(xiàn)在寫篇文章記錄一下使用的基本要點(diǎn)。

二.基本知識(shí)點(diǎn)和坑


  • mUser = new User((long)2,"anye3");
    mUserDao.insert(mUser);//添加一個(gè)

  • mUserDao.deleteByKey(id);

  • mUser = new User((long)2,"anye0803");
    mUserDao.update(mUser);

  • List<User> users = mUserDao.loadAll();
    String userName = "";
    for (int i = 0; i < users.size(); i++) {
    userName += users.get(i).getName()+",";
    }
    mContext.setText("查詢?nèi)繑?shù)據(jù)==>"+userName);
  • 實(shí)體@Entity注解
    schema:告知GreenDao當(dāng)前實(shí)體屬于哪個(gè)schema
    active:標(biāo)記一個(gè)實(shí)體處于活動(dòng)狀態(tài),活動(dòng)實(shí)體有更新殊橙、刪除和刷新方法
    nameInDb:在數(shù)據(jù)中使用的別名,默認(rèn)使用的是實(shí)體的類名
    indexes:定義索引狱从,可以跨越多個(gè)列
    createInDb:是否創(chuàng)建表膨蛮,默認(rèn)為true,false時(shí)不創(chuàng)建
  • 基礎(chǔ)屬性注解
    @Id :主鍵 Long型,可以通過(guò)@Id(autoincrement = true)設(shè)置自增長(zhǎng)
    @Property:設(shè)置一個(gè)非默認(rèn)關(guān)系映射所對(duì)應(yīng)的列名季研,默認(rèn)是的使用字段名 舉例:@Property (nameInDb="name")
    @NotNul:設(shè)置數(shù)據(jù)庫(kù)表當(dāng)前列不能為空
    @Transient :添加次標(biāo)記之后不會(huì)生成數(shù)據(jù)庫(kù)表的列
  • 索引注解
    @Index:使用@Index作為一個(gè)屬性來(lái)創(chuàng)建一個(gè)索引敞葛,通過(guò)name設(shè)置索引別名,也可以通過(guò)unique給索引添加約束
    @Unique:向數(shù)據(jù)庫(kù)列添加了一個(gè)唯一的約束
    @OrderBy 排序
    @generated 由greendao產(chǎn)生的構(gòu)造函數(shù)或方法
  • 關(guān)系注解
    @ToOne:定義與另一個(gè)實(shí)體(一個(gè)實(shí)體對(duì)象)的關(guān)系
    @ToMany:定義與多個(gè)實(shí)體對(duì)象的關(guān)系
  • 坑one
    greendao的關(guān)聯(lián)關(guān)系是通過(guò)主外鍵(對(duì)象之間關(guān)聯(lián)的id)來(lái)構(gòu)建的与涡。realm是直接通過(guò)對(duì)象關(guān)系來(lái)自動(dòng)構(gòu)建的惹谐。
  • 坑two
    如果屬性是List<> xx, greendao不會(huì)自動(dòng)調(diào)用設(shè)置xx的值,只有手動(dòng)調(diào)用getXX的時(shí)候獲取.我在打印log的時(shí)候被坑慘了驼卖,無(wú)論怎么樣都是為null.
  • 數(shù)據(jù)庫(kù)升級(jí)
    如果某張表修改了字段氨肌,或者新增了一張表,必須要修改build.gradle中的schemaVersion酌畜,否則當(dāng)你升級(jí)app的時(shí)候怎囚,如果進(jìn)行了數(shù)據(jù)庫(kù)操作,會(huì)發(fā)現(xiàn)列不匹配或者表不存在等問(wèn)題桥胞,直接會(huì)導(dǎo)致app閃退恳守。但是如果僅僅是將schemaVersion加1,雖然程序不會(huì)崩潰埠戳,并且數(shù)據(jù)表的結(jié)構(gòu)也會(huì)更新成功井誉,但是之前表中的數(shù)據(jù)會(huì)全部清空。我們需要進(jìn)行手動(dòng)操作來(lái)進(jìn)行數(shù)據(jù)庫(kù)里面的數(shù)據(jù)遷移整胃,大致的思路是:創(chuàng)建臨時(shí)表(結(jié)構(gòu)與上一版本的表結(jié)構(gòu)相同)颗圣,將舊數(shù)據(jù)移到臨時(shí)表中,刪除舊版本的表,創(chuàng)建新版本的表在岂,將臨時(shí)表中的數(shù)據(jù)轉(zhuǎn)移到新表中奔则,最后再刪除臨時(shí)表。詳細(xì)方法見鏈接:
    http://stackoverflow.com/a/30334668/5995409
  • 自定義sql語(yǔ)句
ChatHistoryDao dao = GreenDaoManager.getInstance().getSession().getChatHistoryDao();  
Cursor cursor = dao.getDatabase().rawQuery("select t.sales_wx_nick_name,t.wx_nick_name,count(*),t.talker_id,t.sales_wx_account from chat_history t group by t.talker_id,t.sales_wx_account order by t.created_at desc", null);  
while (cursor.moveToNext()) {  
    String salesWxNickName = cursor.getString(0);  
    String clientWxNickName = cursor.getString(1);  
    int chatCount = cursor.getInt(2);  
    int talkerId = cursor.getInt(3);  
    String salesWxAccount = cursor.getString(4);  
}  

    有的時(shí)候需要用到group by或者left join等復(fù)雜的語(yǔ)句蔽午,可以調(diào)用android原生的sqlite去進(jìn)行查詢易茬。

三.例子(oneToone,oneTomany,manyTomany)

  • 一對(duì)一
    一個(gè)人只有一個(gè)職業(yè)(socialRole)
    我們用 @ToOne(joinProperty = "socialRoleId"),然后把SocialRole的Id設(shè)置給Person的socialRoleId就建立聯(lián)系了,不需setSocialRole!!!!!!

Person.java

@Entity
public class Person {
    @Id
    private Long id;
    @Property(nameInDb = "address")
    private String personAddress;
    private Long socialRoleId;
    private String name;
    @ToOne(joinProperty = "socialRoleId")
    private SocialRole socialRole;
    @ToMany(referencedJoinProperty = "authorId")
    private List<Article> articleList;
    /** Used to resolve relations */
    @Keep
    private transient com.rebase.greendao.entity.DaoSession daoSession;
    /** Used for active entity operations. */
    @Keep
    private transient com.rebase.greendao.entity.PersonDao myDao;

    @Keep
    public Person(Long id, String personAddress, Long socialRoleId, String name) {
        this.id = id;
        this.personAddress = personAddress;
        this.socialRoleId = socialRoleId;
        this.name = name;
    }

    @Keep
    public Person() {
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPersonAddress() {
        return this.personAddress;
    }

    public void setPersonAddress(String personAddress) {
        this.personAddress = personAddress;
    }

    public Long getSocialRoleId() {
        return this.socialRoleId;
    }

    public void setSocialRoleId(Long socialRoleId) {
        this.socialRoleId = socialRoleId;
    }

    @Keep
    private transient Long socialRole__resolvedKey;

    /** To-one relationship, resolved on first access. */
    @Keep
    public SocialRole getSocialRole() {
        Long __key = this.socialRoleId;
        if (socialRole__resolvedKey == null || !socialRole__resolvedKey.equals(__key)) {
            final com.rebase.greendao.entity.DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            com.rebase.greendao.entity.SocialRoleDao targetDao = daoSession.getSocialRoleDao();
            SocialRole socialRoleNew = targetDao.load(__key);
            synchronized (this) {
                socialRole = socialRoleNew;
                socialRole__resolvedKey = __key;
            }
        }
        return socialRole;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Keep
    public void setSocialRole(SocialRole socialRole) {
        synchronized (this) {
            this.socialRole = socialRole;
            socialRoleId = socialRole == null ? null : socialRole.getId();
            socialRole__resolvedKey = socialRoleId;
        }
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Keep
    public List<Article> getArticleList() {
        if (articleList == null) {
            final com.rebase.greendao.entity.DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            com.rebase.greendao.entity.ArticleDao targetDao = daoSession.getArticleDao();
            List<Article> articleListNew = targetDao._queryPerson_ArticleList(id);
            synchronized (this) {
                if (articleList == null) {
                    articleList = articleListNew;
                }
            }
        }
        return articleList;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Keep
    public synchronized void resetArticleList() {
        articleList = null;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Keep
    public void __setDaoSession(com.rebase.greendao.entity.DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getPersonDao() : null;
    }

}

SocialRole.java

@Entity
public class SocialRole {
    @Id
    private Long id;
    @Property(nameInDb = "job")
    private String jobDesc;
    private int salary;
    @Generated(hash = 764507058)
    public SocialRole(Long id, String jobDesc, int salary) {
        this.id = id;
        this.jobDesc = jobDesc;
        this.salary = salary;
    }
    @Generated(hash = 508250821)
    public SocialRole() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getJobDesc() {
        return this.jobDesc;
    }
    public void setJobDesc(String jobDesc) {
        this.jobDesc = jobDesc;
    }
    public int getSalary() {
        return this.salary;
    }
    public void setSalary(int salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "SocialRole{" +
                "id=" + id +
                ", jobDesc='" + jobDesc + '\'' +
                ", salary=" + salary +
                '}';
    }
}

然后初始化

 mPerson = mDaoSession.getPersonDao().queryBuilder().where(PersonDao.Properties.Name.eq("Jason")).unique();
        if (mPerson == null) {
            Person person = new Person();
            person.setPersonAddress("shanghai");
            person.setName("Jason");
            mPerson = person;
        }
        System.out.println("xcqw person"+mPerson.getName());


//       一般一個(gè)人就一個(gè)職業(yè)
        mSocial = (SocialRole) mDaoSession.getSocialRoleDao().queryBuilder().unique();
        if (mSocial == null) {
            System.out.println("xcqw mSocial == null");
            SocialRole social = new SocialRole();
            social.setJobDesc("法師");
            social.setSalary(1000);
            mDaoSession.getSocialRoleDao().insert(social);
            mSocial = social;
        }
        System.out.println("xcqw social"+mSocial.getJobDesc());
//        Person  跟  socialRole  關(guān)聯(lián)起來(lái)!!!!!!!!111
//        只需要關(guān)聯(lián)socialRoleId
        mPerson.setSocialRoleId(mSocial.getId());
        mDaoSession.getPersonDao().insertOrReplace(mPerson);

//        開始查person的里的socialRole
        System.out.println("xcqw oneToone" + mPerson.getSocialRole().toString());

  • 一對(duì)多
    一個(gè)人寫個(gè)多篇文章
    @ToMany(referencedJoinProperty = "authorId")
    然后把person中的id設(shè)置給article中的authorId就建立關(guān)系了

Article.java

@Entity
public class Article {
    @Id
    private Long id;
    private String content;
    private Long authorId;
    @Generated(hash = 2128110276)
    public Article(Long id, String content, Long authorId) {
        this.id = id;
        this.content = content;
        this.authorId = authorId;
    }
    @Generated(hash = 742516792)
    public Article() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getContent() {
        return this.content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public Long getAuthorId() {
        return this.authorId;
    }
    public void setAuthorId(Long authorId) {
        this.authorId = authorId;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", authorId=" + authorId +
                '}';
    }
}

初始化

 List<Article> articleList = mDaoSession.getArticleDao().queryBuilder().list();
        if(articleList.size() >0) {
            for (int i = 0; i < articleList.size(); i++) {
                if (articleList.get(i).equals("我是第1個(gè)篇")) {
                    firstArticle = true;
                } else if (articleList.get(i).equals("我是第2個(gè)篇")) {
                    secondArticle = true;
                } else {
                    firstArticle = false;
                    secondArticle = false;
                }

            }
        }
        if (!firstArticle) {
            articleOne = new Article();
            articleOne.setContent("我是第1個(gè)篇");
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!建立關(guān)系
            articleOne.setAuthorId(mPerson.getId());
        }

        if (!secondArticle) {
            articleTwo = new Article();
            articleTwo.setContent("我是第2個(gè)篇");
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!建立關(guān)系
            articleTwo.setAuthorId(mPerson.getId());
            mDaoSession.getArticleDao().insertInTx(articleOne,articleTwo);
        }

        System.out.println("xcqw oneToMany"+mPerson.getArticleList().get(1).toString());
  • 多對(duì)多
    一個(gè)學(xué)生有多個(gè)老師及老,一個(gè)老師有多個(gè)學(xué)生

Student.java

@Entity
public class Student {
    @Id
    private Long id;
    private String name;
    // 對(duì)多抽莱,@JoinEntity注解:entity 中間表;sourceProperty 實(shí)體屬性骄恶;targetProperty 外鏈實(shí)體屬性
    @ToMany
    @JoinEntity(
            entity = JoinStudentToTeacher.class,
            sourceProperty = "sId",
            targetProperty = "tId"
    )
    private List<Teacher> teacherList;
    /** Used to resolve relations */
    @Keep
    private transient com.rebase.greendao.entity.DaoSession daoSession;
    /** Used for active entity operations. */
    @Keep
    private transient com.rebase.greendao.entity.StudentDao myDao;

    @Keep
    public Student(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    @Keep
    public Student() {
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", teacherList=" + teacherList +
                '}';
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Keep
    public List<Teacher> getTeacherList() {
        if (teacherList == null) {
            final com.rebase.greendao.entity.DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            com.rebase.greendao.entity.TeacherDao targetDao = daoSession.getTeacherDao();
            List<Teacher> teacherListNew = targetDao._queryStudent_TeacherList(id);
            synchronized (this) {
                if (teacherList == null) {
                    teacherList = teacherListNew;
                }
            }
        }
        return teacherList;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Keep
    public synchronized void resetTeacherList() {
        teacherList = null;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Keep
    public void __setDaoSession(com.rebase.greendao.entity.DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getStudentDao() : null;
    }
}

Teacher.java

@Entity
public class Teacher {
    @Id
    private Long id;
    private String name;
    // 對(duì)多食铐,@JoinEntity注解:entity 中間表;sourceProperty 實(shí)體屬性僧鲁;targetProperty 外鏈實(shí)體屬性
    @ToMany
    @JoinEntity(
            entity = JoinStudentToTeacher.class,
            sourceProperty = "tId",
            targetProperty = "sId"
    )
    private List<Student> studentList;
    /** Used to resolve relations */
    @Keep
    private transient com.rebase.greendao.entity.DaoSession daoSession;
    /** Used for active entity operations. */
    @Keep
    private transient com.rebase.greendao.entity.TeacherDao myDao;

    @Keep
    public Teacher(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    @Keep
    public Teacher() {
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", studentList=" + studentList +
                '}';
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Keep
    public List<Student> getStudentList() {
        if (studentList == null) {
            final com.rebase.greendao.entity.DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            com.rebase.greendao.entity.StudentDao targetDao = daoSession.getStudentDao();
            List<Student> studentListNew = targetDao._queryTeacher_StudentList(id);
            synchronized (this) {
                if (studentList == null) {
                    studentList = studentListNew;
                }
            }
        }
        return studentList;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Keep
    public synchronized void resetStudentList() {
        studentList = null;
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Keep
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Keep
    public void __setDaoSession(com.rebase.greendao.entity.DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getTeacherDao() : null;
    }
}

初始化

List<Student> studentList = mDaoSession.getStudentDao().queryBuilder().list();
        if (studentList.size() == 0) {
            Student studentOne = new Student();
            studentOne.setId(1l);
            studentOne.setName("stu1");
            Student studentTwo = new Student();
            studentTwo.setId(2l);
            studentTwo.setName("stu2");


            Teacher teachOne = new Teacher();
            teachOne.setId(1l);
            teachOne.setName("tech1");
            Teacher teachTwo = new Teacher();
            teachTwo.setId(2l);
            teachTwo.setName("tech2");


            // 模擬 多對(duì)多關(guān)系
          //Student1有teacher1 teacher2
            JoinStudentToTeacher stOne = new JoinStudentToTeacher();
            stOne.setSId(1l);
            stOne.setTId(1l);
            JoinStudentToTeacher stTwo = new JoinStudentToTeacher();
            stTwo.setSId(1l);
            stTwo.setTId(2l);

            //teacher1 有stu1 stu2
            JoinStudentToTeacher stThree = new JoinStudentToTeacher();
            stThree.setSId(1l);
            stThree.setTId(1l);
            JoinStudentToTeacher stFour = new JoinStudentToTeacher();
            stFour.setSId(2l);
            stFour.setTId(1l);


            mDaoSession.getJoinStudentToTeacherDao().insertOrReplaceInTx(stOne, stTwo, stThree, stFour);

            mDaoSession.getStudentDao().insertOrReplaceInTx(studentOne, studentTwo);

            mDaoSession.getTeacherDao().insertOrReplaceInTx(teachOne, teachTwo);

        }
//        List<Student> students = mDaoSession.getStudentDao().queryBuilder().list();
//        for(int i = 0;i<students.size();i++){
//            for(int j= 0;j<students.get(i).getTeacherList().size();j++){
//                System.out.println("xcqw teacher i--"+i+"--j--"+j+students.get(i).getTeacherList().get(j).toString());
//            }
//        }
        List<Teacher> teachers = mDaoSession.getTeacherDao().queryBuilder().list();
        for(int i = 0;i<teachers.size();i++){
            for(int j= 0;j<teachers.get(i).getStudentList().size();j++){
                System.out.println("xcqw student i--"+i+"--j--"+j+teachers.get(i).getStudentList().get(j).toString());
            }
        }
        System.out.println("xcqw asdsad");

注意E吧搿!寞秃!
mDaoSession.getTeacherDao().queryBuilder().list();如果在這個(gè)地方打斷點(diǎn)斟叼,下屬的students是null,只有走完兩個(gè)for循環(huán)調(diào)用get方法才會(huì)有值

四.源碼

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市春寿,隨后出現(xiàn)的幾起案子朗涩,更是在濱河造成了極大的恐慌,老刑警劉巖堂淡,帶你破解...
    沈念sama閱讀 218,036評(píng)論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件馋缅,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡绢淀,警方通過(guò)查閱死者的電腦和手機(jī)萤悴,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,046評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)皆的,“玉大人覆履,你說(shuō)我怎么就攤上這事》驯。” “怎么了硝全?”我有些...
    開封第一講書人閱讀 164,411評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)楞抡。 經(jīng)常有香客問(wèn)我伟众,道長(zhǎng),這世上最難降的妖魔是什么召廷? 我笑而不...
    開封第一講書人閱讀 58,622評(píng)論 1 293
  • 正文 為了忘掉前任凳厢,我火速辦了婚禮账胧,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘先紫。我一直安慰自己治泥,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,661評(píng)論 6 392
  • 文/花漫 我一把揭開白布遮精。 她就那樣靜靜地躺著居夹,像睡著了一般。 火紅的嫁衣襯著肌膚如雪本冲。 梳的紋絲不亂的頭發(fā)上准脂,一...
    開封第一講書人閱讀 51,521評(píng)論 1 304
  • 那天,我揣著相機(jī)與錄音檬洞,去河邊找鬼意狠。 笑死,一個(gè)胖子當(dāng)著我的面吹牛疮胖,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播闷板,決...
    沈念sama閱讀 40,288評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼澎灸,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了遮晚?” 一聲冷哼從身側(cè)響起性昭,我...
    開封第一講書人閱讀 39,200評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎县遣,沒(méi)想到半個(gè)月后糜颠,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,644評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡萧求,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,837評(píng)論 3 336
  • 正文 我和宋清朗相戀三年其兴,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片夸政。...
    茶點(diǎn)故事閱讀 39,953評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡元旬,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出守问,到底是詐尸還是另有隱情匀归,我是刑警寧澤,帶...
    沈念sama閱讀 35,673評(píng)論 5 346
  • 正文 年R本政府宣布耗帕,位于F島的核電站穆端,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏仿便。R本人自食惡果不足惜体啰,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,281評(píng)論 3 329
  • 文/蒙蒙 一攒巍、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧狡赐,春花似錦窑业、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,889評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至搀擂,卻和暖如春西潘,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背哨颂。 一陣腳步聲響...
    開封第一講書人閱讀 33,011評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工喷市, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人威恼。 一個(gè)月前我還...
    沈念sama閱讀 48,119評(píng)論 3 370
  • 正文 我出身青樓品姓,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親箫措。 傳聞我的和親對(duì)象是個(gè)殘疾皇子腹备,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,901評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容

  • 1、配置 1.1 在project的Gradle中配置: buildscript { repositories {...
    豆?jié){u條閱讀 672評(píng)論 0 1
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理斤蔓,服務(wù)發(fā)現(xiàn)植酥,斷路器,智...
    卡卡羅2017閱讀 134,656評(píng)論 18 139
  • Android 自定義View的各種姿勢(shì)1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 172,129評(píng)論 25 707
  • 12月1日弦牡,一不小心就到了2017年底了友驮,時(shí)間快得讓我害怕。 今天整理了一大堆衣物驾锰,衣柜總算是清白了點(diǎn)卸留,床上也換了...
    越寫不好越要寫閱讀 255評(píng)論 0 0
  • 原型設(shè)計(jì) 愿景訴求 解決目前頁(yè)面調(diào)整交互反人類艾猜。目前頁(yè)面調(diào)整功能存在一下幾點(diǎn)問(wèn)題: 預(yù)覽圖不能快速滾動(dòng)。 預(yù)覽圖不...
    BetseyLiu閱讀 523評(píng)論 0 0