本文整理匯總了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());
}