1 |
56340
|
michele.ar
|
package eu.dnetlib.organizations.repository.readonly;
|
2 |
|
|
|
3 |
|
|
import java.util.List;
|
4 |
|
|
|
5 |
|
|
import org.springframework.data.jpa.repository.Query;
|
6 |
|
|
import org.springframework.stereotype.Repository;
|
7 |
|
|
|
8 |
56672
|
michele.ar
|
import eu.dnetlib.organizations.model.utils.RelationByOrg;
|
9 |
|
|
import eu.dnetlib.organizations.model.view.OrganizationView;
|
10 |
56340
|
michele.ar
|
|
11 |
|
|
@Repository
|
12 |
|
|
public interface OrganizationViewRepository extends ReadOnlyRepository<OrganizationView, String> {
|
13 |
|
|
|
14 |
56672
|
michele.ar
|
@Query(value = "select r.id2 as \"relatedOrgId\", o.name as \"relatedOrgName\", r.reltype as \"type\" from relationships r left outer join organizations o on (r.id2 = o.id) where r.id1 = ?1", nativeQuery = true)
|
15 |
|
|
List<RelationByOrg> findRelations(String orgId);
|
16 |
56340
|
michele.ar
|
}
|