All Questions

Tagged with
Filter by
Sorted by
Tagged with
34votes
4answers
71kviews

Spring Data JPA Unable to locate Attribute with the given name

I was trying to use Spring Data JPA on Spring Boot and I kept getting error, I can't figure out what the problem is: Unable to locate Attribute with the the given name [firstName] on this ...
user avatar
  • 563
29votes
3answers
29kviews

H2 Console throwing a error webAllowOthers in H2 database

I am using heruko to deploy my application when i am trying to load my h2 console using heruko it is throwing an error saying. H2 Console Sorry, remote connections ('webAllowOthers') are disabled on ...
user avatar
  • 311
23votes
4answers
8kviews

Spring Boot Data JPA with H2 and data.sql - Table not Found

I have a Spring Boot 2.5.0 project. I'm using spring-data-jap with the h2 in-memory database. I want to populate data on startup with a data.sql file but I'm getting a table not found exception. If I ...
user avatar
  • 427
15votes
2answers
15kviews

Spring Boot 2 - H2 Database - @SpringBootTest - Failing on org.h2.jdbc.JdbcSQLException: Table already exists

Unable to test Spring Boot & H2 with a script for creation of table using schema.sql. So, what’s happening is that I have the following properties set: spring.datasource.driver-class-name=org.h2....
user avatar
15votes
2answers
22kviews

Using Liquibase to initialize in-memory H2 for unit tests in Spring Boot application

I've used in-mem databases in Spring JPA tests many times, and never had a problem. This time, I have a bit more complex schema to initialize, and that schema must have a custom name (some of the ...
user avatar
  • 460
15votes
4answers
34kviews

Why am I getting a Primary Key violation for an @OneToMany property?

I have an entity: @Entity public class Student { @GeneratedValue(strategy = GenerationType.AUTO) @Id private long id; @OneToMany private Set<Course> courses; } When I try ...
user avatar
  • 41.5k
14votes
4answers
13kviews

Why am I getting JdbcSQLException (non-hex characters) with my H2 database / Spring boot application?

So the short version, I'm guessing I've some sort of character encoding issue, or the DB is storing/returning the date in a format Hibernate/Spring-jpa doesn't like for some reason. But I'm jiggered ...
user avatar
  • 1,405
13votes
2answers
25kviews

Spring Boot in memory database H2 doesn't load data from file on initialization

I have an issue with loading data into an in-memory database on application initialization. I have created schema.sql and data.sql files containing table structure and initial data. schema.sql : ...
user avatar
  • 419
11votes
1answer
16kviews

Why is this value too long for my H2 table

I have a spring-data-jpa app that is using H2 for storage. When I try and parse some data into the table, I get an error: o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 22001, SQLState: ...
user avatar
  • 4,791
10votes
5answers
26kviews

SpringBoot Accessing H2 console

I have a basic SpringBoot app., embedded Tomcat, Thymeleaf template engine. I've created this bean to access the console: @Bean public ServletRegistrationBean h2ConsoleServletRegistration() { ...
user avatar
9votes
2answers
15kviews

How to access in memory h2 database of one spring boot application from another spring boot application

In my project, i have created 3 spring boot application. First spring boot application has h2 embedded database. Now i want to access this database from my 2nd and 3rd spring boot application directly ...
user avatar
  • 107
9votes
1answer
9kviews

Finding all entries where a collection field contains any of the given items

I have a Spring Boot application that contains an entity like this (some fields stripped for compactness): @Entity public class Message extends AbstractPersistable<Long> { @ManyToMany(...
user avatar
8votes
2answers
8kviews

How to enable H2 Database Server Mode in Spring Boot

I'm using a H2 database with a file using Spring Boot. In my application.properties, I have this entry: spring.datasource.url=jdbc:h2:file:c:/Testprojekte/spring-boot-h2-db But now I would like to ...
user avatar
8votes
1answer
2kviews

How to access H2 console in Spring Boot 2.0 test that uses DataJpaTest

When using @DataJpaTest, how can I configure the test class to run with the bits needed to handle http requests for the H2 console? I am running a Spring Boot 2.0 test that uses H2. I want to set a ...
user avatar
  • 1,853
8votes
0answers
1kviews

ON DUPLICATE KEY support in H2

I use h2 for testing purpose in a Spring Boot (& spring data JPA) application. I'm storing some sort of statistic per day, and therefore I set up ON DUPLICATE KEY UPDATE queries to store those ...
user avatar
  • 1,470

15 30 50 per page
1
2 3 4 5
16