GreenDao3.0 中踩到的巨坑

 在GreenDao 使用中 設置了主外鍵,  主表中的數據插入, 從表中的數據也須要手工插入,不會自動插入this

巨坑,可是在查詢的時候會查詢出來ip

還有個坑  若是從表數據沒有插入, 直接插入主表數據, 在第一次查詢的時候會被查出來,正是由於這個緣由致使後期出現不少問題。太坑,太坑,太坑get

/**
 * To-one relationship, resolved on first access.
 */
@Generated(hash = 1299602490)
public Family getFamily() {
    String __key = this.familyInfoId;
    if (family__resolvedKey == null || family__resolvedKey != __key) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        FamilyDao targetDao = daoSession.getFamilyDao();
        Family familyNew = targetDao.load(__key);
        synchronized (this) {
            family = familyNew;
            family__resolvedKey = __key;
        }
    }
    return family;
}
相關文章
相關標籤/搜索