com.github.aidensuen.mongo.common.base.update.UpdateByIdSelectiveDao Maven / Gradle / Ivy
package com.github.aidensuen.mongo.common.base.update;
import com.github.aidensuen.mongo.annotation.RegisterMongoDao;
import com.github.aidensuen.mongo.annotation.UpdateProvider;
import com.github.aidensuen.mongo.command.OperationType;
import com.github.aidensuen.mongo.provider.base.BaseUpdateProvider;
import org.springframework.data.mongodb.repository.Query;
/**
* Generic Dao update interface
*
* @param Can not be null
* @author aidensuen
*/
@RegisterMongoDao
public interface UpdateByIdSelectiveDao {
/**
* Update all fields of the entity according to id, and the null value will not be updated
*
* @param record
* @return
*/
@UpdateProvider(type = BaseUpdateProvider.class, operationType = OperationType.UPDATEONE)
@Query("{'id': #{id}}")
long updateByIdSelective(T record);
}