From ad30d29ed6d48d29f020164687135876c1193f8f Mon Sep 17 00:00:00 2001 From: Mateusz Szablak Date: Mon, 16 Nov 2020 06:26:38 +0100 Subject: [PATCH] BAEL-4723 Defining Indexes in JPA #2 (#10254) * BAEL-4723 Defining Indexes in JPA * unit -> integration test * whitespaces fix * tab to space Co-authored-by: mateusz.szablak --- .../java/com/baeldung/jpa/index/Student.java | 14 +++++----- .../main/resources/META-INF/persistence.xml | 28 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/index/Student.java b/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/index/Student.java index 0a77cfbc9e..45de3f3fc4 100644 --- a/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/index/Student.java +++ b/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/index/Student.java @@ -10,13 +10,13 @@ import java.util.Objects; @Entity @Table(indexes = { - @Index(columnList = "firstName"), - @Index(name = "fn_index", columnList = "id"), - @Index(name = "multiIndex1", columnList = "firstName, lastName"), - @Index(name = "multiIndex2", columnList = "lastName, firstName"), - @Index(name = "multiSortIndex", columnList = "firstName, lastName DESC"), - @Index(name = "uniqueIndex", columnList = "firstName", unique = true), - @Index(name = "uniqueMultiIndex", columnList = "firstName, lastName", unique = true) + @Index(columnList = "firstName"), + @Index(name = "fn_index", columnList = "id"), + @Index(name = "multiIndex1", columnList = "firstName, lastName"), + @Index(name = "multiIndex2", columnList = "lastName, firstName"), + @Index(name = "multiSortIndex", columnList = "firstName, lastName DESC"), + @Index(name = "uniqueIndex", columnList = "firstName", unique = true), + @Index(name = "uniqueMultiIndex", columnList = "firstName, lastName", unique = true) }) public class Student implements Serializable { @Id diff --git a/persistence-modules/java-jpa-3/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa-3/src/main/resources/META-INF/persistence.xml index 8fe3a8bbf1..1a53fb8e82 100644 --- a/persistence-modules/java-jpa-3/src/main/resources/META-INF/persistence.xml +++ b/persistence-modules/java-jpa-3/src/main/resources/META-INF/persistence.xml @@ -41,18 +41,18 @@ - org.hibernate.jpa.HibernatePersistenceProvider - com.baeldung.jpa.index.Student - true - - - - - - - - - - - + org.hibernate.jpa.HibernatePersistenceProvider + com.baeldung.jpa.index.Student + true + + + + + + + + + + +