All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.aidensuen.mongo.common.base.update.UpdateByIdSelectiveDao Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy