Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
9c3816f0
提交
9c3816f0
authored
11月 14, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
small improvements
上级
c9400ca5
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
18 行增加
和
24 行删除
+18
-24
H2Platform.java.txt
.../toplink/essentials/platform/database/H2Platform.java.txt
+18
-24
没有找到文件。
h2/src/tools/oracle/toplink/essentials/platform/database/H2Platform.java.txt
浏览文件 @
9c3816f0
...
@@ -21,16 +21,14 @@
...
@@ -21,16 +21,14 @@
// Copyright (c) 1998, 2006, Oracle. All rights reserved.
// Copyright (c) 1998, 2006, Oracle. All rights reserved.
package oracle.toplink.essentials.platform.database;
package oracle.toplink.essentials.platform.database;
import java.util.*;
import java.io.IOException;
import java.io.*;
import java.io.Writer;
import java.sql.*;
import java.util.Hashtable;
import oracle.toplink.essentials.exceptions.*;
import oracle.toplink.essentials.queryframework.*;
import oracle.toplink.essentials.exceptions.ValidationException;
import oracle.toplink.essentials.internal.helper.*;
import oracle.toplink.essentials.expressions.ExpressionOperator;
import oracle.toplink.essentials.expressions.*;
import oracle.toplink.essentials.internal.databaseaccess.FieldTypeDefinition;
import oracle.toplink.essentials.internal.expressions.*;
import oracle.toplink.essentials.queryframework.ValueReadQuery;
import oracle.toplink.essentials.internal.databaseaccess.*;
import oracle.toplink.essentials.internal.sessions.AbstractSession;
/**
/**
* This platform provides H2 specific behaviour.
* This platform provides H2 specific behaviour.
...
@@ -48,12 +46,9 @@ import oracle.toplink.essentials.internal.sessions.AbstractSession;
...
@@ -48,12 +46,9 @@ import oracle.toplink.essentials.internal.sessions.AbstractSession;
* @author Marcio Borges (http://www.marciowb.net/blog/2008_08_01_)
* @author Marcio Borges (http://www.marciowb.net/blog/2008_08_01_)
*/
*/
public class H2Platform extends DatabasePlatform {
public class H2Platform extends DatabasePlatform {
public H2Platform() {
}
protected Hashtable buildFieldTypes() {
protected Hashtable buildFieldTypes() {
Hashtable fieldTypeMapping;
Hashtable fieldTypeMapping;
fieldTypeMapping = super.buildFieldTypes();
fieldTypeMapping = super.buildFieldTypes();
fieldTypeMapping.put(Boolean.class, new FieldTypeDefinition("TINYINT", false));
fieldTypeMapping.put(Boolean.class, new FieldTypeDefinition("TINYINT", false));
fieldTypeMapping.put(Integer.class, new FieldTypeDefinition("INTEGER", false));
fieldTypeMapping.put(Integer.class, new FieldTypeDefinition("INTEGER", false));
...
@@ -74,15 +69,9 @@ public class H2Platform extends DatabasePlatform {
...
@@ -74,15 +69,9 @@ public class H2Platform extends DatabasePlatform {
fieldTypeMapping.put(java.sql.Date.class, new FieldTypeDefinition("DATE", false));
fieldTypeMapping.put(java.sql.Date.class, new FieldTypeDefinition("DATE", false));
fieldTypeMapping.put(java.sql.Time.class, new FieldTypeDefinition("TIME", false));
fieldTypeMapping.put(java.sql.Time.class, new FieldTypeDefinition("TIME", false));
fieldTypeMapping.put(java.sql.Timestamp.class, new FieldTypeDefinition("TIMESTAMP", false));
fieldTypeMapping.put(java.sql.Timestamp.class, new FieldTypeDefinition("TIMESTAMP", false));
return fieldTypeMapping;
return fieldTypeMapping;
}
}
// public boolean isHSQL() {
// return true;
// }
public boolean isH2() {
public boolean isH2() {
return true;
return true;
}
}
...
@@ -100,8 +89,6 @@ public class H2Platform extends DatabasePlatform {
...
@@ -100,8 +89,6 @@ public class H2Platform extends DatabasePlatform {
buff.append(")");
buff.append(")");
String sql = buff.toString();
String sql = buff.toString();
return new ValueReadQuery(sql);
return new ValueReadQuery(sql);
// return new ValueReadQuery("CALL NEXT VALUE FOR " + getQualifiedSequenceName(seqName));
// return new ValueReadQuery("SELECT " + getQualifiedSequenceName(seqName) + ".NEXTVAL FROM DUAL");
}
}
public boolean supportsNativeSequenceNumbers() {
public boolean supportsNativeSequenceNumbers() {
...
@@ -111,9 +98,8 @@ public class H2Platform extends DatabasePlatform {
...
@@ -111,9 +98,8 @@ public class H2Platform extends DatabasePlatform {
protected String getQualifiedSequenceName(String seqName) {
protected String getQualifiedSequenceName(String seqName) {
if (getTableQualifier().equals("")) {
if (getTableQualifier().equals("")) {
return seqName;
return seqName;
} else {
return getTableQualifier() + "." + seqName;
}
}
return getTableQualifier() + "." + seqName;
}
}
public boolean supportsSelectForUpdateNoWait() {
public boolean supportsSelectForUpdateNoWait() {
...
@@ -140,5 +126,13 @@ public class H2Platform extends DatabasePlatform {
...
@@ -140,5 +126,13 @@ public class H2Platform extends DatabasePlatform {
public ValueReadQuery buildSelectQueryForIdentity() {
public ValueReadQuery buildSelectQueryForIdentity() {
return new ValueReadQuery("SELECT IDENTITY()");
return new ValueReadQuery("SELECT IDENTITY()");
}
}
public void printFieldIdentityClause(Writer writer) throws ValidationException {
try {
writer.write(" IDENTITY");
} catch (final IOException ioException) {
throw ValidationException.fileError(ioException);
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论