• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DaoException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.greenrobot.greendao.DaoException的典型用法代码示例。如果您正苦于以下问题:Java DaoException类的具体用法?Java DaoException怎么用?Java DaoException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DaoException类属于org.greenrobot.greendao包,在下文中一共展示了DaoException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getOptionList

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 1773152342)
public List<Option> getOptionList() {
    if (optionList == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        OptionDao targetDao = daoSession.getOptionDao();
        List<Option> optionListNew = targetDao._queryQuestion_OptionList(id);
        synchronized (this) {
            if (optionList == null) {
                optionList = optionListNew;
            }
        }
    }
    return optionList;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:Question.java


示例2: buildDelete

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * Builds a reusable query object for deletion (Query objects can be executed more efficiently than creating a
 * QueryBuilder for each execution.
 */
public DeleteQuery<T> buildDelete() {
    if (!joins.isEmpty()) {
        throw new DaoException("JOINs are not supported for DELETE queries");
    }
    String tablename = dao.getTablename();
    String baseSql = SqlUtils.createSqlDelete(tablename, null);
    StringBuilder builder = new StringBuilder(baseSql);

    // tablePrefix gets replaced by table name below. Don't use tableName here because it causes trouble when
    // table name ends with tablePrefix.
    appendJoinsAndWheres(builder, tablePrefix);

    String sql = builder.toString();
    // Remove table aliases, not supported for DELETE queries.
    // TODO(?): don't create table aliases in the first place.
    sql = sql.replace(tablePrefix + ".\"", '"' + tablename + "\".\"");
    checkLog(sql);

    return DeleteQuery.create(dao, sql, values.toArray());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:QueryBuilder.java


示例3: getMeasure

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/** To-one relationship, resolved on first access. */
@Generated(hash = 1530824084)
public Measure getMeasure() {
    long __key = this.measure_id;
    if (measure__resolvedKey == null || !measure__resolvedKey.equals(__key)) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        MeasureDao targetDao = daoSession.getMeasureDao();
        Measure measureNew = targetDao.load(__key);
        synchronized (this) {
            measure = measureNew;
            measure__resolvedKey = __key;
        }
    }
    return measure;
}
 
开发者ID:kflauri2312lffds,项目名称:Android_watch_magpie,代码行数:19,代码来源:Alertes.java


示例4: count

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/** Returns the count (number of results matching the query). Uses SELECT COUNT (*) sematics. */
public long count() {
    checkThread();
    Cursor cursor = dao.getDatabase().rawQuery(sql, parameters);
    try {
        if (!cursor.moveToNext()) {
            throw new DaoException("No result for count");
        } else if (!cursor.isLast()) {
            throw new DaoException("Unexpected row count: " + cursor.getCount());
        } else if (cursor.getColumnCount() != 1) {
            throw new DaoException("Unexpected column count: " + cursor.getColumnCount());
        }
        return cursor.getLong(0);
    } finally {
        cursor.close();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:18,代码来源:CountQuery.java


示例5: reflectProperties

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
private static Property[] reflectProperties(Class<? extends AbstractDao<?, ?>> daoClass)
        throws ClassNotFoundException, IllegalArgumentException, IllegalAccessException {
    Class<?> propertiesClass = Class.forName(daoClass.getName() + "$Properties");
    Field[] fields = propertiesClass.getDeclaredFields();

    ArrayList<Property> propertyList = new ArrayList<Property>();
    final int modifierMask = Modifier.STATIC | Modifier.PUBLIC;
    for (Field field : fields) {
        // There might be other fields introduced by some tools, just ignore them (see issue #28)
        if ((field.getModifiers() & modifierMask) == modifierMask) {
            Object fieldValue = field.get(null);
            if (fieldValue instanceof Property) {
                propertyList.add((Property) fieldValue);
            }
        }
    }

    Property[] properties = new Property[propertyList.size()];
    for (Property property : propertyList) {
        if (properties[property.ordinal] != null) {
            throw new DaoException("Duplicate property ordinals");
        }
        properties[property.ordinal] = property;
    }
    return properties;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:DaoConfig.java


示例6: getGradeList

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 1040074549)
public List<Grade> getGradeList() {
    if (gradeList == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        GradeDao targetDao = daoSession.getGradeDao();
        List<Grade> gradeListNew = targetDao._queryAccount_GradeList(id);
        synchronized (this) {
            if (gradeList == null) {
                gradeList = gradeListNew;
            }
        }
    }
    return gradeList;
}
 
开发者ID:wulkanowy,项目名称:wulkanowy,代码行数:22,代码来源:Account.java


示例7: getLocation

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-one relationship, resolved on first access.
 */
@Generated(hash = 1847191610)
public Location getLocation() {
    Long __key = this.locationID;
    if (location__resolvedKey == null || !location__resolvedKey.equals(__key)) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        LocationDao targetDao = daoSession.getLocationDao();
        Location locationNew = targetDao.load(__key);
        synchronized (this) {
            location = locationNew;
            location__resolvedKey = __key;
        }
    }
    return location;
}
 
开发者ID:alewin,项目名称:moneytracking,代码行数:21,代码来源:PlannedItem.java


示例8: getLessons

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 1552857303)
public List<Lesson> getLessons() {
    if (lessons == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        LessonDao targetDao = daoSession.getLessonDao();
        List<Lesson> lessonsNew = targetDao._queryDay_Lessons(id);
        synchronized (this) {
            if (lessons == null) {
                lessons = lessonsNew;
            }
        }
    }
    return lessons;
}
 
开发者ID:wulkanowy,项目名称:wulkanowy,代码行数:22,代码来源:Day.java


示例9: getOrders

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 1084217201)
public List<Order> getOrders() {
    if (orders == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        OrderDao targetDao = daoSession.getOrderDao();
        List<Order> ordersNew = targetDao._queryCustomer_Orders(id);
        synchronized (this) {
            if (orders == null) {
                orders = ordersNew;
            }
        }
    }
    return orders;
}
 
开发者ID:greenrobot-team,项目名称:greenrobot-examples,代码行数:22,代码来源:Customer.java


示例10: getRule

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/** To-one relationship, resolved on first access. */
@Generated(hash = 752533316)
public CustomRules getRule() {
    long __key = this.rule_id;
    if (rule__resolvedKey == null || !rule__resolvedKey.equals(__key)) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        CustomRulesDao targetDao = daoSession.getCustomRulesDao();
        CustomRules ruleNew = targetDao.load(__key);
        synchronized (this) {
            rule = ruleNew;
            rule__resolvedKey = __key;
        }
    }
    return rule;
}
 
开发者ID:kflauri2312lffds,项目名称:Android_watch_magpie,代码行数:19,代码来源:Alertes.java


示例11: getGenres

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 1620741698)
public List<GenreModel> getGenres() {
    if (genres == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        GenreModelDao targetDao = daoSession.getGenreModelDao();
        List<GenreModel> genresNew = targetDao._queryMovieOverviewModel_Genres(id);
        synchronized (this) {
            if (genres == null) {
                genres = genresNew;
            }
        }
    }
    return genres;
}
 
开发者ID:tgbMedia,项目名称:Android-app,代码行数:22,代码来源:MovieOverviewModel.java


示例12: getCast

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 150995885)
public List<CastRelationModel> getCast() {
    if (cast == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        CastRelationModelDao targetDao = daoSession.getCastRelationModelDao();
        List<CastRelationModel> castNew = targetDao._queryMovieOverviewModel_Cast(id);
        synchronized (this) {
            if (cast == null) {
                cast = castNew;
            }
        }
    }
    return cast;
}
 
开发者ID:tgbMedia,项目名称:Android-app,代码行数:22,代码来源:MovieOverviewModel.java


示例13: getCrew

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 1914797064)
public List<CrewRelationModel> getCrew() {
    if (crew == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        CrewRelationModelDao targetDao = daoSession.getCrewRelationModelDao();
        List<CrewRelationModel> crewNew = targetDao._queryMovieOverviewModel_Crew(id);
        synchronized (this) {
            if (crew == null) {
                crew = crewNew;
            }
        }
    }
    return crew;
}
 
开发者ID:tgbMedia,项目名称:Android-app,代码行数:22,代码来源:MovieOverviewModel.java


示例14: getSubjectList

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 1800750450)
public List<Subject> getSubjectList() {
    if (subjectList == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        SubjectDao targetDao = daoSession.getSubjectDao();
        List<Subject> subjectListNew = targetDao._queryAccount_SubjectList(id);
        synchronized (this) {
            if (subjectList == null) {
                subjectList = subjectListNew;
            }
        }
    }
    return subjectList;
}
 
开发者ID:wulkanowy,项目名称:wulkanowy,代码行数:22,代码来源:Account.java


示例15: getMovie

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/** To-one relationship, resolved on first access. */
@Generated(hash = 1289461985)
public MovieOverviewModel getMovie() {
    long __key = this.movieId;
    if (movie__resolvedKey == null || !movie__resolvedKey.equals(__key)) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        MovieOverviewModelDao targetDao = daoSession.getMovieOverviewModelDao();
        MovieOverviewModel movieNew = targetDao.load(__key);
        synchronized (this) {
            movie = movieNew;
            movie__resolvedKey = __key;
        }
    }
    return movie;
}
 
开发者ID:tgbMedia,项目名称:Android-app,代码行数:19,代码来源:KeywordModel.java


示例16: getPerson

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/** To-one relationship, resolved on first access. */
@Generated(hash = 362483469)
public PersonModel getPerson() {
    Long __key = this.personId;
    if (person__resolvedKey == null || !person__resolvedKey.equals(__key)) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        PersonModelDao targetDao = daoSession.getPersonModelDao();
        PersonModel personNew = targetDao.load(__key);
        synchronized (this) {
            person = personNew;
            person__resolvedKey = __key;
        }
    }
    return person;
}
 
开发者ID:tgbMedia,项目名称:Android-app,代码行数:19,代码来源:CastRelationModel.java


示例17: getAuthor

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/** To-one relationship, resolved on first access. */
@Generated(hash = 625279819)
public AuthorBean getAuthor() {
    String __key = this.authorId;
    if (author__resolvedKey == null || author__resolvedKey != __key) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        AuthorBeanDao targetDao = daoSession.getAuthorBeanDao();
        AuthorBean authorNew = targetDao.load(__key);
        synchronized (this) {
            author = authorNew;
            author__resolvedKey = __key;
        }
    }
    return author;
}
 
开发者ID:newbiechen1024,项目名称:NovelReader,代码行数:19,代码来源:BookCommentBean.java


示例18: getVideoInfos

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * To-many relationship, resolved on first access (and after reset).
 * Changes to to-many relations are not persisted, make changes to the target entity.
 */
@Generated(hash = 34130431)
public List<VideoInfo> getVideoInfos() {
    if (videoInfos == null) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        VideoInfoDao targetDao = daoSession.getVideoInfoDao();
        List<VideoInfo> videoInfosNew = targetDao
                ._queryVideoFile_VideoInfos(fileID);
        synchronized (this) {
            if (videoInfos == null) {
                videoInfos = videoInfosNew;
            }
        }
    }
    return videoInfos;
}
 
开发者ID:bigjelly,项目名称:ShaddockVideoPlayer,代码行数:23,代码来源:VideoFile.java


示例19: getBook

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/** To-one relationship, resolved on first access. */
@Generated(hash = 1574749097)
public ReviewBookBean getBook() {
    String __key = this.bookId;
    if (book__resolvedKey == null || book__resolvedKey != __key) {
        final DaoSession daoSession = this.daoSession;
        if (daoSession == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        ReviewBookBeanDao targetDao = daoSession.getReviewBookBeanDao();
        ReviewBookBean bookNew = targetDao.load(__key);
        synchronized (this) {
            book = bookNew;
            book__resolvedKey = __key;
        }
    }
    return book;
}
 
开发者ID:newbiechen1024,项目名称:NovelReader,代码行数:19,代码来源:BookReviewBean.java


示例20: update

import org.greenrobot.greendao.DaoException; //导入依赖的package包/类
/**
 * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
 * Entity must attached to an entity context.
 */
@Generated(hash = 713229351)
public void update() {
    if (myDao == null) {
        throw new DaoException("Entity is detached from DAO context");
    }
    myDao.update(this);
}
 
开发者ID:wulkanowy,项目名称:wulkanowy,代码行数:12,代码来源:Subject.java



注:本文中的org.greenrobot.greendao.DaoException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BytesType类代码示例发布时间:2022-05-21
下一篇:
Java TermsFilter类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap