提交 b5c947e5 authored 作者: thomasmueller's avatar thomasmueller

Javadocs

上级 d64f8cd9
...@@ -47,16 +47,40 @@ public class Select extends Query { ...@@ -47,16 +47,40 @@ public class Select extends Query {
TableFilter topTableFilter; TableFilter topTableFilter;
private final ArrayList<TableFilter> filters = New.arrayList(); private final ArrayList<TableFilter> filters = New.arrayList();
private final ArrayList<TableFilter> topFilters = New.arrayList(); private final ArrayList<TableFilter> topFilters = New.arrayList();
/**
* The column list, including synthetic columns (columns not shown in the
* result).
*/
ArrayList<Expression> expressions; ArrayList<Expression> expressions;
private Expression[] expressionArray; private Expression[] expressionArray;
private Expression having; private Expression having;
private Expression condition; private Expression condition;
int visibleColumnCount, distinctColumnCount;
/**
* The visible columns (the ones required in the result).
*/
int visibleColumnCount;
private int distinctColumnCount;
private ArrayList<SelectOrderBy> orderList; private ArrayList<SelectOrderBy> orderList;
private ArrayList<Expression> group; private ArrayList<Expression> group;
/**
* The indexes of the group-by columns.
*/
int[] groupIndex; int[] groupIndex;
/**
* Whether a column in the expression list is part of a group-by.
*/
boolean[] groupByExpression; boolean[] groupByExpression;
/**
* Thhe current group-by values.
*/
HashMap<Expression, Object> currentGroup; HashMap<Expression, Object> currentGroup;
private int havingIndex; private int havingIndex;
private boolean isGroupQuery, isGroupSortedQuery; private boolean isGroupQuery, isGroupSortedQuery;
private boolean isForUpdate, isForUpdateMvcc; private boolean isForUpdate, isForUpdateMvcc;
...@@ -65,6 +89,10 @@ public class Select extends Query { ...@@ -65,6 +89,10 @@ public class Select extends Query {
private boolean isPrepared, checkInit; private boolean isPrepared, checkInit;
private boolean sortUsingIndex; private boolean sortUsingIndex;
private SortOrder sort; private SortOrder sort;
/**
* The id of the current group.
*/
int currentGroupRowId; int currentGroupRowId;
public Select(Session session) { public Select(Session session) {
...@@ -165,6 +193,13 @@ public class Select extends Query { ...@@ -165,6 +193,13 @@ public class Select extends Query {
return null; return null;
} }
/**
* Create a row with the current values, for queries with group-sort.
*
* @param keyValues the key values
* @param columnCount the number of columns
* @return the row
*/
Value[] createGroupSortedRow(Value[] keyValues, int columnCount) { Value[] createGroupSortedRow(Value[] keyValues, int columnCount) {
Value[] row = new Value[columnCount]; Value[] row = new Value[columnCount];
for (int j = 0; groupIndex != null && j < groupIndex.length; j++) { for (int j = 0; groupIndex != null && j < groupIndex.length; j++) {
...@@ -632,6 +667,9 @@ public class Select extends Query { ...@@ -632,6 +667,9 @@ public class Select extends Query {
return null; return null;
} }
/**
* Reset the batch-join after the query result is closed.
*/
void resetJoinBatchAfterQuery() { void resetJoinBatchAfterQuery() {
JoinBatch jb = getJoinBatch(); JoinBatch jb = getJoinBatch();
if (jb != null) { if (jb != null) {
......
...@@ -614,6 +614,7 @@ public abstract class Value { ...@@ -614,6 +614,7 @@ public abstract class Value {
* @param precision the precision of the column to convert this value to. * @param precision the precision of the column to convert this value to.
* The special constant <code>-1</code> is used to indicate that * The special constant <code>-1</code> is used to indicate that
* the precision plays no role when converting the value * the precision plays no role when converting the value
* @param mode the conversion mode
* @param column the column that contains the ENUM datatype enumerators, * @param column the column that contains the ENUM datatype enumerators,
* for dealing with ENUM conversions * for dealing with ENUM conversions
* @param mode the database mode * @param mode the database mode
......
...@@ -62,7 +62,7 @@ public class ValueLob extends Value { ...@@ -62,7 +62,7 @@ public class ValueLob extends Value {
/** /**
* Create an input stream that is s subset of the given stream. * Create an input stream that is s subset of the given stream.
* *
* @param inputStream the input stream * @param inputStream the source input stream
* @param oneBasedOffset the offset (1 means no offset) * @param oneBasedOffset the offset (1 means no offset)
* @param length the length of the result, in bytes * @param length the length of the result, in bytes
* @param dataSize the length of the input, in bytes * @param dataSize the length of the input, in bytes
...@@ -83,11 +83,19 @@ public class ValueLob extends Value { ...@@ -83,11 +83,19 @@ public class ValueLob extends Value {
/** /**
* Create a reader that is s subset of the given reader. * Create a reader that is s subset of the given reader.
* *
<<<<<<< Updated upstream
* @param reader the input reader * @param reader the input reader
* @param oneBasedOffset the offset (1 means no offset) * @param oneBasedOffset the offset (1 means no offset)
* @param length the length of the result, in bytes * @param length the length of the result, in bytes
* @param dataSize the length of the input, in bytes * @param dataSize the length of the input, in bytes
* @return the smaller input stream * @return the smaller input stream
=======
* @param reader the source reader
* @param oneBasedOffset the offset (1 means no offset)
* @param length the length of the result, in characters
* @param dataSize the length of the input, in characters
* @return the smaller reader
>>>>>>> Stashed changes
*/ */
static Reader rangeReader(Reader reader, long oneBasedOffset, long length, long dataSize) { static Reader rangeReader(Reader reader, long oneBasedOffset, long length, long dataSize) {
if (dataSize > 0) if (dataSize > 0)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论