InjectionRunner.java 文件源码

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

项目:javaee-samples 作者:
private static JPARule createJPARule(PersistenceContext ctx, Object test) {
    DatabaseConfiguration config = findOnTest(DatabaseConfiguration.class, test);

    if (config == null) {
        return new JPARule(ctx, H2, DEFAULT_STORAGE, DEFAULT_MODE);
    }

    switch (config.value()) {
        case H2:
            return new JPARule(ctx, H2, config.h2().storage(), config.h2().mode());
        case UNDEFINED:
        default:
            Map<String, String> properties = new HashMap<>();
            for (PersistenceProperty property : ctx.properties()) {
                properties.put(property.name(), property.value());
            }
            return unitName(ctx.unitName())
                    .database(UNDEFINED)
                    .noInternalProperties()
                    .properties(properties)
                    .build();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号