パッケージ org.nkjmlab.sorm4j
クラス SormFactory
- java.lang.Object
-
- org.nkjmlab.sorm4j.SormFactory
-
-
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 static StringDEFAULT_CONFIG_NAMEDefault config name of Sorm.
-
メソッドの概要
すべてのメソッド staticメソッド concreteメソッド 修飾子とタイプ メソッド 説明 static Sormcreate(String jdbcUrl, String user, String password)Create aSormobject which usesDriverManager.static Sormcreate(String jdbcUrl, String username, String password, String configName)Create aSormobject which usesDriverManagerand the configurations corresponding to the given configName.static Sormcreate(DataSource dataSource)Create aSormobject which usesDataSource.static Sormcreate(DataSource dataSource, String configName)Create aSormobject which usesDataSourceand the configurations corresponding to the given configName.static StringgetConfigString(String configName)Gets the string of the config of the given config name.static voidregisterConfig(String configName, Consumer<Configurator> configuratorConsumer)Registers configuration under the given name.static voidregisterModifiedConfig(String srcConfigName, String newConfigName, Consumer<Configurator> configuratorConsumer)Registers modified configuration of the given Sorm object under the given name.static voidresetDefaultConfig()static OrmConnectiontoOrmConnection(Connection connection)Create aOrmConnectionwrapping the given JDBC Connectionstatic OrmConnectiontoOrmConnection(Connection connection, String configName)Create aOrmConnectionwrapping the given JDBC Connection with the specified configurationsstatic voidupdateDefaultConfig(Consumer<Configurator> configuratorConsumer)Updates default configuration.
-
-
-
メソッドの詳細
-
create
public static Sorm create(DataSource dataSource)
Create aSormobject which usesDataSource.- パラメータ:
dataSource-- 戻り値:
-
create
public static Sorm create(DataSource dataSource, String configName)
Create aSormobject which usesDataSourceand the configurations corresponding to the given configName.- パラメータ:
dataSource-configName-- 戻り値:
-
create
public static Sorm create(String jdbcUrl, String user, String password)
Create aSormobject which usesDriverManager.- パラメータ:
jdbcUrl-user-password-- 戻り値:
-
create
public static Sorm create(String jdbcUrl, String username, String password, String configName)
Create aSormobject which usesDriverManagerand the configurations corresponding to the given configName.- パラメータ:
jdbcUrl-username-password-configName-- 戻り値:
-
getConfigString
public static String getConfigString(String configName)
Gets the string of the config of the given config name.DEFAULT_CONFIG_NAMEis default config name.- パラメータ:
configName-- 戻り値:
-
registerConfig
public static void registerConfig(String configName, Consumer<Configurator> configuratorConsumer)
Registers configuration under the given name.- パラメータ:
configName-configuratorConsumer-
-
registerModifiedConfig
public static void registerModifiedConfig(String srcConfigName, String newConfigName, Consumer<Configurator> configuratorConsumer)
Registers modified configuration of the given Sorm object under the given name.- パラメータ:
srcConfigName-newConfigName-configuratorConsumer-
-
resetDefaultConfig
public static void resetDefaultConfig()
-
toOrmConnection
public static OrmConnection toOrmConnection(Connection connection)
Create aOrmConnectionwrapping the given JDBC Connection- パラメータ:
connection-- 戻り値:
-
toOrmConnection
public static OrmConnection toOrmConnection(Connection connection, String configName)
Create aOrmConnectionwrapping the given JDBC Connection with the specified configurations- パラメータ:
connection-configName-- 戻り値:
-
updateDefaultConfig
public static void updateDefaultConfig(Consumer<Configurator> configuratorConsumer)
Updates default configuration. This updates does not effect existingSormobjects.- パラメータ:
configuratorConsumer-
-
-