Skip to Content
0
Jun 12, 2018 at 01:19 PM

How to compare current model (from the db) with the model which reaches ValidateInterceptor?

254 Views

Hi,

I'm trying to compare the model of a promotion which is sent from datahub with the current model from the hybris database in order to see if something was modified.

For this I've tried to implement a ValidateInterceptor and I am trying to get the current model from the database and compare it with the model that reaches the ValidateInterceptor

I've tried a couple of things which have not worked so far. 1) Trying to get the current promotion using modelService - the modelService is returning the same promotion with the promotion from the interceptor 2) Trying to use interceptorContext isModified flags - it sees some attributes as modified even though they weren't 3) Tried to use ModelValueHistory - Some of the attributes are clasified as dirtyAttributes.