522 questions
0
votes
0
answers
48
views
How could I to create ALIAS on @NamedQuery?
I am trying to create a @NamedQuery that use COUNT and ALIAS(AS) to retrieve informations from a SELECT.
The problem is I don't know how could I to create an ALIAS using @NamedQuery. I was looking for ...
-1
votes
1
answer
45
views
Trying to delete entries gives: Inconsistent datatypes: expected %s got %s" in Oracle
I am trying to delete some entries based on 'name'. I have a table t1 with different columns, one of them being name and of type NCLOB.
I have a method to delete these entries in Java, and I am using ...
1
vote
0
answers
120
views
Jakarta NamedQuery cannot resolve the field from joined generic type
I would appreciate if somebody helps to solve my problem.
Here is the thing. I use jakarta-persistence-api-3.1.0.
There is the super class:
@MappedSuperclass
public abstract class AbstractStatus{
....
0
votes
0
answers
111
views
In Spring data jpa, how to use external sql file having multiple queries in @Query annotation
I have a requirement to delete an entity, let's say, main_entity and this entity has many dependent entities. So, I need to perform deletion in this manner:
delete from dependent_entity_1 where ...
0
votes
2
answers
544
views
@NamedNativeQuery and @SqlResultSetMapping: No converter found capable of converting from type [$TupleConverter$TupleBackedMap]
I am getting the following stacktrace:
org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [org.springframework.data.jpa.repository.query....
0
votes
0
answers
141
views
MariaDb - NamedQuery to filter records based on a column contains comma-separated values
I have a Spring boot application that connects to a MariaDB to fetch records. In my MariaDb table, I have a column called "tags" and this column consists of comma-separated values something ...
0
votes
1
answer
118
views
Exception: org.hibernate.exception.SQLGrammarException: could not execute query SELECT MAX(cast(value,integer))
I have a query:
<query name="getMaxId">
<![CDATA[from Identifier where value = (select MAX (cast(value, integer)) from Identifier where type = :type) ]]>
</query&...
0
votes
0
answers
260
views
Spring Data JPA NamedNativeQuery with SqlResultSetMapping and externalized query
I have a situation where I am making a read request to a database with a long, complex query that needs to map to a complex object. Based on my research, it looks like I want to use @...
0
votes
1
answer
844
views
How to pass parameter to a namedQuery from a camel route?
I have an application running camel on spring-boot.
I want to pass a parameter retriesAllowed to a namedQuery from a camel route.
namedQuery:
@NamedQuery(name = "findFailedMessages", query = ...
0
votes
0
answers
489
views
Prevent specific @Entities to generate table - hibernate JPA
Is it possible to stop spring JPA from generating table for a specific entity ?
Reason:
I want to put all my native sql queries into a separate object using @NamedNativeQuery. But @NameNativeQuery ...
0
votes
2
answers
205
views
JPQL Query not updating database
I have a JPQL with @NamedQuery that does not return errors, but also doesn´t update Database.
Here is the Entity.
@Entity
@Table(name = "restricao_decomp")
@NamedQueries({
@NamedQuery(name = ...
0
votes
1
answer
348
views
Strange bootloader casting issue caused by different packages: "class [Ljava.lang.Object; cannot be cast to class ([Ljava.lang.Object; "
I'm trying to create a nativeQuery in Spring Boot, but I'm getting a strange bootloader message when I try it:
"class [Ljava.lang.Object; cannot be cast to class com.sick.as.models.common.v1....
0
votes
1
answer
2k
views
spring jpa findBy column of inside entity
I have a couple of related entities in a relational DB:
@Entity
public class A {
@Id
@Column(name = "id" ...)
private UUID id;
@OneToMany(mappedBy = "a")
...
0
votes
1
answer
2k
views
Pass list in JPA named native query
We want to pass list of strings into JPA named native query.How we can achieve this.it is throwing invalid query parameter exception.
0
votes
2
answers
142
views
Equivalent UTL_RAW.BIT_OR in JPQL
I'm trying to make a namedquery with a result DTO where there is a field that I have to calculate using that function. Is there any equivalent?
SELECT new BitsDTO(
UTL_RAW.BIT_OR(b.bitsA, b.bitsB) as ...
-1
votes
1
answer
537
views
UPDATE AND REPLACE part or a string/record with parameter
ALL>
I have here a named query to update and replace records.
@NamedQuery(name = POST.UPDATE_POST_MESSAGE, query = "UPDATE Post p SET p.message = REPLACE(p.message, :value, 'ANONYMOUS')"
...
0
votes
1
answer
209
views
JPA 2 Relationship JOIN Named Query
I'm using SpringBoot 2.4 with JPA 2.0 and I have a Model like following:
@Entity
@Data
public class Nation {
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
private Integer id;
@...
1
vote
1
answer
218
views
JPQL TypedQuery - setParamer does not work
I am trying to fetch an entity which has a one-to-one relation using a named Query. My "where" condition is on the relation entity. I am giving a named parameter. When I execute the query it ...
0
votes
0
answers
549
views
Spring NamedNativeQuery error: "No query defined for that name"
I'm trying to use a NamedNativeQuery from Spring data and getting the error:
java.lang.IllegalArgumentException: No query defined for that name
[test]
My Query:
package com.test.domain;
import ...
1
vote
1
answer
71
views
Hibernate complex query for more then two entity
I am trying to make hibernate query for searching and filtering my entity but I can't to find any solution. I have three bounded entities.
group entity
public class Group {
@Id
@...
-1
votes
1
answer
876
views
JPA/Hibernate - No query defined for that name [closed]
I have looked at all the similiar posts but i just cannot figure it out.
Any ideas ?
Here is my Main:
The Entity itself:
and finally my persistence.xml which is located inside META-INF in document ...
1
vote
2
answers
669
views
Hibernate 5: using named query with stateless session returning java.lang.UnsupportedOperationException
after we upgrade our project from hibernate 4 to 5, we have been getting this exception where we are trying to get scrollable result from named query with stateless session. so far we have tried ...
0
votes
1
answer
1k
views
@NamedQuery : identification variable 'sysdate' is not defined in the FROM clause
I tried to look for it but could not resolve. need your thoughts on this
I am using this NamedQuery in getting results from the Db.
@NamedQuery(name= "Person.FindByCodeAndFiscalYear",
...
0
votes
1
answer
387
views
how to solve :Unable to build Hibernate SessionFactory Caused by: org.hibernate.HibernateException: Errors in named queries
I have a named query
@NamedQuery(name = "Notification.findByyoungngAndInstNum",
query = "SELECT n FROM Notification n WHERE n.institutionsregister.institutionnumber = ?1 and n....
1
vote
1
answer
809
views
JPA with Eclipselink is ignoring left outer join and add wrong FROM condition
I have a Menu entity that has a parent Menu:
public class Menu implements Serializable {
...
@JoinColumn(name = "parent" , nullable = true, referencedColumnName = "id")
@ManyToOne(...