类 Schema.CreateCollectionOptions
- java.lang.Object
-
- com.mysql.cj.xdevapi.Schema.CreateCollectionOptions
-
- 封闭接口:
- Schema
public static class Schema.CreateCollectionOptions extends Object
Defines options to be passed toSchema.createCollection(String, CreateCollectionOptions).Allowed options are:
- reuseExisting flag - similar to IF NOT EXISTS for CREATE TABLE
Schema.Validationobject
schema.createCollection(collName, new CreateCollectionOptions().setReuseExisting(false) .setValidation(new Validation().setLevel(ValidationLevel.STRICT) .setSchema("{\"id\": \"http://json-schema.org/idx\", \"$schema\": \"http://json-schema.org/draft-06/schema#\"," + "\"type\": \"object\", \"properties\": {\"index\": {\"type\": \"number\"}},\"required\": [\"index\"]}")));schema.createCollection(collName, new CreateCollectionOptions().setReuseExisting(false).setValidation(new Validation().setLevel(ValidationLevel.OFF)));
schema.createCollection(collName, new CreateCollectionOptions().setReuseExisting(true);
-
-
构造器概要
构造器 构造器 说明 CreateCollectionOptions()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 BooleangetReuseExisting()Schema.ValidationgetValidation()Schema.CreateCollectionOptionssetReuseExisting(boolean reuse)Schema.CreateCollectionOptionssetValidation(Schema.Validation validation)
-
-
-
方法详细资料
-
setReuseExisting
public Schema.CreateCollectionOptions setReuseExisting(boolean reuse)
-
getReuseExisting
public Boolean getReuseExisting()
-
setValidation
public Schema.CreateCollectionOptions setValidation(Schema.Validation validation)
-
getValidation
public Schema.Validation getValidation()
-
-