Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
26 views

UPSERT native SQL query for Collection as @Param of JPA Repository method

I need to iterate over collection of Enteties and apply UPSERT for each element atomically. As i see it - just need to send this collection into SQL query by SpEL. I know, what i can iterate over ...
Andrew Yatkin's user avatar
0 votes
1 answer
24 views

Entity Inheritance and query filtering

I'm trying to achieve a very basic from SQL point of view operation but using Spring Boot and JPA This is my Java data model: @MappedSuperclass public abstract class BaseEntity { @Id @...
Witek's user avatar
  • 55
0 votes
1 answer
60 views

JPA entity ID field with a SQL Server 2022 Sequence

I am trying to connect my Spring Boot service to a SQL Server 2022 database, but I am having issues with a sequence: public class SomeEntity { @Id @SequenceGenerator(name = "some_seq"...
kayelbb's user avatar
  • 55
0 votes
1 answer
31 views

space is not allowed after parameter prefix ':' in SpEL support in Spring Data JPA @Query definitions

I need to update the values into update native query from EmployeeDTO class and I have used following implemetation. But I got this error in console, even though the syntax is correct for query: ...
JATHURSHAN SUMANDIRAN's user avatar
1 vote
0 answers
28 views

Wrong "order by" generated with JPA native query

I have very complicated SQL written as native SQL. It's not possible to rewrite to JPL. It's a rewrite of some complicated logic implemented in Java code, but the filtering and paging is totaly ...
Martin Edlman's user avatar
0 votes
1 answer
79 views

Improve execution time of a query that populates data

Good morning everyone, how are you? I need help related to a process whose popular purpose is data from one table to another, at the moment I'm using spring boot with native query, but it's taking ...
victor hugo's user avatar
0 votes
1 answer
53 views

Why JPA is adding fields of subclass when dealing with superclass? How to prevent that?

I want to use a SQL function to get length of a saved blob. I use jpa, an enity and a repository for that. My implementation looks more or less like this: public interface UploadRepository extends ...
aGentleUser's user avatar
0 votes
3 answers
87 views

comma separated column value to query using like statement with java list as a parameter in jparepository

I am developing job portal similar and I had postgresql table job_seeker with column name skill holds the job seeker skills as comma separated values table name - job_seeker columns - id name ...
Anil Nivargi's user avatar
  • 1,663
0 votes
0 answers
33 views

JPA Query with NOT LIKE doesn't work to filter ips

I am working with a JPQL query to filter some gateways ips ending with 1 (the column in the database is of type INET but on the entity is of type String): ...AND concat(c.ip,'') not LIKE '%.1' THe ...
Ana M's user avatar
  • 1
0 votes
1 answer
23 views

Use JPQL or SQL to SELECT items _not_ in the database from a supplied set in the query parameters

I have an interesting problem, I need to figure out which files I have not processed. I have an object called ReturnFile(return_files) that stores the ones I've processed. I'd like to issue a query ...
Jonathan S. Fisher's user avatar
-1 votes
1 answer
180 views

JPA Native Query with Timestamp with LocalDateTime.now() to write (update) and then select the same records that were just modified

I am using Timestamp with now = LocalDateTime.now() with Native Query and update and later I am using the same now variable to select from database. MS SQL. I am using this Java Spring Boot. In a ...
Jack's user avatar
  • 167
-1 votes
2 answers
42 views

filter on union entities with JPA specification

Considering this java JPA model: @Entity @Table(name = "PARENT") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class ParentEntity { } @Entity @Table(...
Thomas's user avatar
  • 1,122
0 votes
1 answer
72 views

String formatting with object parameters in intellij

I am creating a standard function that uses jpa's createQuery function, as it will be a generic class, I can format the sql elsewhere, but when using the same pattern and definition of parameters only ...
El PsyCongrou Men at Working's user avatar
0 votes
0 answers
59 views

Advanced database queries from frontend to Spring Boot backend

I'm developing an internal tool with a Vue.js frontend and a Java Spring Boot 3 backend. One of the key features I want to include is an advanced database search that allows users to retrieve database ...
user24299135's user avatar
0 votes
0 answers
46 views

How to inject a List<String> parameter as a text array into a non-IN native query in Spring Data JPA?

There is something I really don't understand about JPA @Query params injection: I would expect any List<String> to become a {...,...}::TEXT (or ::VARCHAR) in SQL since it's the obvious way to ...
Ivan Gabriele's user avatar

15 30 50 per page
1
2 3 4 5
153