Search in sources :

Example 1 with DBMetaProvider

use of org.dbflute.dbmeta.DBMetaProvider in project dbflute-core by dbflute.

the class ResourceContext method provideDBMetaChecked.

/**
 * @param tableFlexibleName The flexible name of table. (NotNull)
 * @return The instance of DB meta. (NotNull)
 */
public static DBMeta provideDBMetaChecked(String tableFlexibleName) {
    assertResourceContextExists();
    final ResourceContext context = getResourceContextOnThread();
    final DBMetaProvider provider = context.getDBMetaProvider();
    if (provider == null) {
        String msg = "The provider of DB meta should exist:";
        msg = msg + " tableFlexibleName=" + tableFlexibleName + " context=" + context;
        throw new IllegalStateException(msg);
    }
    return provider.provideDBMetaChecked(tableFlexibleName);
}
Also used : DBMetaProvider(org.dbflute.dbmeta.DBMetaProvider)

Example 2 with DBMetaProvider

use of org.dbflute.dbmeta.DBMetaProvider in project dbflute-core by dbflute.

the class AbstractOutsideSqlCommand method createOutsideSqlContext.

// ===================================================================================
// OutsideSql Element
// ==================
protected OutsideSqlContext createOutsideSqlContext() {
    final DBMetaProvider dbmetaProvider = ResourceContext.dbmetaProvider();
    final String outsideSqlPackage = ResourceContext.getOutsideSqlPackage();
    final OutsideSqlContext context = _outsideSqlContextFactory.createContext(dbmetaProvider, outsideSqlPackage);
    setupOutsideSqlContextProperty(context);
    context.setupBehaviorQueryPathIfNeeds();
    return context;
}
Also used : OutsideSqlContext(org.dbflute.outsidesql.OutsideSqlContext) DBMetaProvider(org.dbflute.dbmeta.DBMetaProvider)

Example 3 with DBMetaProvider

use of org.dbflute.dbmeta.DBMetaProvider in project dbflute-core by dbflute.

the class ResourceContext method provideDBMetaChecked.

/**
 * @param entityType The entity type of table. (NotNull)
 * @return The instance of DB meta. (NotNull)
 */
public static DBMeta provideDBMetaChecked(Class<?> entityType) {
    assertResourceContextExists();
    final ResourceContext context = getResourceContextOnThread();
    final DBMetaProvider provider = context.getDBMetaProvider();
    if (provider == null) {
        String msg = "The provider of DB meta should exist:";
        msg = msg + " entityType=" + entityType + " context=" + context;
        throw new IllegalStateException(msg);
    }
    return provider.provideDBMetaChecked(entityType);
}
Also used : DBMetaProvider(org.dbflute.dbmeta.DBMetaProvider)

Example 4 with DBMetaProvider

use of org.dbflute.dbmeta.DBMetaProvider in project dbflute-core by dbflute.

the class ResourceContext method dbmetaProvider.

/**
 * @return The provider of DB meta. (NotNull)
 */
public static DBMetaProvider dbmetaProvider() {
    assertResourceContextExists();
    final ResourceContext context = getResourceContextOnThread();
    final DBMetaProvider provider = context.getDBMetaProvider();
    if (provider == null) {
        String msg = "The provider of DB meta should exist: context=" + context;
        throw new IllegalStateException(msg);
    }
    return provider;
}
Also used : DBMetaProvider(org.dbflute.dbmeta.DBMetaProvider)

Aggregations

DBMetaProvider (org.dbflute.dbmeta.DBMetaProvider)4 OutsideSqlContext (org.dbflute.outsidesql.OutsideSqlContext)1