So this is my first post, as a little background I am very new to this. I haven't gone to school for this but have been working hard on
java for a while now. I just passed my Sun Certified Java Programmer certification and try to learn more everyday.
Now I think my problem might be a design issue and hope someone can help me with it.
Project: I am writing a program for a friend and using it as a learning experience. The overall scope of the project is as follow.
Writing a web based application for a dog grooming shop. It keeps track of pets which are tied to owners (customers)
Then for the billable items there are BillableItem objects which belong to Categories.
From invoicing a user would choose an owner, then a pet.
Then a category and a billable item.
All these objects are mapped to mysql with hibernate. They all have individual id's.
All these objects are served to the client (browser) via
servlets. All communication to and from the server/client are done via post using xml.
In the invoicing stage I want the user to be able to do a one time edit of an item price, like an override. This should not change the price of the item permanently but for
a one time occurrence only. When the invoice is submitted the invoice should map to a table and each invoice item should map to another table where the
invoice id, item id and cost for that specific invoice is. That way when I load up an invoice from history, it will load up the price of that occurrence and not the price of the
item now.
My invoice object has all it's variables... ie total, tax, paymentType...... and a List<BillableItems> problem is when I send back the info from the client to the servlet and
try to create a billableItem with the ID of the original and the new price and try to save my invoice hibernate freaks (to be expected) because there already is a billableItem
with that ID associated with the session....
I'm sure this is just because of bad design and that there is a clean way around this. The problem is that like I said I'm new to this including hibernate and servlet and
jsp and...
well you get the point.
Any help, advice will be gladly accepted and I apologize in advance if I ask what might seem like obvious questions...
Thanks
Marc