Top Description Fields Constructors Methods
org.h2.table

public Class IndexColumn

extends Object
Class Inheritance
Imports
org.h2.result.SortOrder, org.h2.util.HasSQL, .ParserUtil

This represents a column item of an index. This is required because some indexes support descending sorted columns.

Field Summary

Modifier and TypeField and Description
public Column
column

The column, or null if not set.

public final String
columnName

The column name.

public int
sortType

The sort type.

public static final int
SQL_NO_ORDER

Do not append ordering.

Constructor Summary

AccessConstructor and Description
public
IndexColumn(String
the column name
columnName
)

Creates a new instance with the specified name.

public
IndexColumn(String
the column name
columnName
,
int
the sort type
sortType
)

Creates a new instance with the specified name.

public
IndexColumn(Column
the column
column
)

Creates a new instance with the specified column.

Method Summary

Modifier and TypeMethod and Description
public StringBuilder

Returns:

the specified string builder
getSQL
(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Appends the SQL snippet for this index column to the specified string builder.

public static void
mapColumns(IndexColumn[]
the column list with column names set
indexColumns
,
Table
the table from where to map the column names to columns
table
)

Map the columns using the column names and the specified table.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public static IndexColumn[]

Returns:

the index column array
wrap
(Column[]
the column list
columns
)

Create an array of index columns from a list of columns.

public static StringBuilder

Returns:

the specified string builder
writeColumns
(StringBuilder
string builder
builder
,
IndexColumn[]
index columns
columns
,
int
formatting flags
sqlFlags
)

Appends the specified columns to the specified builder.

public static StringBuilder

Returns:

the specified string builder
writeColumns
(StringBuilder
string builder
builder
,
IndexColumn[]
index columns
columns
,
int
start offset, inclusive
startOffset
,
int
end offset, exclusive
endOffset
,
int
formatting flags
sqlFlags
)

Appends the specified columns to the specified builder.

public static StringBuilder

Returns:

the specified string builder
writeColumns
(StringBuilder
string builder
builder
,
IndexColumn[]
index columns
columns
,
String
separator
separator
,
String
additional SQL to append after each column
suffix
,
int
formatting flags
sqlFlags
)

Appends the specified columns to the specified builder.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

columnback to summary
public Column column

The column, or null if not set.

columnNameback to summary
public final String columnName

The column name.

sortTypeback to summary
public int sortType

The sort type. Ascending (the default) and descending are supported; nulls can be sorted first or last.

SQL_NO_ORDERback to summary
public static final int SQL_NO_ORDER

Do not append ordering.

Constructor Detail

IndexColumnback to summary
public IndexColumn(String columnName)

Creates a new instance with the specified name.

Parameters
columnName:String

the column name

IndexColumnback to summary
public IndexColumn(String columnName, int sortType)

Creates a new instance with the specified name.

Parameters
columnName:String

the column name

sortType:int

the sort type

IndexColumnback to summary
public IndexColumn(Column column)

Creates a new instance with the specified column.

Parameters
column:Column

the column

Method Detail

getSQLback to summary
public StringBuilder getSQL(StringBuilder builder, int sqlFlags)

Appends the SQL snippet for this index column to the specified string builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

mapColumnsback to summary
public static void mapColumns(IndexColumn[] indexColumns, Table table)

Map the columns using the column names and the specified table.

Parameters
indexColumns:IndexColumn[]

the column list with column names set

table:Table

the table from where to map the column names to columns

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
wrapback to summary
public static IndexColumn[] wrap(Column[] columns)

Create an array of index columns from a list of columns. The default sort type is used.

Parameters
columns:Column[]

the column list

Returns:IndexColumn[]

the index column array

writeColumnsback to summary
public static StringBuilder writeColumns(StringBuilder builder, IndexColumn[] columns, int sqlFlags)

Appends the specified columns to the specified builder.

Parameters
builder:StringBuilder

string builder

columns:IndexColumn[]

index columns

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

writeColumnsback to summary
public static StringBuilder writeColumns(StringBuilder builder, IndexColumn[] columns, int startOffset, int endOffset, int sqlFlags)

Appends the specified columns to the specified builder.

Parameters
builder:StringBuilder

string builder

columns:IndexColumn[]

index columns

startOffset:int

start offset, inclusive

endOffset:int

end offset, exclusive

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

writeColumnsback to summary
public static StringBuilder writeColumns(StringBuilder builder, IndexColumn[] columns, String separator, String suffix, int sqlFlags)

Appends the specified columns to the specified builder.

Parameters
builder:StringBuilder

string builder

columns:IndexColumn[]

index columns

separator:String

separator

suffix:String

additional SQL to append after each column

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder