I have an issue with @Enumerated(EnumType.STRING) enum passed as param to native query after mysql upgrade from 5.7 to 8.0.34.
My simplified setup:
public enum MyEnum {
A,B;
}
@Entity
@Audited
@Table(name = "my_table")
…
I have API get data from 3 table
I use native query in Spring Boot and database MySQL:
@Query(value = "SELECT stock.product_id as productId,two.product_name as productName, two.brand as brand, two.description as description, two.categoryid as…
'm currently working on a project that utilizes Hibernate as the ORM tool, and we have recently updated to the latest version of Hibernate (post-5.2). In our codebase, we have been using native SQL queries with the createSQLQuery method, which…
I have to fetch the number of order requests arrived in last 2 hours in a sql server table: ORDER_REQUEST group by order origin id using data_jpa.
I have tried various ways to achieve this using native query in data jpa but getting some…
Is it possible with the entity manager to save the name of the enum without using the name method? I need it because sometimes my enum will be null and then the name method would return a nullpointer. Now I have to do…
I am using spring boot and jpa to execute native queries. One of my column is jsonb and I need to use json operator "?|" which tries to see if any value exist in array. It fails with "ordinal parameter not bound: 1"
This is what I am trying to…
I'm facing a problem where I got
"oracle.jdbc.OracleDatabaseException: ORA-01722: invalid number"
while trying to run query in my console, in the other hand I got the exact number that I want when I run it in DBeaver.
Here's my…
I use an EntityManager to create a nativeQuery. My database is a Oracle database.
In this query:
public Map ricavaDoppioniDiUnaTabellaNSNBroker(String database, String tabella, String colonna) throws PersistenceException {
…
My query is:
SELECT id
FROM person
WHERE authority_right = ARRAY[1,2]
authority_right is integer array. My goal is to find people who have
authority_right exactly equal to [1,2], not [1] and not [2]. This query is executed successfully in console,…
I recently upgraded spring boot to version 3.0.4. After that I started to get "[java.lang.UnsupportedOperationException: Cannot project java.lang.Boolean to java.lang.Number; Target type is not an interface and no matching Converter found]" when I…
@Repository
public interface CarRepository extends JpaRepository {
@Modifying
@Transactional
@Query(value = "truncate table car", nativeQuery = true)
void truncateCarTable();
}
When I added the method I get the following…
I am having a query that uses a declare statement before executing the actual query. As I am using MSSQL server.
So, my query is like the the below:
DECLARE @IdParam NVARCHAR(50) = (
SELECT TOP 1 PartyID
FROM PartyInfo
WHERE PartyName = ?1
ORDER BY…
When I am executing the below query in Dbeaver I am getting the correct result
WITH A_ID AS (SELECT ROR.ID FROM RECORD_ORDER ROR WHERE ROR.order_no = '123' UNION SELECT RL.record_key FROM RECORD_LINE RL where RL.line_no = '077') SELECT RO FROM…