本文整理汇总了Java中org.h2.engine.Database.getSettings方法的典型用法代码示例。如果您正苦于以下问题:Java Database.getSettings方法的具体用法?Java Database.getSettings怎么用?Java Database.getSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.h2.engine.Database
的用法示例。
在下文中一共展示了Database.getSettings方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFunction
import org.h2.engine.Database; //导入方法依赖的package包/类
/**
* Get an instance of the given function for this database.
* If no function with this name is found, null is returned.
*
* @param database the database
* @param name the function name
* @return the function object or null
*/
public static Function getFunction(Database database, String name) {
if (!database.getSettings().databaseToUpper) {
// if not yet converted to uppercase, do it now
name = StringUtils.toUpperEnglish(name);
}
FunctionInfo info = getFunctionInfo(name);
if (info == null) {
return null;
}
switch(info.type) {
case TABLE:
case TABLE_DISTINCT:
return new TableFunction(database, info, Long.MAX_VALUE);
default:
return new Function(database, info);
}
}
示例2: Store
import org.h2.engine.Database; //导入方法依赖的package包/类
public Store(Database db, MVStore.Builder builder) {
this.store = builder.open();
if (!db.getSettings().reuseSpace) {
store.setReuseSpace(false);
}
this.transactionStore = new TransactionStore(
store,
new ValueDataType(null, db, null));
transactionStore.init();
}
示例3: needRecompile
import org.h2.engine.Database; //导入方法依赖的package包/类
/**
* Check if the statement needs to be re-compiled.
*
* @return true if it must
*/
public boolean needRecompile() {
Database db = session.getDatabase();
if (db == null) {
throw DbException.get(ErrorCode.CONNECTION_BROKEN_1, "database closed");
}
// parser: currently, compiling every create/drop/... twice
// because needRecompile return true even for the first execution
return prepareAlways ||
modificationMetaId < db.getModificationMetaId() ||
db.getSettings().recompileAlways;
}
示例4: CompareLike
import org.h2.engine.Database; //导入方法依赖的package包/类
public CompareLike(Database db, Expression left, Expression right,
Expression escape, boolean regexp) {
this(db.getCompareMode(), db.getSettings().defaultEscape, left, right,
escape, regexp);
}
示例5: getCreateSQL
import org.h2.engine.Database; //导入方法依赖的package包/类
@Override
public String getCreateSQL() {
Database db = getDatabase();
if (db == null) {
// closed
return null;
}
StatementBuilder buff = new StatementBuilder("CREATE ");
if (isTemporary()) {
if (isGlobalTemporary()) {
buff.append("GLOBAL ");
} else {
buff.append("LOCAL ");
}
buff.append("TEMPORARY ");
} else if (isPersistIndexes()) {
buff.append("CACHED ");
} else {
buff.append("MEMORY ");
}
buff.append("TABLE ");
if (isHidden) {
buff.append("IF NOT EXISTS ");
}
buff.append(getSQL());
if (comment != null) {
buff.append(" COMMENT ").append(StringUtils.quoteStringSQL(comment));
}
buff.append("(\n ");
for (Column column : columns) {
buff.appendExceptFirst(",\n ");
buff.append(column.getCreateSQL());
}
buff.append("\n)");
if (tableEngine != null) {
DbSettings s = db.getSettings();
String d = s.defaultTableEngine;
if (d == null && s.mvStore) {
d = MVTableEngine.class.getName();
}
if (d == null || !tableEngine.endsWith(d)) {
buff.append("\nENGINE ");
buff.append(StringUtils.quoteIdentifier(tableEngine));
}
}
if (!tableEngineParams.isEmpty()) {
buff.append("\nWITH ");
buff.resetCount();
for (String parameter : tableEngineParams) {
buff.appendExceptFirst(", ");
buff.append(StringUtils.quoteIdentifier(parameter));
}
}
if (!isPersistIndexes() && !isPersistData()) {
buff.append("\nNOT PERSISTENT");
}
if (isHidden) {
buff.append("\nHIDDEN");
}
return buff.toString();
}