replace search by example. (it caused a cryptic hibernate session error) (#3665)
This commit is contained in:
parent
92acd9b001
commit
a3de219a1e
|
@ -31,6 +31,7 @@ import org.springframework.stereotype.Repository;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface IMdmLinkDao extends JpaRepository<MdmLink, Long>, IHapiFhirJpaRepository {
|
||||
|
@ -54,6 +55,9 @@ public interface IMdmLinkDao extends JpaRepository<MdmLink, Long>, IHapiFhirJpaR
|
|||
")")
|
||||
List<MdmPidTuple> expandPidsFromGroupPidGivenMatchResult(@Param("groupPid") Long theGroupPid, @Param("matchResult") MdmMatchResultEnum theMdmMatchResultEnum);
|
||||
|
||||
@Query("SELECT ml FROM MdmLink ml WHERE ml.mySourcePid = :sourcePid AND ml.myMatchResult = :matchResult")
|
||||
Optional<MdmLink> findBySourcePidAndMatchResult(@Param("sourcePid") Long theSourcePid, @Param("matchResult") MdmMatchResultEnum theMatch);
|
||||
|
||||
interface MdmPidTuple {
|
||||
Long getGoldenPid();
|
||||
Long getSourcePid();
|
||||
|
|
|
@ -153,11 +153,7 @@ public class MdmLinkDaoSvc {
|
|||
*/
|
||||
@Transactional
|
||||
public Optional<MdmLink> getMatchedLinkForSourcePid(Long theSourcePid) {
|
||||
MdmLink exampleLink = myMdmLinkFactory.newMdmLink();
|
||||
exampleLink.setSourcePid(theSourcePid);
|
||||
exampleLink.setMatchResult(MdmMatchResultEnum.MATCH);
|
||||
Example<MdmLink> example = Example.of(exampleLink);
|
||||
return myMdmLinkDao.findOne(example);
|
||||
return myMdmLinkDao.findBySourcePidAndMatchResult(theSourcePid, MdmMatchResultEnum.MATCH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue