I am using MySQL as a database in my spring boot application. I dropped the database and created it again and ran Junit test and it is not creating hibernate_sequence table now but before it did have that table.
My entity class looks like this
@Entity
public class Greeting {
@Id
@GeneratedValue
private Long id;
private String text;
//getters & setters
}
My Hibernate properties
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.jpa.properties.hibernate.hbm2ddl.auto=update
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.connection.sid=xe
spring.jpa.properties.hibernate.connection.characterEncoding=utf8
spring.jpa.properties.hibernate.connection.CharSet=utf8
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.LocalSessionFactoryBean
spring.jpa.properties.hibernate.id.new_generator_mappings=true
My Junit test
@RunWith(SpringRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext.xml" })
@SpringBootTest
public class GreetingRepositoryDAOTest {
@Resource
private BaseRepository greetingRepositoryImpl;
@Test
public void test() {
Greeting gr = new Greeting();
gr.setText("Third Text");
greetingRepositoryImpl.save(gr);
}
}