Package io.milvus.param.dml
Class InsertParam.Builder
- java.lang.Object
-
- io.milvus.param.dml.InsertParam.Builder
-
- Direct Known Subclasses:
UpsertParam.Builder
- Enclosing class:
- InsertParam
public static class InsertParam.Builder extends Object
Builder forInsertParamclass.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringcollectionNameprotected StringdatabaseNameprotected List<InsertParam.Field>fieldsprotected StringpartitionNameprotected introwCountprotected List<com.alibaba.fastjson.JSONObject>rows
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InsertParambuild()Verifies parameters and creates a newInsertParaminstance.protected voidcheckFields(int count)protected voidcheckRows()InsertParam.BuilderwithCollectionName(@NonNull String collectionName)Sets the collection name.InsertParam.BuilderwithDatabaseName(String databaseName)Sets the database name.InsertParam.BuilderwithFields(@NonNull List<InsertParam.Field> fields)Sets the column data to insert.InsertParam.BuilderwithPartitionName(@NonNull String partitionName)Set partition name (Optional).InsertParam.BuilderwithRows(@NonNull List<com.alibaba.fastjson.JSONObject> rows)Sets the row data to insert.
-
-
-
Method Detail
-
withDatabaseName
public InsertParam.Builder withDatabaseName(String databaseName)
Sets the database name. database name can be nil.- Parameters:
databaseName- database name- Returns:
Builder
-
withCollectionName
public InsertParam.Builder withCollectionName(@NonNull @NonNull String collectionName)
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withPartitionName
public InsertParam.Builder withPartitionName(@NonNull @NonNull String partitionName)
Set partition name (Optional). This partition name will be ignored if the collection has a partition key field.- Parameters:
partitionName- partition name- Returns:
Builder
-
withFields
public InsertParam.Builder withFields(@NonNull @NonNull List<InsertParam.Field> fields)
Sets the column data to insert. The field list cannot be empty.- Parameters:
fields- insert column data- Returns:
Builder- See Also:
InsertParam.Field
-
withRows
public InsertParam.Builder withRows(@NonNull @NonNull List<com.alibaba.fastjson.JSONObject> rows)
Sets the row data to insert. The rows list cannot be empty.- Parameters:
rows- insert row data- Returns:
Builder- See Also:
JSONObject
-
build
public InsertParam build() throws ParamException
Verifies parameters and creates a newInsertParaminstance.- Returns:
InsertParam- Throws:
ParamException
-
checkFields
protected void checkFields(int count)
-
checkRows
protected void checkRows()
-
-