We are trying to migrate our microservice to Spring Boot 2, currently, we are using Spring Boot 1.5.6.RELEASE.
During the migration process we recognized that our microservice is partially broken, in the log files we found the following error:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'acme_ms.hibernate_sequence' doesn't exist
Only one domain class exists in our application at the moment:
@Getter
@Setter
@ToString
@Entity
@Table(name = "acme_ms_card_details")
public class CardDetails {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String cardType;
}
and we found that the issue related to GeneratedValue
strategy type, we tried to change strategy to GenerationType.IDENTITY
and the error disappeared.
So, the question that we have for now:
Why with Spring boot 1.5 GenerationType.AUTO
works perfectly well but after migration to Spring boot 2, GenerationType.AUTO
doesn't work at all.
What was critically changed?
Note: as a Database, we are using MySQL.