View Javadoc
1   package ca.uhn.fhir.jpa.dao.data;
2   
3   import ca.uhn.fhir.jpa.entity.TermConceptMap;
4   import org.springframework.data.jpa.repository.JpaRepository;
5   import org.springframework.data.jpa.repository.Modifying;
6   import org.springframework.data.jpa.repository.Query;
7   import org.springframework.data.repository.query.Param;
8   
9   import java.util.Optional;
10  
11  /*
12   * #%L
13   * HAPI FHIR JPA Server
14   * %%
15   * Copyright (C) 2014 - 2018 University Health Network
16   * %%
17   * Licensed under the Apache License, Version 2.0 (the "License");
18   * you may not use this file except in compliance with the License.
19   * You may obtain a copy of the License at
20   * 
21   *      http://www.apache.org/licenses/LICENSE-2.0
22   * 
23   * Unless required by applicable law or agreed to in writing, software
24   * distributed under the License is distributed on an "AS IS" BASIS,
25   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26   * See the License for the specific language governing permissions and
27   * limitations under the License.
28   * #L%
29   */
30  
31  public interface ITermConceptMapDao extends JpaRepository<TermConceptMap, Long> {
32  	@Query("DELETE FROM TermConceptMap cm WHERE cm.myId = :pid")
33  	@Modifying
34  	void deleteTermConceptMapById(@Param("pid") Long theId);
35  
36  	@Query("SELECT cm FROM TermConceptMap cm WHERE cm.myResourcePid = :resource_pid")
37  	Optional<TermConceptMap> findTermConceptMapByResourcePid(@Param("resource_pid") Long theResourcePid);
38  
39  	@Query("SELECT cm FROM TermConceptMap cm WHERE cm.myUrl = :url")
40  	Optional<TermConceptMap> findTermConceptMapByUrl(@Param("url") String theUrl);
41  }