java - How to insert transaction into table in mysql keeping it unique for every user -
hey newbie in web development , having problem in cashbook web application using servlets have 2 tables in db users(primary-key p_id) , transactions(primary-key t_id) whenever user-a adds transaction transaction table visible user-b when logs in web application. there way whatever transaction user-a added transaction table db visible user-a , not other user? when user-b logs in can see user-b transactions not of user-a. thanks.your appreciated
simplest solution (without multitenancy or other things) have foreign key in transactions table user table, can filter on user , vice-versa or use jpa like: user.gettransactions()
Comments
Post a Comment