12,041 questions
0
votes
0
answers
27
views
cant manage to make entity corresponding to entitygraph query
so i am using entity graph to make a dynamic query of a table, the query is being made correctly which is corresponding to my graph and subgraph attribute nodes but when i fetch it as the entity, the ...
0
votes
1
answer
42
views
Enable Hibernate @Filter as default in Springboot for soft delete
I defined a Hibernate Filter to filter out the deleted records.
My wishlist:
The Filter should be enabled all the time as default.
Only in special cases when I need the deleted records, then I would ...
2
votes
1
answer
152
views
How does Spring JPA “instantiate” the interfaces that extends repositories?
I'm delving into Java concepts such as dynamic proxies, reflection, etc. That's why I'm trying to implement some Spring features. Anyway...
I created the dynamic proxy:
@Override
public Object invoke(...
1
vote
1
answer
111
views
@LastModifiedDate is not updated with @ManyToMany relation
In Spring Boot I have an entity:
@Entity
@Table(name = "Product")
@EntityListeners(AuditingEntityListener.class)
public class Product extends BaseEntity {
...
@NotNull
@...
0
votes
1
answer
71
views
undefined method error in eclipse in a project correctly building with maven
Eclipse gives me the following error:
The method delete(Sumti) is undefined for the type SumtiRepository DeleteBridiTest.java
The relevant parts of DeleteBridiTest.java:
public class DeleteBridiTest ...
2
votes
1
answer
60
views
Not able to reset sequence for the primary key of an entity
I'm implementing some tests for REST endpoints that manipulate a database (in test context, I use an H2 database) via spring data JPA, and I would like to have all the tables clean (no data in it, and ...
1
vote
1
answer
47
views
Why does Ignite allow SQL querying of a cache A (only) from a different cache B's Ignite Cache reference
I noticed that Ignite seems to allow SQL querying (with SqlFieldsQuery) of a cache say cache A from a different cache say cache B's IgniteCache reference.
I can understand join queries, but shouldn't ...
0
votes
1
answer
39
views
Aggregate and paginate over inner array with SpringData MongoDB
I need to paginate over documents contained in arrays of the root documents. For example, to view the first 10 orders with an open status across customers.
Customer structure
{
"_id": ...
-4
votes
1
answer
101
views
Referencing parameter attributes in JPQL
I get a nice DTO in my controller.
// UserController
@GetMapping
public ResponseEntity<List<UserResponseDto>> findUsers(@ParameterObject FindUserRequestDto userRequestDto,
...
2
votes
1
answer
81
views
@EntityGraph makes eager attributes lazy
I want to be able to eagerly fetch associated "to-many" entities. So I included a separate "eager" query method annotated with @EntityGraph.
@RepositoryDefinition(domainClass = ...
0
votes
1
answer
91
views
Spring/Hibernate native query, MySQL parameters not bound
I have the following query method for a native query in a Spring Boot application
@Query(value = """
SELECT a.*, ST_Distance_Sphere(a.coordinate, ST_GeomFromText('POINT(:lat ...
2
votes
0
answers
40
views
Spring Data CassandraDriverTimeoutException
I'm getting sporadic timeout exceptions from the Cassandra driver in a Spring Boot project, in spite of having what I think are the appropriate yml configuration properties.
spring:
cassandra:
...
0
votes
1
answer
97
views
What could be the issue with this composite key and query setup in Spring Data JPA?
I'm working on a Spring Boot project using JPA and trying to query an entity that uses a composite primary key with @IdClass, but I can't get the repository method to work.
I've double-checked that:
...
0
votes
1
answer
30
views
Database contains embedded objects, but MongoRepository returns empty List
@Document("scenarios")
public class Scenario {
@Id
private String id;
@Indexed(unique = true)
private String name;
private String description;
@JsonSerialize(using = ...
2
votes
2
answers
131
views
Spring Data JPA: Persistent Context Unexpected Behavior
The CategoryRepository is defined like this:
public interface CategoryRepository extends JpaRepository<Category, Long>{
@Transactional
@Query("select c from Category c where name = :...
0
votes
1
answer
72
views
Spring Data implementing custom repository with abstract class in the middle
I need to implement filtering to all entities' repositories.
The filtering follows the same scenario, differing only in Filter and Entity params.
So now I have my filter interface:
interface ...
0
votes
1
answer
80
views
Select more aggregate roots in a single query using Spring Data R2DBC
I have an application in Spring Boot 3.4.x using Spring Data R2DBC.
Let's say I have two aggregate roots, Book and Author. I understand that from the reactive point of view, it is not possible to work ...
0
votes
1
answer
76
views
MongoDB Timeseries Query Not Using Index And Taking Excessively Long
I have a large timeseries collection filled with millions of documents called "Events" that have the following structure
{
"_id": {"$oid": "123456"},
"...
0
votes
0
answers
47
views
Using `JdbcTemplate` with `@Table` Entities in Spring Data JDBC Without a Custom `RowMapper`
I use spring-data-jdbc and have mapped my DB tables with org.springframework.data.relational.core.mapping.Table.
I also have some custom queries with org.springframework.data.jdbc.repository.query....
0
votes
1
answer
87
views
One-to-Many relation in postgreSQL and how to test it
I have an issue where I have an object that takes some fields, and one of these fields is a List (0-2, so nullable) and need to save it in a database (PostgreSQL is what I use). Now I know that having ...
0
votes
0
answers
57
views
Spring Framework DefaultResourceLoader behavior
I am using ByteBuddy to generate classes from the JPA Persistence Unit and Spring Data,
an older version already works with the persistence unit, spring data jpa and spring webmvc and, now my ...
1
vote
1
answer
1k
views
@TransactionalEventListener with @Transactional and propagations REQUIRES_NEW, NOT_SUPPORTED
I don't understand why this is needed now. I can't start my application because I have a service with @Transactional annotation and some methods with @TransactionalEventListener, and everything was ...
0
votes
0
answers
114
views
SpringData r2dbc vs jpa when saving a list of entities with the same ids
In Jpa Spring Data when using saveAll for entities with the same ids - saveAll successfully saves all the enitities into the database. For example
public interface JpaRepository extends JpaRepository&...
0
votes
0
answers
49
views
Query annotation with sort on a date cause exception
I use spring boot 3.4.2, spring data jpa and oracle
I have this query
@Query("""
select n from Notice n
join fetch n.noticeType nt
join n.deposit d
...
1
vote
1
answer
80
views
Spring Data JDBC repository-like service without extending Repository<Entity, Id>
I am using Spring Data JDBC repositories which are defined through interfaces (which extend Repository<Entity, Id> and have their queries specified through @Query) for various entities and ...