Update samples to use new generator mappings
Closes gh-7612
This commit is contained in:
@@ -19,11 +19,13 @@ package sample.flyway;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
@Entity
|
||||
public class Person {
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@SequenceGenerator(name="person_generator", sequenceName="person_sequence", allocationSize = 1)
|
||||
@GeneratedValue(generator = "person_generator")
|
||||
private Long id;
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
|
||||
@@ -4,4 +4,6 @@ CREATE TABLE PERSON (
|
||||
last_name varchar(255) not null
|
||||
);
|
||||
|
||||
create sequence person_sequence start with 1 increment by 1;
|
||||
|
||||
insert into PERSON (first_name, last_name) values ('Dave', 'Syer');
|
||||
@@ -22,14 +22,12 @@ import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@TestPropertySource(properties = "spring.jpa.hibernate.use-new-id-generator-mappings=false")
|
||||
public class SampleFlywayApplicationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user