From 0ea4180da14e967f563853fa0bb06324db868459 Mon Sep 17 00:00:00 2001 From: Mladen Savic Date: Mon, 2 Aug 2021 16:19:01 +0200 Subject: [PATCH] EntityNotFoundException in Hibernate - change in persistence unit (#11092) * JPA Entities and the Serializable Interface * JPA Entities and the Serializable Interface - edit after review * JPA Entities and the Serializable Interface - formatting * JPA Entities and the Serializable Interface - indentation * EntityNotFoundException in Hibernate * EntityNotFoundException in Hibernate - fix persistence unit config to allow multiple test to run in conjunction. --- .../com/baeldung/hibernate/entitynotfoundexception/Item.java | 1 - .../hibernate-jpa/src/main/resources/META-INF/persistence.xml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/entitynotfoundexception/Item.java b/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/entitynotfoundexception/Item.java index ee6f677d7d..3abed00eb8 100644 --- a/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/entitynotfoundexception/Item.java +++ b/persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/entitynotfoundexception/Item.java @@ -15,7 +15,6 @@ public class Item implements Serializable { private String name; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "category_id", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT)) - @NotFound(action = NotFoundAction.IGNORE) private Category category; public long getId() { diff --git a/persistence-modules/hibernate-jpa/src/main/resources/META-INF/persistence.xml b/persistence-modules/hibernate-jpa/src/main/resources/META-INF/persistence.xml index 29cd4faf05..e895ac6ba9 100644 --- a/persistence-modules/hibernate-jpa/src/main/resources/META-INF/persistence.xml +++ b/persistence-modules/hibernate-jpa/src/main/resources/META-INF/persistence.xml @@ -114,7 +114,7 @@ - + @@ -132,7 +132,7 @@ - +