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.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface IMdmLinkDao extends JpaRepository<MdmLink, Long>, IHapiFhirJpaRepository {
|
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);
|
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 {
|
interface MdmPidTuple {
|
||||||
Long getGoldenPid();
|
Long getGoldenPid();
|
||||||
Long getSourcePid();
|
Long getSourcePid();
|
||||||
|
|
|
@ -153,11 +153,7 @@ public class MdmLinkDaoSvc {
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
public Optional<MdmLink> getMatchedLinkForSourcePid(Long theSourcePid) {
|
public Optional<MdmLink> getMatchedLinkForSourcePid(Long theSourcePid) {
|
||||||
MdmLink exampleLink = myMdmLinkFactory.newMdmLink();
|
return myMdmLinkDao.findBySourcePidAndMatchResult(theSourcePid, MdmMatchResultEnum.MATCH);
|
||||||
exampleLink.setSourcePid(theSourcePid);
|
|
||||||
exampleLink.setMatchResult(MdmMatchResultEnum.MATCH);
|
|
||||||
Example<MdmLink> example = Example.of(exampleLink);
|
|
||||||
return myMdmLinkDao.findOne(example);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue