How to build a connection with such a task and is it even possible to do this
Table1 contains a list of goods that I own
user_id | product_id | status Table2 contains information about these products.
product_id | title | description | size In one query, you can get everything from Table2 (a list of all products) and add a status column to all? if this product is tied to user_id, then the status is taken from Table1 otherwise 0
Table1
user_id | product_id | status 1 1 5 1 2 3 Table2
product_id | title | description | size 1 Title1 Description1 2 2 Title2 Description2 31 3 Title3 Description3 3 4 Title4 Description4 12 I must return
product_id | title | description | size | status 1 Title1 Description1 2 5 2 Title2 Description2 31 3 3 Title3 Description3 3 0 4 Title4 Description4 12 0 In Java, I need a class in User, for example.
private Set<Product> products; - Here lay the result of the sample, what is the solution?