add indexes to jpa entities

This commit is contained in:
Loredana 2020-10-15 19:03:52 +03:00
parent 2a57624054
commit 43feef5b42
4 changed files with 8 additions and 3 deletions

View File

@ -37,7 +37,6 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -72,7 +71,6 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<version>2.0.5.RELEASE</version>
</plugin> </plugin>
<!--<plugin>--> <!--<plugin>-->
<!--<groupId>net.alchim31.maven</groupId>--> <!--<groupId>net.alchim31.maven</groupId>-->

View File

@ -4,8 +4,11 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
@Entity @Entity
@Table(indexes = {@Index(columnList="customerId")})
public class CustomerRewardsAccount { public class CustomerRewardsAccount {
@Id @Id

View File

@ -4,10 +4,14 @@ import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import java.util.Date; import java.util.Date;
import java.util.Calendar; import java.util.Calendar;
@Entity @Entity
@Table(indexes = {@Index(columnList="customerRewardsId")})
public class Transaction { public class Transaction {
@Id @Id

View File

@ -2,6 +2,6 @@ spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa spring.datasource.username=sa
spring.datasource.password=password spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect spring.jpa.database-platform=org.hibernate.dialect.H2Dialect