I'm facing a similar issue as described in this thread, but my case involves using Spring Data JDBC instead of JPA. I have an entity defined as follows:
@Table("TEST_TABLE")
@Data
public class TestTableEntity {
@Id
private int id;
…
I am extending a base repository with shared queries across entities but unfortunately spring does not support derived delete queries in spring data jdbc.
I had to write a custom query in all my repositories:
@Modifying
@Query("DELETE FROM table…
In spring data jdbc bundled with spring boot 3.0.5 I could generate an Id by using the BeforeConvertCallback:
@Configuration
@EnableJdbcRepositories
class JdbcConfig extends AbstractJdbcConfiguration {
@Bean
BeforeConvertCallback…
I'm working on data migration from SQL Server to PostgreSQL. I'm planning to switch the data source using a feature toggle to reduce the migration risk. I've got good idea how to return appropriate DataSource based on the feature toggle from…
I have two aggregate roots, Account which holds id, name and Alert which holds id, title and Account(@ManyToOne). Using spring boot with data-jpa and data-rest I can see the full magic in swagger-ui.
Now I want to achieve the same result while…
I use spring-data-jdbc to store and retrieve data from the underlying repository.
I have a date-time field that has to be stored with hour, minutes and seconds.
So in my entity the field is declared as LocalDateTime.
My understanding is that the…
I have this DTOs (data transfer object):
public record ProjectsDto(long id, String projectName, String contact, String fundingCode, LocalDate runtimeFrom,
LocalDate runtimeTo, String costUnit, String chapter, String unit,…
Here is my table structure. I am using spring-boot-starter-data-jdbc 3.0.3. I mapped these tables like below.
@Table("ticket")
public class Ticket {
@Id
private int id;
private String subject;
private TicketType ticketType;
//…
I'm currently working on a project that utilizes Spring Data JDBC custom repository. In my custom repository, I have implemented my own DataAccessStrategy, AggregateRoot, AggregateExecutor, and SqlParameterSource to generate SQL scripts. However, I…
I have a deadlock that baffles me. It happens in my spring application upon inserting into a Table without an active transaction. I use the save method on the SimpleJdbcRepository. This question is not about solving the Deadlock but about why it…
I'm trying out pre-defining my database structure using SQL schema and then utilising it within my Kotlin code. I'm using Spring Boot and Spring Data JDBC.
Here's what I currently have so far:
My User class:
data class User(
@Column(name =…
I'm doing a learning project and I want to create an API. I will be using PostgreSQL. I'm setting up my project with Spring Initializr and I'm a bit confused regarding the SQL options.
Which should I choose? I tried to research the differences…
I'm going to use @InsertOnlyProperty with Spring Boot 2.7 as it will take time for us to migrate to Spring Boot 3.0!
So I'm going to create my DataAccessStrategy based on the DefaultAccessStrategy and also override the SqlParametersFactory so that I…
I realize custom repository and try because we use Spring Data Jdbc 2.7 which is not supporting InsertOnlyProperty and in SQL generation I try to get class of sub aggregation for using in context.getRequiredPersistentEntity. How can I get it from…