RSM
RSM

Reputation: 433

Hibernate one to many mapping mapped by criteria

Can two tables be mapped by based on 2 columns.

I have table A and B

A and B both has columns id and status.

I want to get records that matches both columns in both tables.

Upvotes: 0

Views: 63

Answers (1)

Aurelien Ecoto
Aurelien Ecoto

Reputation: 226

Can't you use a join ?

Here is an example:

SELECT A.*, B.* 
FROM A 
INNER JOIN B ON A.id = B.id and A.status = B.status

Upvotes: 1

Related Questions