Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
faecae21
提交
faecae21
authored
12月 05, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
3954b942
显示空白字符变更
内嵌
并排
正在显示
31 个修改的文件
包含
340 行增加
和
108 行删除
+340
-108
Aggregate.java
h2/src/main/org/h2/expression/Aggregate.java
+2
-3
AggregateData.java
h2/src/main/org/h2/expression/AggregateData.java
+3
-0
Alias.java
h2/src/main/org/h2/expression/Alias.java
+8
-10
CompareLike.java
h2/src/main/org/h2/expression/CompareLike.java
+2
-3
Condition.java
h2/src/main/org/h2/expression/Condition.java
+2
-2
ConditionAndOr.java
h2/src/main/org/h2/expression/ConditionAndOr.java
+3
-3
ConditionExists.java
h2/src/main/org/h2/expression/ConditionExists.java
+1
-2
ConditionIn.java
h2/src/main/org/h2/expression/ConditionIn.java
+1
-2
ConditionInSelect.java
h2/src/main/org/h2/expression/ConditionInSelect.java
+1
-1
ConditionNot.java
h2/src/main/org/h2/expression/ConditionNot.java
+3
-0
Expression.java
h2/src/main/org/h2/expression/Expression.java
+201
-15
ExpressionColumn.java
h2/src/main/org/h2/expression/ExpressionColumn.java
+3
-0
ExpressionList.java
h2/src/main/org/h2/expression/ExpressionList.java
+5
-1
ExpressionVisitor.java
h2/src/main/org/h2/expression/ExpressionVisitor.java
+14
-10
Function.java
h2/src/main/org/h2/expression/Function.java
+2
-3
FunctionCall.java
h2/src/main/org/h2/expression/FunctionCall.java
+4
-0
FunctionInfo.java
h2/src/main/org/h2/expression/FunctionInfo.java
+3
-0
JavaAggregate.java
h2/src/main/org/h2/expression/JavaAggregate.java
+8
-5
JavaFunction.java
h2/src/main/org/h2/expression/JavaFunction.java
+3
-0
Operation.java
h2/src/main/org/h2/expression/Operation.java
+4
-1
Parameter.java
h2/src/main/org/h2/expression/Parameter.java
+6
-6
ParameterInterface.java
h2/src/main/org/h2/expression/ParameterInterface.java
+3
-0
ParameterRemote.java
h2/src/main/org/h2/expression/ParameterRemote.java
+6
-3
Rownum.java
h2/src/main/org/h2/expression/Rownum.java
+7
-4
SequenceValue.java
h2/src/main/org/h2/expression/SequenceValue.java
+7
-4
Subquery.java
h2/src/main/org/h2/expression/Subquery.java
+4
-4
ValueExpression.java
h2/src/main/org/h2/expression/ValueExpression.java
+6
-3
Wildcard.java
h2/src/main/org/h2/expression/Wildcard.java
+5
-5
FullTextSettings.java
h2/src/main/org/h2/fulltext/FullTextSettings.java
+3
-0
IndexInfo.java
h2/src/main/org/h2/fulltext/IndexInfo.java
+3
-0
FileSystem.java
h2/src/main/org/h2/store/fs/FileSystem.java
+17
-18
没有找到文件。
h2/src/main/org/h2/expression/Aggregate.java
浏览文件 @
faecae21
...
@@ -36,9 +36,8 @@ import org.h2.value.ValueNull;
...
@@ -36,9 +36,8 @@ import org.h2.value.ValueNull;
import
org.h2.value.ValueString
;
import
org.h2.value.ValueString
;
/**
/**
*
@author Thomas
*
Implements the integrated aggregate functions, such as COUNT, MAX, SUM.
*/
*/
public
class
Aggregate
extends
Expression
{
public
class
Aggregate
extends
Expression
{
// TODO incompatibility to hsqldb: aggregates: hsqldb uses automatic data
// TODO incompatibility to hsqldb: aggregates: hsqldb uses automatic data
// type for sum if value is too big,
// type for sum if value is too big,
...
...
h2/src/main/org/h2/expression/AggregateData.java
浏览文件 @
faecae21
...
@@ -18,6 +18,9 @@ import org.h2.value.ValueInt;
...
@@ -18,6 +18,9 @@ import org.h2.value.ValueInt;
import
org.h2.value.ValueLong
;
import
org.h2.value.ValueLong
;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
* Data stored while calculating an aggregate.
*/
public
class
AggregateData
{
public
class
AggregateData
{
private
final
int
aggregateType
;
private
final
int
aggregateType
;
private
long
count
;
private
long
count
;
...
...
h2/src/main/org/h2/expression/Alias.java
浏览文件 @
faecae21
...
@@ -12,11 +12,9 @@ import org.h2.table.ColumnResolver;
...
@@ -12,11 +12,9 @@ import org.h2.table.ColumnResolver;
import
org.h2.table.TableFilter
;
import
org.h2.table.TableFilter
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
/**
/**
*
@author Thomas
*
A column alias as in SELECT 'Hello' AS NAME ...
*/
*/
public
class
Alias
extends
Expression
{
public
class
Alias
extends
Expression
{
private
final
String
alias
;
private
final
String
alias
;
...
...
h2/src/main/org/h2/expression/CompareLike.java
浏览文件 @
faecae21
...
@@ -22,9 +22,8 @@ import org.h2.value.ValueNull;
...
@@ -22,9 +22,8 @@ import org.h2.value.ValueNull;
import
org.h2.value.ValueString
;
import
org.h2.value.ValueString
;
/**
/**
*
@author Thomas
*
Pattern matching comparison expression: WHERE NAME LIKE ?
*/
*/
public
class
CompareLike
extends
Condition
{
public
class
CompareLike
extends
Condition
{
private
final
CompareMode
compareMode
;
private
final
CompareMode
compareMode
;
...
@@ -129,7 +128,7 @@ public class CompareLike extends Condition {
...
@@ -129,7 +128,7 @@ public class CompareLike extends Condition {
// (at prepare time)
// (at prepare time)
// otherwise we would need to prepare at execute time,
// otherwise we would need to prepare at execute time,
// which is maybe slower (but maybe not in this case!)
// which is maybe slower (but maybe not in this case!)
// TODO optimizer: like: check what other databases do
!
// TODO optimizer: like: check what other databases do
if
(!
right
.
isValueSet
())
{
if
(!
right
.
isValueSet
())
{
return
;
return
;
}
}
...
...
h2/src/main/org/h2/expression/Condition.java
浏览文件 @
faecae21
...
@@ -8,7 +8,7 @@ import org.h2.value.Value;
...
@@ -8,7 +8,7 @@ import org.h2.value.Value;
import
org.h2.value.ValueBoolean
;
import
org.h2.value.ValueBoolean
;
/**
/**
*
@author Thomas
*
Represents a condition returning a boolean value, or NULL.
*/
*/
public
abstract
class
Condition
extends
Expression
{
public
abstract
class
Condition
extends
Expression
{
...
...
h2/src/main/org/h2/expression/ConditionAndOr.java
浏览文件 @
faecae21
...
@@ -17,7 +17,7 @@ import org.h2.value.ValueBoolean;
...
@@ -17,7 +17,7 @@ import org.h2.value.ValueBoolean;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
/**
*
@author Thomas
*
An 'and' or 'or' condition as in WHERE ID=1 AND NAME=?
*/
*/
public
class
ConditionAndOr
extends
Condition
{
public
class
ConditionAndOr
extends
Condition
{
...
...
h2/src/main/org/h2/expression/ConditionExists.java
浏览文件 @
faecae21
...
@@ -15,9 +15,8 @@ import org.h2.value.Value;
...
@@ -15,9 +15,8 @@ import org.h2.value.Value;
import
org.h2.value.ValueBoolean
;
import
org.h2.value.ValueBoolean
;
/**
/**
*
@author Thomas
*
An 'exists' condition as in WHERE EXISTS(SELECT ...)
*/
*/
public
class
ConditionExists
extends
Condition
{
public
class
ConditionExists
extends
Condition
{
private
final
Query
query
;
private
final
Query
query
;
...
...
h2/src/main/org/h2/expression/ConditionIn.java
浏览文件 @
faecae21
...
@@ -24,9 +24,8 @@ import org.h2.value.ValueBoolean;
...
@@ -24,9 +24,8 @@ import org.h2.value.ValueBoolean;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
/**
*
@author Thomas
*
An 'in' condition with a list of values, as in WHERE NAME IN(...)
*/
*/
public
class
ConditionIn
extends
Condition
{
public
class
ConditionIn
extends
Condition
{
private
final
Database
database
;
private
final
Database
database
;
...
...
h2/src/main/org/h2/expression/ConditionInSelect.java
浏览文件 @
faecae21
...
@@ -21,7 +21,7 @@ import org.h2.value.ValueBoolean;
...
@@ -21,7 +21,7 @@ import org.h2.value.ValueBoolean;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
/**
*
@author Thomas
*
An 'in' condition with a subquery, as in WHERE ID IN(SELECT ...)
*/
*/
public
class
ConditionInSelect
extends
Condition
{
public
class
ConditionInSelect
extends
Condition
{
private
Database
database
;
private
Database
database
;
...
...
h2/src/main/org/h2/expression/ConditionNot.java
浏览文件 @
faecae21
...
@@ -13,6 +13,9 @@ import org.h2.table.TableFilter;
...
@@ -13,6 +13,9 @@ import org.h2.table.TableFilter;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
* A NOT condition.
*/
public
class
ConditionNot
extends
Condition
{
public
class
ConditionNot
extends
Condition
{
private
Expression
condition
;
private
Expression
condition
;
...
...
h2/src/main/org/h2/expression/Expression.java
浏览文件 @
faecae21
...
@@ -14,7 +14,6 @@ import org.h2.table.TableFilter;
...
@@ -14,7 +14,6 @@ import org.h2.table.TableFilter;
import
org.h2.util.StringUtils
;
import
org.h2.util.StringUtils
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
/**
/**
* An expression is a operation, a value, or a function in a query.
* An expression is a operation, a value, or a function in a query.
*/
*/
...
@@ -22,82 +21,257 @@ public abstract class Expression {
...
@@ -22,82 +21,257 @@ public abstract class Expression {
private
boolean
addedToFilter
;
private
boolean
addedToFilter
;
/**
* Return the resulting value for the current row.
*
* @param session the session
* @return the result
*/
public
abstract
Value
getValue
(
Session
session
)
throws
SQLException
;
public
abstract
Value
getValue
(
Session
session
)
throws
SQLException
;
/**
* Return the data type. The data type may not be known before the optimization phase.
*
* @param session the session
* @return the type
*/
public
abstract
int
getType
();
public
abstract
int
getType
();
/**
* Map the columns of the resolver to expression columns.
*
* @param resolver the column resolver
* @return level the subquery nesting level
*/
public
abstract
void
mapColumns
(
ColumnResolver
resolver
,
int
level
)
throws
SQLException
;
public
abstract
void
mapColumns
(
ColumnResolver
resolver
,
int
level
)
throws
SQLException
;
/**
* Try to optimize the expression.
*
* @param session the session
* @return the optimized expression
*/
public
abstract
Expression
optimize
(
Session
session
)
throws
SQLException
;
public
abstract
Expression
optimize
(
Session
session
)
throws
SQLException
;
public
abstract
void
setEvaluatable
(
TableFilter
tableFilter
,
boolean
b
);
/**
* Tell the expression columns whether the table filter can return values now.
* This is used when optimizing the query.
*
* @param tableFilter the table filter
* @param value true if the table filter can return value
*/
public
abstract
void
setEvaluatable
(
TableFilter
tableFilter
,
boolean
value
);
/**
* Get the scale of this expression.
*
* @return the scale
*/
public
abstract
int
getScale
();
public
abstract
int
getScale
();
/**
* Get the precision of this expression.
*
* @return the precision
*/
public
abstract
long
getPrecision
();
public
abstract
long
getPrecision
();
/**
* Get the display size of this expression.
*
* @return the display size
*/
public
abstract
int
getDisplaySize
();
public
abstract
int
getDisplaySize
();
/**
* Get the SQL statement of this expression.
* This may not always be the original SQL statement,
* specially after optimization.
*
* @return the SQL statement
*/
public
abstract
String
getSQL
();
public
abstract
String
getSQL
();
/**
* Update an aggregate value.
* This method is called at statement execution time once for each row.
*
* @param session the session
*/
public
abstract
void
updateAggregate
(
Session
session
)
throws
SQLException
;
public
abstract
void
updateAggregate
(
Session
session
)
throws
SQLException
;
/**
* Check if this expression and all sub-expressions can fulfill a criteria.
* If any part returns false, the result is false.
*
* @param visitor the visitor
* @return if the criteria can be fulfilled
*/
public
abstract
boolean
isEverything
(
ExpressionVisitor
visitor
);
public
abstract
boolean
isEverything
(
ExpressionVisitor
visitor
);
/**
* Estimate the cost to process the expression.
* Used when optimizing the query, to calculate the query plan
* with the lowest estimated cost.
*
* @return the estimated cost
*/
public
abstract
int
getCost
();
public
abstract
int
getCost
();
/**
* Check if this expression and all sub-expressions can fulfill a criteria.
* This is a convenience function.
*
* @param expressionVisitorType the visitor type
* @return if the criteria can be fulfilled
*/
public
final
boolean
isEverything
(
int
expressionVisitorType
)
{
public
final
boolean
isEverything
(
int
expressionVisitorType
)
{
ExpressionVisitor
visitor
=
ExpressionVisitor
.
get
(
expressionVisitorType
);
ExpressionVisitor
visitor
=
ExpressionVisitor
.
get
(
expressionVisitorType
);
return
isEverything
(
visitor
);
return
isEverything
(
visitor
);
}
}
/**
* If it is possible, return the negated expression. This is used
* to optimize NOT expressions: NOT ID>10 can be converted to
* ID<=10. Returns null if negating is not possible.
*
* @param session the session
* @return the negated expression, or null
*/
public
Expression
getNotIfPossible
(
Session
session
)
{
public
Expression
getNotIfPossible
(
Session
session
)
{
// by default it is not possible
// by default it is not possible
return
null
;
return
null
;
}
}
/**
* Check if this expression will always return the same value.
*
* @return if the expression is constant
*/
public
boolean
isConstant
()
{
public
boolean
isConstant
()
{
return
false
;
return
false
;
}
}
/**
* Is the value of a parameter set.
*
* @return if it is set
*/
public
boolean
isValueSet
()
{
public
boolean
isValueSet
()
{
return
false
;
return
false
;
}
}
/**
* Check if this is an auto-increment column.
*
* @return true if it is an auto-increment column
*/
public
boolean
isAutoIncrement
()
{
public
boolean
isAutoIncrement
()
{
return
false
;
return
false
;
}
}
/**
* Get the value in form of a boolean expression.
* Returns true, false, or null.
* In this database, everything can be a condition.
*
* @param session the session
* @return the result
*/
public
Boolean
getBooleanValue
(
Session
session
)
throws
SQLException
{
public
Boolean
getBooleanValue
(
Session
session
)
throws
SQLException
{
// TODO optimization: is this required?
return
getValue
(
session
).
getBoolean
();
return
getValue
(
session
).
getBoolean
();
}
}
/**
* Create index conditions if possible and attach them to the table filter.
*
* @param session the session
* @param filter the table filter
*/
public
void
createIndexConditions
(
Session
session
,
TableFilter
filter
)
throws
SQLException
{
public
void
createIndexConditions
(
Session
session
,
TableFilter
filter
)
throws
SQLException
{
// default is do nothing
// default is do nothing
}
}
/**
* Get the column name or alias name of this expression.
*
* @return the column name
*/
public
String
getColumnName
()
{
public
String
getColumnName
()
{
return
getAlias
();
return
getAlias
();
}
}
/**
* Get the schema name, or null
*
* @return the schema name
*/
public
String
getSchemaName
()
{
public
String
getSchemaName
()
{
return
null
;
return
null
;
}
}
/**
* Get the table name, or null
*
* @return the table name
*/
public
String
getTableName
()
{
public
String
getTableName
()
{
return
null
;
return
null
;
}
}
/**
* Check whether this expression is a column and can store null values.
*
* @return whether null values are allowed
*/
public
int
getNullable
()
{
public
int
getNullable
()
{
return
Column
.
NULLABLE_UNKNOWN
;
return
Column
.
NULLABLE_UNKNOWN
;
}
}
/**
* Get the table alias name or null
* if this expression does not represent a column.
*
* @return the table alias name
*/
public
String
getTableAlias
()
{
public
String
getTableAlias
()
{
return
null
;
return
null
;
}
}
/**
* Get the alias name of a column or SQL expression
* if it is not an aliased expression.
*
* @return the alias name
*/
public
String
getAlias
()
{
public
String
getAlias
()
{
return
StringUtils
.
unEnclose
(
getSQL
());
return
StringUtils
.
unEnclose
(
getSQL
());
}
}
/**
* Only returns true if the expression is a wildcard.
*
* @return if this expression is a wildcard
*/
public
boolean
isWildcard
()
{
public
boolean
isWildcard
()
{
return
false
;
return
false
;
}
}
/**
* Returns the main expression, skipping aliases.
*
* @return the expression
*/
public
Expression
getNonAliasExpression
()
{
public
Expression
getNonAliasExpression
()
{
return
this
;
return
this
;
}
}
/**
* Add conditions to a table filter if they can be evaluated.
*
* @param filter the table filter
* @param outerJoin if the expression is part of an outer join
*/
public
void
addFilterConditions
(
TableFilter
filter
,
boolean
outerJoin
)
{
public
void
addFilterConditions
(
TableFilter
filter
,
boolean
outerJoin
)
{
if
(!
addedToFilter
&&
!
outerJoin
&&
isEverything
(
ExpressionVisitor
.
EVALUATABLE
))
{
if
(!
addedToFilter
&&
!
outerJoin
&&
isEverything
(
ExpressionVisitor
.
EVALUATABLE
))
{
filter
.
addFilterCondition
(
this
,
false
);
filter
.
addFilterCondition
(
this
,
false
);
...
@@ -105,10 +279,22 @@ public abstract class Expression {
...
@@ -105,10 +279,22 @@ public abstract class Expression {
}
}
}
}
/**
* Convert this expression to a String.
*
* @return the string representation
*/
public
String
toString
()
{
public
String
toString
()
{
return
getSQL
();
return
getSQL
();
}
}
/**
* Optimize IN(...) expressions if possible.
*
* @param session the session
* @param select the query
* @return the optimized expression
*/
public
Expression
optimizeInJoin
(
Session
session
,
Select
select
)
throws
SQLException
{
public
Expression
optimizeInJoin
(
Session
session
,
Select
select
)
throws
SQLException
{
return
this
;
return
this
;
}
}
...
...
h2/src/main/org/h2/expression/ExpressionColumn.java
浏览文件 @
faecae21
...
@@ -23,6 +23,9 @@ import org.h2.table.TableFilter;
...
@@ -23,6 +23,9 @@ import org.h2.table.TableFilter;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueBoolean
;
import
org.h2.value.ValueBoolean
;
/**
* A expression that represents a column of a table or view.
*/
public
class
ExpressionColumn
extends
Expression
{
public
class
ExpressionColumn
extends
Expression
{
private
Database
database
;
private
Database
database
;
private
String
schemaName
;
private
String
schemaName
;
...
...
h2/src/main/org/h2/expression/ExpressionList.java
浏览文件 @
faecae21
...
@@ -12,6 +12,10 @@ import org.h2.table.TableFilter;
...
@@ -12,6 +12,10 @@ import org.h2.table.TableFilter;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueArray
;
import
org.h2.value.ValueArray
;
/**
* A list of expressions, as in (ID, NAME).
* The result of this expression is an array.
*/
public
class
ExpressionList
extends
Expression
{
public
class
ExpressionList
extends
Expression
{
private
Expression
[]
list
;
private
Expression
[]
list
;
...
...
h2/src/main/org/h2/expression/ExpressionVisitor.java
浏览文件 @
faecae21
...
@@ -7,6 +7,10 @@ package org.h2.expression;
...
@@ -7,6 +7,10 @@ package org.h2.expression;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.ColumnResolver
;
import
org.h2.table.Table
;
import
org.h2.table.Table
;
/**
* The visitor pattern is used to iterate through all expressions of a query
* to optimize a statement.
*/
public
class
ExpressionVisitor
{
public
class
ExpressionVisitor
{
// Is the value independent on unset parameters or on columns of a higher level query, or sequence values (that means can it be evaluated right now)
// Is the value independent on unset parameters or on columns of a higher level query, or sequence values (that means can it be evaluated right now)
public
static
final
int
INDEPENDENT
=
0
;
public
static
final
int
INDEPENDENT
=
0
;
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
faecae21
...
@@ -56,9 +56,8 @@ import org.h2.value.ValueTimestamp;
...
@@ -56,9 +56,8 @@ import org.h2.value.ValueTimestamp;
import
org.h2.value.ValueUuid
;
import
org.h2.value.ValueUuid
;
/**
/**
*
@author Thomas
*
This class implements most built-in functions of this database.
*/
*/
public
class
Function
extends
Expression
implements
FunctionCall
{
public
class
Function
extends
Expression
implements
FunctionCall
{
// TODO functions: add function hashcode(value)
// TODO functions: add function hashcode(value)
...
...
h2/src/main/org/h2/expression/FunctionCall.java
浏览文件 @
faecae21
...
@@ -10,6 +10,10 @@ import org.h2.engine.Session;
...
@@ -10,6 +10,10 @@ import org.h2.engine.Session;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueResultSet
;
import
org.h2.value.ValueResultSet
;
/**
* This interface is used by the built-in functions,
* as well as the user defined functions.
*/
public
interface
FunctionCall
{
public
interface
FunctionCall
{
String
getName
();
String
getName
();
...
...
h2/src/main/org/h2/expression/FunctionInfo.java
浏览文件 @
faecae21
...
@@ -4,6 +4,9 @@
...
@@ -4,6 +4,9 @@
*/
*/
package
org
.
h2
.
expression
;
package
org
.
h2
.
expression
;
/**
* This class contains information about a built-in function.
*/
class
FunctionInfo
{
class
FunctionInfo
{
String
name
;
String
name
;
int
type
;
int
type
;
...
...
h2/src/main/org/h2/expression/JavaAggregate.java
浏览文件 @
faecae21
...
@@ -21,6 +21,9 @@ import org.h2.value.DataType;
...
@@ -21,6 +21,9 @@ import org.h2.value.DataType;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
* This class wrapps a user defined aggregate.
*/
public
class
JavaAggregate
extends
Expression
{
public
class
JavaAggregate
extends
Expression
{
private
final
UserAggregate
userAggregate
;
private
final
UserAggregate
userAggregate
;
...
...
h2/src/main/org/h2/expression/JavaFunction.java
浏览文件 @
faecae21
...
@@ -15,6 +15,9 @@ import org.h2.value.Value;
...
@@ -15,6 +15,9 @@ import org.h2.value.Value;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueResultSet
;
import
org.h2.value.ValueResultSet
;
/**
* This class wrapps a user defined function.
*/
public
class
JavaFunction
extends
Expression
implements
FunctionCall
{
public
class
JavaFunction
extends
Expression
implements
FunctionCall
{
private
FunctionAlias
functionAlias
;
private
FunctionAlias
functionAlias
;
...
...
h2/src/main/org/h2/expression/Operation.java
浏览文件 @
faecae21
...
@@ -16,6 +16,9 @@ import org.h2.value.Value;
...
@@ -16,6 +16,9 @@ import org.h2.value.Value;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueString
;
import
org.h2.value.ValueString
;
/**
* A mathematical expression, or string concatenation.
*/
public
class
Operation
extends
Expression
{
public
class
Operation
extends
Expression
{
public
static
final
int
CONCAT
=
0
,
PLUS
=
1
,
MINUS
=
2
,
MULTIPLY
=
3
,
DIVIDE
=
4
,
NEGATE
=
5
;
public
static
final
int
CONCAT
=
0
,
PLUS
=
1
,
MINUS
=
2
,
MULTIPLY
=
3
,
DIVIDE
=
4
,
NEGATE
=
5
;
private
int
opType
;
private
int
opType
;
...
...
h2/src/main/org/h2/expression/Parameter.java
浏览文件 @
faecae21
...
@@ -15,7 +15,7 @@ import org.h2.value.ValueBoolean;
...
@@ -15,7 +15,7 @@ import org.h2.value.ValueBoolean;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
/**
*
@author Thomas
*
A parameter of a prepared statement.
*/
*/
public
class
Parameter
extends
Expression
implements
ParameterInterface
{
public
class
Parameter
extends
Expression
implements
ParameterInterface
{
...
...
h2/src/main/org/h2/expression/ParameterInterface.java
浏览文件 @
faecae21
...
@@ -8,6 +8,9 @@ import java.sql.SQLException;
...
@@ -8,6 +8,9 @@ import java.sql.SQLException;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
/**
* The interface for client side (remote) and server side parameters.
*/
public
interface
ParameterInterface
{
public
interface
ParameterInterface
{
void
setValue
(
Value
value
);
void
setValue
(
Value
value
);
Value
getParamValue
()
throws
SQLException
;
Value
getParamValue
()
throws
SQLException
;
...
...
h2/src/main/org/h2/expression/ParameterRemote.java
浏览文件 @
faecae21
...
@@ -10,6 +10,9 @@ import org.h2.constant.ErrorCode;
...
@@ -10,6 +10,9 @@ import org.h2.constant.ErrorCode;
import
org.h2.message.Message
;
import
org.h2.message.Message
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
/**
* A client side (remote) parameter.
*/
public
class
ParameterRemote
implements
ParameterInterface
{
public
class
ParameterRemote
implements
ParameterInterface
{
private
Value
value
;
private
Value
value
;
...
...
h2/src/main/org/h2/expression/Rownum.java
浏览文件 @
faecae21
...
@@ -14,6 +14,9 @@ import org.h2.table.TableFilter;
...
@@ -14,6 +14,9 @@ import org.h2.table.TableFilter;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
import
org.h2.value.ValueInt
;
import
org.h2.value.ValueInt
;
/**
* Represents the ROWNUM function.
*/
public
class
Rownum
extends
Expression
{
public
class
Rownum
extends
Expression
{
private
Prepared
prepared
;
private
Prepared
prepared
;
...
...
h2/src/main/org/h2/expression/SequenceValue.java
浏览文件 @
faecae21
...
@@ -15,6 +15,9 @@ import org.h2.value.Value;
...
@@ -15,6 +15,9 @@ import org.h2.value.Value;
import
org.h2.value.ValueInt
;
import
org.h2.value.ValueInt
;
import
org.h2.value.ValueLong
;
import
org.h2.value.ValueLong
;
/**
* Wraps a sequence when used in a statement.
*/
public
class
SequenceValue
extends
Expression
{
public
class
SequenceValue
extends
Expression
{
private
Sequence
sequence
;
private
Sequence
sequence
;
...
...
h2/src/main/org/h2/expression/Subquery.java
浏览文件 @
faecae21
...
@@ -18,9 +18,9 @@ import org.h2.value.ValueArray;
...
@@ -18,9 +18,9 @@ import org.h2.value.ValueArray;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
/**
* @author Thomas
* A query returning a single value.
* Subqueries are used inside other statements.
*/
*/
public
class
Subquery
extends
Expression
{
public
class
Subquery
extends
Expression
{
private
Query
query
;
private
Query
query
;
...
...
h2/src/main/org/h2/expression/ValueExpression.java
浏览文件 @
faecae21
...
@@ -15,6 +15,9 @@ import org.h2.value.Value;
...
@@ -15,6 +15,9 @@ import org.h2.value.Value;
import
org.h2.value.ValueBoolean
;
import
org.h2.value.ValueBoolean
;
import
org.h2.value.ValueNull
;
import
org.h2.value.ValueNull
;
/**
* An expression representing a constant value.
*/
public
class
ValueExpression
extends
Expression
{
public
class
ValueExpression
extends
Expression
{
private
Value
value
;
private
Value
value
;
...
...
h2/src/main/org/h2/expression/Wildcard.java
浏览文件 @
faecae21
...
@@ -13,11 +13,11 @@ import org.h2.table.ColumnResolver;
...
@@ -13,11 +13,11 @@ import org.h2.table.ColumnResolver;
import
org.h2.table.TableFilter
;
import
org.h2.table.TableFilter
;
import
org.h2.value.Value
;
import
org.h2.value.Value
;
/**
/**
* @author Thomas
* A wildcard expression as in SELECT * FROM TEST.
* This object is only used temporarily during the parsing phase, and later
* replaced by column expressions.
*/
*/
public
class
Wildcard
extends
Expression
{
public
class
Wildcard
extends
Expression
{
private
String
schema
;
private
String
schema
;
private
String
table
;
private
String
table
;
...
...
h2/src/main/org/h2/fulltext/FullTextSettings.java
浏览文件 @
faecae21
...
@@ -14,6 +14,9 @@ import java.util.HashSet;
...
@@ -14,6 +14,9 @@ import java.util.HashSet;
import
org.h2.util.ObjectUtils
;
import
org.h2.util.ObjectUtils
;
/**
* The global settings of a full text search.
*/
public
class
FullTextSettings
{
public
class
FullTextSettings
{
private
static
HashMap
settings
=
new
HashMap
();
private
static
HashMap
settings
=
new
HashMap
();
...
...
h2/src/main/org/h2/fulltext/IndexInfo.java
浏览文件 @
faecae21
...
@@ -4,6 +4,9 @@
...
@@ -4,6 +4,9 @@
*/
*/
package
org
.
h2
.
fulltext
;
package
org
.
h2
.
fulltext
;
/**
* The settings of one full text search index.
*/
public
class
IndexInfo
{
public
class
IndexInfo
{
int
id
;
int
id
;
String
schemaName
;
String
schemaName
;
...
...
h2/src/main/org/h2/store/fs/FileSystem.java
浏览文件 @
faecae21
...
@@ -9,7 +9,6 @@ import java.io.InputStream;
...
@@ -9,7 +9,6 @@ import java.io.InputStream;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
public
abstract
class
FileSystem
{
public
abstract
class
FileSystem
{
public
static
final
String
MEMORY_PREFIX
=
"memFS:"
;
public
static
final
String
MEMORY_PREFIX
=
"memFS:"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论