jpa 2.0 - How to handle EntityNotFoundException in Spring Data JPA (or just standard JPA 2) -


I am in the process of clearing databases; is.

I have developed a program with Spring Data 1.1, which is the process of recording in batches. The problem arises with one association @ 2 entities in relation to the record for the unit B is not present, though it is in reference to Unit A. My job is to clear the references of entity B. If this is the case.

The question is: Should I pre-process the data to clear it or can I adjust the Spring Data or JPA settings if the unit is not found?

This is "normal" - with this data - in the unit A there is an FK which is not present in unit B, so I want to handle it in my code and an additional step or other tool Data is not pre-processed with data batches so that any pre-processing can make things more complicated for the user.

In short, I want to set the Spring data field to blank and continue the process instead of being able to find a org.springframework.orm.jpa.JpaObjectRetrievalFailureException. . .

Maybe you're looking for @notfound annotation?

is after talks about it.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -