cancel
Showing results for 
Search instead for 
Did you mean: 

Recursively saving model in validator interceptor

Former Member
0 Kudos

Hi, I have written a validator interceptor in which i am performing some validations for model (model1) before saving the model. I have some other model (model 2)which is having reference of model1 and need to save model2 as well in the validator. SInce model2 is having reference of model1 the validator interceptor is getting called recursively. Is there any way to save model2 inside the validator or after the validator gets invoked for model1.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhisheksaphybris
Participant
0 Kudos

Hi Neha,

I hope you are not doing any save operation in validator interceptor. Have u defined your validator interceptor only for Type1? Validator interceptor shouldn't have any logic to save the model. Whenever you will invoke the save method it will again invoke the validator interceptor.

It should be used to do the validation and throw the interceptor exception in case of failure.

If you have to set some default value use initdefault interceptor. Prepare interceptor could be also used to prepare data for a model.

Thanks, Abhishek