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.
This commit is contained in:
Mladen Savic 2021-08-02 16:19:01 +02:00 committed by GitHub
parent 3da557e943
commit 0ea4180da1
2 changed files with 2 additions and 3 deletions

View File

@ -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() {

View File

@ -114,7 +114,7 @@
<property name="hibernate.generate_statistics" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1"/>
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db2;DB_CLOSE_DELAY=-1"/>
<property name="javax.persistence.jdbc.user" value="sa"/>
<property name="javax.persistence.jdbc.password" value=""/>
</properties>
@ -132,7 +132,7 @@
<property name="hibernate.generate_statistics" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1"/>
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db3;DB_CLOSE_DELAY=-1"/>
<property name="javax.persistence.jdbc.user" value="sa"/>
<property name="javax.persistence.jdbc.password" value=""/>
</properties>