Top Description Inners Fields Constructors Methods
com.mysql.cj.xdevapi

public Class CreateIndexParams

extends Object
Class Inheritance
Imports
java.io.IOException, .StringReader, java.util.ArrayList, .List, com.mysql.cj.Messages, com.mysql.cj.exceptions.AssertionFailedException

Internally-used object passing index creation parameters to XMessageBuilder.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CreateIndexParams.IndexField

Internally used object parsed from indexDefinition; see Collection#createIndex(String, DbDoc) description.

Field Summary

Modifier and TypeField and Description
private List<CreateIndexParams.IndexField>
public static final String
public static final String
private String
private String
indexType

One of INDEX or SPATIAL.

public static final String

Constructor Summary

AccessConstructor and Description
public
CreateIndexParams(String
index name
indexName
,
DbDoc
special JSON document containing index definition; see Collection#createIndex(String, DbDoc) description
indexDefinition
)

Constructor.

public
CreateIndexParams(String
index name
indexName
,
String
special JSON document containing index definition; see Collection#createIndex(String, String) description
jsonIndexDefinition
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public List<CreateIndexParams.IndexField>

Returns:

List of IndexField objects
getFields
()

Get index fields.

public String

Returns:

index name
getIndexName
()

Get index name.

public String

Returns:

index type
getIndexType
()

Get index type.

private void
init(String idxName, DbDoc indexDefinition)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fieldsback to summary
private List<CreateIndexParams.IndexField> fields
GEOJSONback to summary
public static final String GEOJSON
INDEXback to summary
public static final String INDEX
indexNameback to summary
private String indexName
indexTypeback to summary
private String indexType

One of INDEX or SPATIAL. Default is INDEX and may be omitted.

SPATIALback to summary
public static final String SPATIAL

Constructor Detail

CreateIndexParamsback to summary
public CreateIndexParams(String indexName, DbDoc indexDefinition)

Constructor.

Parameters
indexName:String

index name

indexDefinition:DbDoc

special JSON document containing index definition; see Collection#createIndex(String, DbDoc) description

CreateIndexParamsback to summary
public CreateIndexParams(String indexName, String jsonIndexDefinition)

Constructor.

Parameters
indexName:String

index name

jsonIndexDefinition:String

special JSON document containing index definition; see Collection#createIndex(String, String) description

Method Detail

getFieldsback to summary
public List<CreateIndexParams.IndexField> getFields()

Get index fields.

Returns:List<CreateIndexParams.IndexField>

List of IndexField objects

getIndexNameback to summary
public String getIndexName()

Get index name.

Returns:String

index name

getIndexTypeback to summary
public String getIndexType()

Get index type.

Returns:String

index type

initback to summary
private void init(String idxName, DbDoc indexDefinition)
com.mysql.cj.xdevapi back to summary

public Class CreateIndexParams.IndexField

extends Object
Class Inheritance

Internally used object parsed from indexDefinition; see Collection#createIndex(String, DbDoc) description.

Field Summary

Modifier and TypeField and Description
private static final String
private Boolean
array

(optional) true if the field is an array

private static final String
private String
field

The full document path to the document member or field to be indexed

private static final String
private Integer
options

(optional) special option flags for use when decoding GEOJSON data

private static final String
private Boolean
required

(optional) true if the field is required to exist in the document.

private static final String
private Integer
srid

(optional) srid value for use when decoding GEOJSON data

private static final String
private String
type

One of the supported SQL column types to map the field into.

Constructor Summary

AccessConstructor and Description
public
IndexField(DbDoc
a special JSON document, part of indexDefinition document, consisting of the following fields:
  • field: string, the full document path to the document member or field to be indexed
  • type: string, one of the supported SQL column types to map the field into. For numeric types, the optional UNSIGNED keyword may follow. For the TEXT type, the length to consider for indexing may be added. Type descriptions are case insensitive.
  • required: bool, (optional) true if the field is required to exist in the document. Defaults to false, except for GEOJSON where it defaults to true
  • options: int, (optional) special option flags for use when decoding GEOJSON data
  • srid: int, (optional) srid value for use when decoding GEOJSON data
  • array: bool, (optional) true if the field is an array
indexField
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

field string
getField
()

Get the full document path to the document member or field to be indexed.

public Integer

Returns:

options
getOptions
()

Get options for decoding GEOJSON data.

public Integer

Returns:

srid
getSrid
()

Get srid for decoding GEOJSON data.

public String

Returns:

column type
getType
()

Get column type.

public Boolean

Returns:

true if the field is an array
isArray
()

Is the field an array?

public Boolean

Returns:

true if required
isRequired
()

Is the field required to exist in the document?

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ARRAYback to summary
private static final String ARRAY
arrayback to summary
private Boolean array

(optional) true if the field is an array

FIELDback to summary
private static final String FIELD
fieldback to summary
private String field

The full document path to the document member or field to be indexed

OPTIONSback to summary
private static final String OPTIONS
optionsback to summary
private Integer options

(optional) special option flags for use when decoding GEOJSON data

REQUIREDback to summary
private static final String REQUIRED
requiredback to summary
private Boolean required

(optional) true if the field is required to exist in the document. defaults to false, except for GEOJSON where it defaults to true

SRIDback to summary
private static final String SRID
sridback to summary
private Integer srid

(optional) srid value for use when decoding GEOJSON data

TYPEback to summary
private static final String TYPE
typeback to summary
private String type

One of the supported SQL column types to map the field into. For numeric types, the optional UNSIGNED keyword may follow. For the TEXT type, the length to consider for indexing may be added.

Constructor Detail

IndexFieldback to summary
public IndexField(DbDoc indexField)

Constructor.

Parameters
indexField:DbDoc

a special JSON document, part of indexDefinition document, consisting of the following fields:

  • field: string, the full document path to the document member or field to be indexed
  • type: string, one of the supported SQL column types to map the field into. For numeric types, the optional UNSIGNED keyword may follow. For the TEXT type, the length to consider for indexing may be added. Type descriptions are case insensitive.
  • required: bool, (optional) true if the field is required to exist in the document. Defaults to false, except for GEOJSON where it defaults to true
  • options: int, (optional) special option flags for use when decoding GEOJSON data
  • srid: int, (optional) srid value for use when decoding GEOJSON data
  • array: bool, (optional) true if the field is an array

Method Detail

getFieldback to summary
public String getField()

Get the full document path to the document member or field to be indexed.

Returns:String

field string

getOptionsback to summary
public Integer getOptions()

Get options for decoding GEOJSON data.

Returns:Integer

options

getSridback to summary
public Integer getSrid()

Get srid for decoding GEOJSON data.

Returns:Integer

srid

getTypeback to summary
public String getType()

Get column type.

Returns:String

column type

isArrayback to summary
public Boolean isArray()

Is the field an array?

Returns:Boolean

true if the field is an array

isRequiredback to summary
public Boolean isRequired()

Is the field required to exist in the document?

Returns:Boolean

true if required