I'm not sure I understand your problem.  You'll need to create four
distinct Address objects, you can't reuse then for different fields,
but as long as you're doing that, I don't see a problem.  Here's some
psuedo-code, assuming Address has a pair of constructors - one with
individual arguments and one copy constructor:

cust = dao.getCustomer(...);
cust.contactAddress = new Address(form.contacttreet, ...);
cust.companyAddress = new Address(form.companyStreet, ...);
cust.deliveryAddress = new Address(cust.contactAddress);
cust.billingAddress = new Address(cust.companyAddress);
dao.saveCustomer(cust);

cheers,
barneyb

On Sun, Jan 4, 2009 at 2:16 AM,  <[email protected]> wrote:
> Hi list,
>
> in our freshly build Java B2B-Shop-Customer-System (build from scratch, based
> on Hibernate. Spring etc.) we have
> four adresses in the MS-SQL-DB (MS-SQL-2000): contact_address,
> company_address, delivery_address, billing_address.
>
> In the end-customer's registration process the following happens (in case the
> customer says that the delivery_address + billing address is being
> assembled out of the contact/-delivery_addresses and doesn't have to fill it
> seperately):
>
> a) contact_address is stored first -> ok
> b) company_address is stored first -> ok
> c) delivery_adress is stored from the data of the company_adress
> d) billing_adress is stored from the data of the company_address
>
> My Java-developer is trying to tell me, that this is not possible. He
> mentioned the following: in part c) Hibernate recognizes, that the
> object which is the most recent is older than the stored version in
> the DB. The same happens when it comes to part d).
> And he mentions that this is a Optimistic Concurrency Control problem.
> (see: http://en.wikipedia.org/wiki/Optimistic_concurrency_control )
> I told him that with ColdFusion, PHP and other scripting languages
> this shouldn't be a problem, since you can store the data in server or
> clientside variables/parameters. He replied, that this isn't possible with
> Hibernate. This irritates me, since it would be a major problem, if
> we have to change the business logic of this shop-feature feature from
> ground up.
>
> Any ideas ? Does anybody know of another good (Java)-forum where I can post
> this question ? Thanks !!
>
> Uwe
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317355
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to