Insert, Delete, Update
The BaseMapper of Kite framework provides basic CRUD operations for database tables.
Insert
insert(entity): Inserts a single entity into the database table.insertSelective(entity): Inserts a single entity into the database table, only insertingnon-nullfields.insertValues(entities): Inserts a batch of entities into the database table, with a insert values.insertValues(entities, batchSize): Inserts a batch of entities into the database table, with a insert values.batchInsert(entities): Inserts a batch of entities into the database table.batchInsertSelective(entities): Inserts a batch of entities into the database table, only insertingnon-nullfields.batchInsert(entities, batchSize): Inserts a batch of entities into the database table, with a specified batch size.batchInsertSelective(entities, batchSize): Inserts a batch of entities into the database table, with a specified batch size, only insertingnon-nullfields.
When the
batchSizeparameter is not passed, the defaultbatchSizeis 1000.
Delete
delete(entity): Deletes a single entity by condition entity.deleteById(id): Deletes a single entity by primary key.deleteByIds(ids): Deletes a batch of entities by primary keys.deleteWrapper(): Deletes a single entity in the database table, with a specified condition.deleteWrapper(deleteWrapper): Deletes a single entity in the database table, with a specified condition.
Update
update(entity): Updates a single entity by primary key.update(entity, conditionEntity): Updates a single entity in the database table, with a specified condition entity.updateSelective(entity): Updates a single entity by primary key, only updatingnon-nullfields.updateSelective(entity, conditionEntity): Updates a single entity in the database table, with a specified condition entity, only updatingnon-nullfields.updateWrapper(): Updates a single entity in the database table, with a specified condition.updateWrapper(updateWrapper): Updates a single entity in the database table, with a specified condition.batchUpdate(entities): Updates a batch of entities in the database table.batchUpdateSelective(entities): Updates a batch of entities in the database table, only updatingnon-nullfields.batchUpdate(entities, batchSize): Updates a batch of entities in the database table, with a specified batch size.batchUpdateSelective(entities, batchSize): Updates a batch of entities in the database table, with a specified batch size, only updatingnon-nullfields.