Not able to delete users in customer care
Posted: Wed Jun 20, 2012 1:17 pm
by srini
While I am trying to remove user from customer care tab, I am getting 'Problem removing entity : org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update'. And also how can I update/remove the orders? Please advise.
Thanks,
Srini.
Re: Not able to delete users in customer care
Posted: Thu Jun 21, 2012 8:27 am
by phillipuniverse
If you have OrderItems in the order (which you probably do) then what that's really telling you is that you cannot delete an Order because OrderItem has a foreign-key constraint on Order. You would essentially have to delete them backwards; remove all the OrderItems, then go and remove the Order. The same thing is true for Customer; Order has a foreign key constraint on Customer so if you're trying to delete a Customer that has an Order, it will also give you that exception.
Broadleaf out of the box does not provide functionality to modify Orders in the admin; currently everything in the Orders section is set to read-only. The way to modify this behavior would be to subclass the CustomerCareModule and then override the OrderView and OrderPresenter.