Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "CONTENTSET" not found; SQL statement:
  2. select contentset0_.contentsetid as contents1_1_, contentset0_.checksum as checksum2_1_, contentset0_.contentsetname as contents3_1_, contentset0_.zipped as zipped4_1_ from contentset contentset0_ [42102-199]
  3. at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
  4. at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
  5. at org.h2.message.DbException.get(DbException.java:205)
  6.  
  7. @Entity
  8. @Table(name = "contentset")
  9. public class ContentSet implements Serializable {
  10.  
  11. @Id
  12. @Column(name="CONTENTSETID")
  13. private String contentSetId;
  14.  
  15. @Column(name="CONTENTSETNAME", nullable=false)
  16. private String contentSetName;
  17. ......
  18.  
  19. public interface ContentSetRepository extends JpaRepository<ContentSet, String> { }
  20.  
  21. spring.datasource.url=jdbc:mysql://10.80.100.62:3306/receiver
  22. spring.datasource.username=xxx
  23. spring.datasource.password=xxx
  24. spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
  25. spring.jpa.database = MYSQL
  26. spring.jpa.show-sql = true
  27. spring.jpa.properties.hibernate.format_sql=true
  28. spring.jpa.hibernate.ddl-auto = none
  29. spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
  30.  
  31. # NOTHING SEEMS TO RESOLVE UPPERCASE TABLE name
  32. #spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
  33. #spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
  34.  
  35. @RunWith(SpringRunner.class)
  36. @DataJpaTest
  37. @AutoConfigureTestDatabase(replace=AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED)
  38. @TestPropertySource(locations = "classpath:application.properties")
  39. public class ContentSetRepositoryMySqlTest {
  40.  
  41. @Autowired private ContentSetRepository contentSetRepo;
  42.  
  43. @Test
  44. public void testFindAll_For_ContentSetRepository() {
  45. Assertions.assertThat(contentSetRepo).isNotNull();
  46.  
  47. try {
  48. Collection<ContentSet> all = contentSetRepo.findAll();
  49. Assertions.assertThat(all).isNotNull();
  50. Assertions.assertThat(all.size()).isGreaterThan(0);
  51. } catch(Exception ex ) {
  52. ex.printStackTrace();
  53. Assertions.fail("Exception : " + ex.getMessage());
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement