coure2011
coure2011

Reputation: 42514

JPA Query annotation and joining table

I have a sql query like this

Select * from DB1.Table1 a left join DB2.Table2 b on a.dCode = b.dCode where bID = 123;

How can I create jpa code for the above query? what would be the params of JpaRepository

public interface TestRepository extends JpaRepository<???, ???> {

    @Query("???")
    ??? myTestQueryCOde(Integer bID);
}

What would be at ???

Upvotes: 0

Views: 864

Answers (1)

Scary Wombat
Scary Wombat

Reputation: 44854

I am not sure if Spring JPA Data support cross DB queries, but have a look at Cross database joins in JPA

Upvotes: 2

Related Questions