EntityMapping.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:hyperjaxb3 作者:
private void createEntity$Table(Mapping context, ClassOutline classOutline,
        Entity entity) {
    final InheritanceType inheritanceStrategy = getInheritanceStrategy(
            context, classOutline, entity);
    switch (inheritanceStrategy) {
    case JOINED:
        if (entity.getTable() == null) {
            entity.setTable(new Table());
        }
        createTable(context, classOutline, entity.getTable());
        break;
    case SINGLE_TABLE:
        if (isRootClass(context, classOutline)) {
            if (entity.getTable() == null) {
                entity.setTable(new Table());
            }
            createTable(context, classOutline, entity.getTable());
        } else {
            if (entity.getTable() != null) {
                entity.setTable(null);
            }
        }
        break;
    case TABLE_PER_CLASS:
        if (entity.getTable() == null) {
            entity.setTable(new Table());
        }
        createTable(context, classOutline, entity.getTable());
        break;
    default:
        throw new IllegalArgumentException("Unknown inheritance strategy.");
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号