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

View File

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

View File

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

View File

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