title: NumberFormatException while H2 db insert in a table with primary key type is string
body: <p>I am using Spring boot and h2 db for integration test case in microsoft-sql-server mode <strong>jdbc:h2:~/sample;MODE=MSSQLServer</strong>
  While running test case Table has been created with proper data type</p>
  
  <pre><code>@Entity
  @Table(name = "TeamMemberType", schema = "SCH")
  public class TeamMemberType {
    @Id
    @Column(name = "TeamMemberCode", unique = true, nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private String teamMemberCode;
  
    @Column(name = "Code")
    private String code;
  }
  </code></pre>
  
  <p>Console:<br></p>
  
  <pre><code>Hibernate: create table SCH.TeamMemberType (TeamMemberCode varchar(255) identity not null, Code varchar(255))
  </code></pre>
  
  <p>while running test case it try to insert in db<br></p>
  
  <pre><code>insert INTO SCH.TeamMemberType (TeamMemberCode , Code) values ( 'Dev', 'Developer')
  </code></pre>
  
  <p>getting below exception</p>
  
  <blockquote>
    <p>java.lang.IllegalStateException: Failed to load ApplicationContext
    Caused by: org.springframework.beans.factory.BeanCreationException:
    Error creating bean with name
    'org.springframework.boot.test.web.client.TestRestTemplate':
    Initialization of bean failed; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'restTemplateBuilder' defined in class path
    resource
    [org/springframework/boot/autoconfigure/web/WebClientAutoConfiguration$RestTemplateConfiguration.class]:
    Bean instantiation via factory method failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate [org.springframework.boot.web.client.RestTemplateBuilder]:
    Factory method 'restTemplateBuilder' threw exception; nested exception
    is org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name
    'org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration':
    Bean instantiation via constructor failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate
    [org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration$$EnhancerBySpringCGLIB$$4162ac5b]:
    Constructor threw exception; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'jacksonHttpMessageConverter' defined in class
    path resource
    [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]:
    Bean instantiation via factory method failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate
    [org.springframework.hateoas.mvc.TypeConstrainedMappingJackson2HttpMessageConverter]:
    Factory method 'jacksonHttpMessageConverter' threw exception; nested
    exception is org.springframework.beans.factory.BeanCreationException:
    Error creating bean with name 'config' defined in class path resource
    [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]:
    Bean instantiation via factory method failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate
    [org.springframework.data.rest.core.config.RepositoryRestConfiguration]:
    Factory method 'config' threw exception; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'repositories' defined in class path resource
    [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class]:
    Bean instantiation via factory method failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate
    [org.springframework.data.repository.support.Repositories]: Factory
    method 'repositories' threw exception; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'teamMemberRepository': Cannot create inner
    bean '(inner bean)#202fd4c4' of type
    [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting
    bean property 'entityManager'; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name '(inner bean)#202fd4c4': Cannot resolve
    reference to bean 'entityManagerFactory' while setting constructor
    argument; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'entityManagerFactory': Post-processing of
    FactoryBean's singleton object failed; nested exception is
    org.springframework.jdbc.datasource.init.ScriptStatementFailedException:
    Failed to execute SQL script statement #1 of URL
    [file:/C:/Users/myprojectpath/target/test-classes/data.sql]: insert
    INTO SCH.TeamMemberType (TeamMemberCode , Code) values ( 'Dev',
    'Developer'); nested exception is org.h2.jdbc.JdbcSQLException: Data
    conversion error converting "Dev"; SQL statement:</p>
    
    <p>Caused by: org.h2.jdbc.JdbcSQLException: Data conversion error
    converting "Dev"; SQL statement: insert INTO SCH.TeamMemberType
    (TeamMemberCode , Code) values ( 'Dev', 'Developer') Caused by:
    java.lang.NumberFormatException: For input string: "Dev"</p>
  </blockquote>
  
  <p>why h2 db knowingly <code>[TeamMemberCode varchar(255) identity]</code> converting "<code>Dev</code>" as <code>Number</code></p>