TASKPM/navalplanner-webapp
Diego Pino Garcia a3cded16db Fix bug detect if there are duplicated codes between the order to be
saved and that order already saved in the DB

It's necessary to check if any of the codes in an order that's going
to be saved contain duplicated values comparing also against that very
same order in the DB.

Order codes must be unique. There's a case where it may not be any
duplicated code in an order, neither in other orders, but a unique
constraint violation still may happen.

Imagine the following scenario:

order
   |-- order1(1, 'code1')
   |-- order2(2, 'code2')

The first time _order_ is persisted, everything goes OK. However if the
value of codes are swapped, that is:

order
   |-- order1(1, 'code2')
   |-- order2(2, 'code1')

None code is repeated within the order, however as data is persisted one by
one, when _order1_ is going to be saved into DB, the value of
_order2.code_ is still 'code2', resulting into an unique code constraint
violation.

This is a limitation of the backend database and how unique fields work.
The best thing to do is to check there's no other orderelement with the
same code value in the DB (except for the one that's going to be saved).

FEA: ItEr60S04ValidacionEProbasFuncionaisItEr59S04
2010-09-02 17:56:28 +02:00
..
src Fix bug detect if there are duplicated codes between the order to be 2010-09-02 17:56:28 +02:00
pom.xml ItEr60S04ValidacionEProbasFuncionaisItEr59S04: internationalize the reports. 2010-06-29 12:55:59 +02:00