Hql, How to write join query between tables that has one to many relationship?

后端 未结 1 1621
Happy的楠姐
Happy的楠姐 2021-01-18 14:41

I have 2 tables. 1st one have oneToMany relationship with 2nd.

Class Author

@Entity
@Table(name =         


        
1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-18 15:32

    I think its something like this:

    select a from Author as a join a.Book as ab where ab.AuthorId like '%"hello"%';
    

    not sure about a.Book though, it could also be a.Books as your columnname is named like that.

    0 讨论(0)
提交回复
热议问题