TRUNK-4496 Moved sql query from service to Dao to remove the sql level a...

...ccess privelege required for saving an order
Probably keep the same as line 180 above that was removed, i.e to use the class of the previous order and not the new one just in case we ever allow to discontinue an order with a plain order