14

In older xml based hibernate, one can have this config ,

<many-to-one ... not-found="ignore" />

but in JPA annotations, there seems to be nothing similar.

My problem is that our company has SQL REFERENCE definitions like this:

authorId INT NOT NULL DEFAULT 0

which makes all foreign reference default to a "Not-Found" situation. When the relation is loaded lazily, will get an Exception...

Cœur
  • 37,241
  • 25
  • 195
  • 267
Visus Zhao
  • 1,144
  • 2
  • 12
  • 25

1 Answers1

33

Try @NotFound(action=NotFoundAction.IGNORE). It's a Hibernate annotation.

Ryan Stewart
  • 126,015
  • 21
  • 180
  • 199