Questions tagged [nativequery]

JPA concept that allows queries in your native database syntax (instead of JPQL)

Related links

355 questions
-1
votes
1 answer

Java nativeQuery: ResultSet with AliasToEntityMapResultTransformer has unordered columns in map

I'm trying to get the resultset as a map and I'm successfully able to get it into a map. But the map keys are not as per the order of select query Please check the code: String queryString = "SELECT T1.COLUMN_11, T1.COLUMN_12, T2.COLUMN_21,…
Jake
  • 391
  • 1
  • 4
  • 22
-1
votes
1 answer

MySQL inner join error : During the execution of the query was detected to be null. Primary keys must not contain null

I want to correlate the specific columns on two tables and get back matching values based on timestamps i.e. events that occurred at the same time but written on two separate tables. I am using MYSQL INNER JOINS as below: So far, my query looks like…
SyCode
  • 1,077
  • 4
  • 22
  • 33
-1
votes
1 answer

HOw to get result from subquery as param in query

how to write query such that i want to set result from subquery to the parameter of main query. the written query works fine in postgreSQL Query Editor with set dummy value as parameter Error Log: org.hibernate.QueryException: Space is not allowed…
-1
votes
1 answer

Java Spring Boot Hibernate Native Queries

i'm new in Java Spring programming so i need some help plz...I have one app where it is given me a message that "The type SQLQuery is deprecated"...i googl it the problem, and find that (since 5.2) use createNativeQuery(String) instead Create a…
Zoki
  • 7
  • 8
-1
votes
2 answers

JPA Native Query Issue

I am facing an issue with JPA by trying to execute Native Query with a SQL SERVER 2008 database. I don't really understand what is happening. When I execute the query directly in the database I got the following result (which is what I am…
Harry Coder
  • 2,429
  • 2
  • 28
  • 32
-1
votes
2 answers

what does occur within my JPA Native Query?

I use this query on mysql (every record within tbl1 has a list of records within tbl2): select tbl1.id, tbl2.id from parenttable1 tbl1 join childtable2 tbl2 on tbl1.id = tbl2.tbl1Id and the result is true but when I use this as a Native Query…
nazila
  • 93
  • 1
  • 1
  • 10
-2
votes
1 answer

SQL native query to get a list of objects where date expiring in X

I have some "Card" object: @Entity @Table(name = "card", schema = "public") @Data @EqualsAndHashCode(callSuper = false) public class Card { @Id @GeneratedValue private Long id; @Column(name="name") private String name; …
FPerez
  • 1
  • 2
-2
votes
1 answer

Perform generic search using Spring Data JPA on my DB

For that, I have created a query like this @Query(value="SELECT"+ retreiveCol +"FROM"+tableName+"WHERE"+condition, nativeQuery = true) public Object genericSearch(@Param("retreiveCol") String retreiveCol,@Param("tableName") String…
-2
votes
1 answer

Using java Boolean class as boolean type in SQL native query

I have a use-case of getting the records based on the active flag in Postgres db. In the rest api, If active param is passed as active=true, get the active records If active param is passed as active=false get the inactive records If active param…
TikTik
  • 347
  • 2
  • 8
  • 22
-2
votes
1 answer

How is more correct to get this data with spring-data-jpa?

For example I need show statistic table on web page. This table consists of 5 rows: AVG-rating | 5 TotalSum | 12.1 SumToday | 2.1 SummMonth | 8.6 SomeElse | 666 Each value in this table - calculated using an aggregate function in a…
ip696
  • 6,574
  • 12
  • 65
  • 128
1 2 3
23
24