Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Update values in database from jsp

 
arushi tomar
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used hibernate, I have a CUSTOMER table, and a USER table.
I have a Customer_user table and a user_customer table used for one to one mapping between other tables.

When an admin registers a user, he selects which customers are to be added to the SHOW_CUSTOMER_LIST of that user.

For ex, user 1 is authorized to view customer 1 and 2, while user 2 is authorized to view customer 2 and 3. These two are mapped by the ID in their respective CUSTOMER and USER tables.

Cust_user looks something like this :

userID | customerID
1 | 1
1 | 2
2 | 2
2 | 3 and similarly the user_customer table

Now what I want is, that the admin can update these tables, for example if a new customer is added to the database, the admin can update any user to have access to that customer from the jsp page itself, either using multiple select drop down menu or checkbox. What approach should I use for this. Any help would be appreciated.
Thanks in advance.
 
Dave Tolls
Ranch Hand
Posts: 2103
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you have two mapping tables?
Wouldn't the one be sufficient, as that allows for the many-to-many mapping that you are modelling?
 
arushi tomar
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am actually new in all this and trying to develop an app, I am trying to do this :

Using two tables that are Customer and User, update customer list then get the User object for which I have to update the customer list and add new customers to the list. And also update the customer by adding this particular user to the user list in customer object. But I am not sure how to do this practically. I know the approach but not how to work towards it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic