本文整理汇总了Java中com.gs.fw.common.mithra.databasetype.H2DatabaseType类的典型用法代码示例。如果您正苦于以下问题:Java H2DatabaseType类的具体用法?Java H2DatabaseType怎么用?Java H2DatabaseType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
H2DatabaseType类属于com.gs.fw.common.mithra.databasetype包,在下文中一共展示了H2DatabaseType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInstanceForDbName
import com.gs.fw.common.mithra.databasetype.H2DatabaseType; //导入依赖的package包/类
/**
* This method returns an instance of a ConnectionManagerForTests.
*
* @param dbName The database name used by the connection manager when creating a Connection.
* @return An instance of a ConnectionManagerForTests
*/
public static ConnectionManagerForTests getInstanceForDbName(String dbName)
{
synchronized (configToPoolMap)
{
ConnectionManagerForTests existing = configToPoolMap.get(dbName);
if (existing == null)
{
existing = connectionManagerFactory.createConnectionManager(dbName);
existing.setDatabaseType(H2DatabaseType.getInstance());
existing.setDatabaseTimeZone(TimeZone.getTimeZone("America/New_York"));
existing.setConnectionManagerIdentifier(dbName);
configToPoolMap.put(dbName, existing);
}
existing.setDefaultSource(dbName);
return existing;
}
}
示例2: fullyShutdown
import com.gs.fw.common.mithra.databasetype.H2DatabaseType; //导入依赖的package包/类
@Override
public void fullyShutdown()
{
super.fullyShutdown();
for (Iterator<XAConnectionManager> it = connectionManagerMap.values().iterator(); it.hasNext();)
{
XAConnectionManager connectionManager = it.next();
if (connectionManager.getDatabaseType() instanceof H2DatabaseType)
{
try
{
connectionManager.getConnection().createStatement().execute("SHUTDOWN");
connectionManager.shutdown();
}
catch (Throwable t)
{
logger.error("Could not shutdown database", t);
}
it.remove();
}
}
}
示例3: startTestDatabaseServer
import com.gs.fw.common.mithra.databasetype.H2DatabaseType; //导入依赖的package包/类
protected void startTestDatabaseServer(DatabaseType databaseType)
{
if (databaseType instanceof DerbyDatabaseType)
{
DerbyServer.getInstance().startDerbyServer();
}
else if (databaseType instanceof H2DatabaseType)
{
H2DbServer.getInstance().startH2DbServer();
}
}
示例4: testDeepFetchOneToManyWithoutSourceId
import com.gs.fw.common.mithra.databasetype.H2DatabaseType; //导入依赖的package包/类
public void testDeepFetchOneToManyWithoutSourceId()
{
H2DatabaseType.getInstance().setQuoteTableName(true);
if (OrderFinder.getMithraObjectPortal().getCache().isPartialCache())
{
int count = MithraManagerProvider.getMithraManager().getDatabaseRetrieveCount();
OrderList order = new OrderList(OrderFinder.orderId().eq(1));
order.deepFetch(OrderFinder.items());
order.forceResolve();
assertTrue(MithraManagerProvider.getMithraManager().getDatabaseRetrieveCount() - count > 1);
}
H2DatabaseType.getInstance().setQuoteTableName(false);
}
示例5: getDatabaseType
import com.gs.fw.common.mithra.databasetype.H2DatabaseType; //导入依赖的package包/类
public DatabaseType getDatabaseType()
{
return H2DatabaseType.getInstance();
}
示例6: MithraTestResource
import com.gs.fw.common.mithra.databasetype.H2DatabaseType; //导入依赖的package包/类
public MithraTestResource(String configFilename)
{
this(configFilename, H2DatabaseType.getInstance());
}