我有一个简单的Java类,该类通过Spring JPA存储到MongoDB中-
$ johnnydep johnnydep-0.5-py2.py3-none-any.whl --output-format pinned
johnnydep==0.5
anytree==2.4.3
cachetools==2.1.0
colorama==0.3.9
oyaml==0.7
packaging==18.0
pip==18.0
pkginfo==1.4.2
pytoml==0.1.19
setuptools==40.4.3
structlog==18.2.0
tabulate==0.8.2
wheel==0.32.1
wimpy==0.4
six==1.11.0
pyyaml==3.13
pyparsing==2.2.2
这是我的DataAccessObject类-
public class PlanRecoveryStrategy {
String planId;
String processId;
String strategyId;
public String getPlanId() {
return planId;
}
public void setPlanId(String planId) {
this.planId = planId;
}
public String getProcessId() {
return processId;
}
public void setProcessId(String processId) {
this.processId = processId;
}
public String getStrategyId() {
return strategyId;
}
public void setStrategyId(String strategyId) {
this.strategyId = strategyId;
}
}
但是,我想编写一个方法,其中它接受@Repository("PlanRecoveryStrategy")
public interface PlanRecoveryStrategyDao extends MongoRepository<PlanRecoveryStrategy, String> {
@Query(value = "{ 'planId' : ?0, 'processId' : ?1, 'strategyId' : ?2}", delete = true)
List<PlanRecoveryStrategy> deletePlanRecoveryStrategy(String planId, String processId, String strategyId);
}
对象的列表,如果任何记录中的所有3个值都将其从数据库中删除。
PlanRecoveryStrategy
如何编写此方法?