Lets say I have a product database and each product has a catagory and discuount%. What I need to do is change the discount% of all the products of a category. I am thinking of having a home business method in the home interface: public void changeDiscount(String category, double newdiscount);
This method would then fire a query like: update product set discount=? where category=?
My question is: Is this a valid approach? Can I even specify such a query in the deployment descriptor? If I do that, what would happen to the discount values of the bean that are currently in use?
If this is not a valid approach, how should I update the discount value for each product?
This method would then fire a query like: update product set discount=? where category=?
My question is: Is this a valid approach? Can I even specify such a query in the deployment descriptor? If I do that, what would happen to the discount values of the bean that are currently in use?
If this is not a valid approach, how should I update the discount value for each product?