Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
546 views

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....
Clem's user avatar
  • 1
1 vote
1 answer
2k views

I've been sitting here for long to solve this problem. (I can't show a lot of code because it is corporate secret so here will be parts of it or just examples) I have my project connected to 2 ...
bnemos's user avatar
  • 11
0 votes
1 answer
948 views

The requirement is :- The application will run dynamic SQLs and show the results in table format in JSP. The SQL passed to the application will change, which means the number, name, datatype of ...
saswata's user avatar
  • 25
1 vote
0 answers
1k views

I work on a spring boot, data jpa web application and have a problem with an entity that has a @transient field and I want to bind result of my native query to this entity (all fields even @transient ...
samaz's user avatar
  • 11
0 votes
0 answers
264 views

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 @...
Nathan Coates's user avatar
0 votes
2 answers
941 views

The challenge: I am trying to batch fetch a collection of nested entities from my database. The resulting dataset ranges in the thousands of entities so my approach is to fetch entities in a paged ...
Aage Dahl's user avatar
0 votes
0 answers
257 views

Greeting to all, As I'm learning Java, JDBC and MySQL I reach one point where I would like to perform the following I have 2 entites class User { private Long id; private String username; ... ... ...
Svetlyo Stoyanov's user avatar
1 vote
1 answer
1k views

My normal query was looking like this. $qb = $placeRepository->createQueryBuilder('p'); var_dump($qb->getQuery()->getResult()); I'll get few results as objects. So this is the normal ...
Patrick's user avatar
  • 909
0 votes
1 answer
371 views

In my project, I have created a view that contains multiple joins. The following is part of the query from the view. a.id, b.object1, b.object2, b.object3, case when (c.type = 'qrt' then c.object4 ...
Charvee Shah's user avatar
0 votes
0 answers
2k views

I am attempting to map the results of a Stored procedure to a non-entity POJO using @SqlResultSetMapping with @ConstructorResult. Here is my code: @MappedSuperclass @SqlResultSetMapping(name = "...
blackbird's user avatar
  • 510
0 votes
0 answers
150 views

I have a table form_header with 3 records There are more fields in the table decided not to add it here in the post since most are irrelevant. I created a class/entity to get the count with distinct ...
Arnold Cristobal's user avatar
0 votes
1 answer
365 views

Here is my code in the flask app from flask import Flask, render_template from flask_mysqldb import MySQL import MySQLdb.cursors app = Flask(__name__) app.config['MYSQL_HOST'] = 'localhost' app....
Sreenath Kumar's user avatar
-1 votes
1 answer
545 views

I am having below Tables 1. Material Unit: id | Unit_name 1 | Nos. 2 | lts 2. Material Table: id | Material_name 1 | bricks 2 | Cement 3. Grn Table: id | material_id | qty | unit 1 | 1 ...
Mayur Patel's user avatar
0 votes
1 answer
989 views

I have a Select Statement which works well, producing 7636 rows: SELECT c.ClientId FROM dbo.tblTreatment e JOIN dbo.tblProgramAssessment pa ON pa.TreatmentID = e.TreatmentId ...
Mo_Dlg's user avatar
  • 73
0 votes
1 answer
2k views

I currently have a named native query set up in CrudRepository where I'm joinnig few tables and I need to map that query result into a Dto. select event_id, replaced_by_match_id, scheduled, ...
lmiskovic's user avatar
  • 139
0 votes
0 answers
2k views

I am working on a Spring boot rest API and i asked a question earlier about mapping pojo class to result set Could not locate appropriate constructor on class..... the answers I got worked ...
H.beuhier's user avatar
1 vote
0 answers
278 views

I need to execute several different queries and I want to use the same POJO to get the results. What I get with those queries are combinations of same columns, can I reuse the same sqlResultSetMapping?...
Francisco Prado's user avatar
6 votes
1 answer
13k views

I have a complex native query and I am trying to map its result to a non-entity DTO class. I am trying to use JPA's SqlResultSetMapping with ConstructorResult My DTO class @Data public class Dto { ...
Tartar's user avatar
  • 5,492
0 votes
0 answers
656 views

In our software, we had a requirement that display name of one UI will be configurable according to user. So one user want to display another column from one table and another user want to display ...
user725455's user avatar
0 votes
0 answers
98 views

I'm trying to connect the SQL plus database with java but it's not working , I'm using netbeabs ide 8.0.2 Here i have pasted following cod e in my submit button but when I execute it then it goes ...
Gaurav Khambayat's user avatar
0 votes
0 answers
525 views

In mybatis we can define very complex mapping of the sql result set to an arbitrary complex dto object. Take a look at the example here: http://www.mybatis.org/mybatis-3/sqlmap-xml.html at the ...
Mladen Krstić's user avatar
0 votes
1 answer
829 views

I need to fetch 4 columns by joining multiple tables. I have created the query. But how can I map the result set to a pojo which is not an entity and i want to use Spring Data JPA. Could someone ...
Pavan's user avatar
  • 227
0 votes
1 answer
2k views

Java, Spring Data JPA I have 2 entities: class Source { Integer id; String name; } class Item { Integer id; String name; Integer sourceId; } I need statistic native query result like ...
Elegant.Obj's user avatar
1 vote
1 answer
2k views

I tried to map a native SQL query to a POJO class using @ConstructorResult of @SqlResultSetMapping as following : @SqlResultSetMapping( name = "AnomalieMapping", classes = @...
Renaud is Not Bill Gates's user avatar
14 votes
1 answer
20k views

I have been using this post as an example. I have a complex join query (simplified here). It returns a subset of values from two tables (and a derived column using CASE). I don't think I need to use ...
Micho Rizo's user avatar
  • 1,092
0 votes
1 answer
530 views

JPA: if classes, entities and columns are defined in @SqlResultSetMapping, what is the order of objects returned? @SqlResultSetMapping( name="CustomerDetailsResult", classes={ ...
eastwater's user avatar
  • 5,808
1 vote
0 answers
691 views

Native SQL with aliased field names + remapping to receive managed entities is required for more complex queries with joined tables. However, the mapping of the SQL aliases leads to an exception ...
HeinMel's user avatar
  • 11
9 votes
1 answer
3k views

Im working in a backend API using Java and MySql, and I'm trying to use @SqlResultSetMapping in JPA 2.1 for mapping a ONE-TO-MANY native query result into a POJO class, this is the native query: @...
Tamer Saleh's user avatar
0 votes
0 answers
305 views

I'm trying to use ResultSetExtractor to send a SQL statement to the database, but the method is getting stuck at the line l.setId(resultSet.getInt("Id"));. This is my error message: "message": "...
nancybrew's user avatar
22 votes
4 answers
30k views

I was stuck with the following situation: My entities are related to each other, but in such a way that i could not use JPQL. I was forced to use native SQL. Now I want to map these results to a ...
LeoRado's user avatar
  • 363
3 votes
2 answers
2k views

I'm trying to put the Result Set (DB Query Values) inside a LinkedHashMap>. Every Iteration of row. The value is getting overriden while putting into DBMap. <LinkedHashMap<String, String>&...
Keerthivasan S's user avatar
1 vote
3 answers
1k views

I have a sql script as follow : declare db_list cursor for select name From sys.databases open db_list declare @var varchar(MAX) fetch next from db_list into @var print @var while (@@FETCH_STATUS =...
Sumit Singh's user avatar
0 votes
0 answers
518 views

In Eclipselink, when I use @SqlResultSetMappings and I use Query Hint eclipselink.cursor, the console shows me the following exception: Caused By: java.lang.IllegalArgumentException: Query null, ...
Fábio Almeida's user avatar
1 vote
1 answer
514 views

I want to join two entities in a non-entity class, which will have the two entities as attributes of the class. Take this as example: @Entity public class A { } @Entity public class B { } public ...
Alex Chihaia's user avatar
0 votes
1 answer
891 views

I'm trying to map the results of a NativeQuery to a non-entity pojo, using SqlResultSetMapping and ConstructorResult I'm using this StreetCity class, with result mapping: @Data @SqlResultSetMapping(...
Jarl Wijman's user avatar
0 votes
1 answer
4k views

I am running a NativeQuery with JPA that gives different results compared to running the query in an sql tool. Probably I missunderstand s.th. within the concept of @SQLResultSetMapping. --- Overview ...
mararn1618's user avatar
0 votes
1 answer
688 views

There is an example about @SqlResultSetMapping in http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/native-sql.html I do not understand where and how i should use it? In ...
olga's user avatar
  • 979
1 vote
1 answer
6k views

I have a simple entity @Entity @NamedNativeQueries({ @NamedNativeQuery(name = "Account.dailyRegistered", query = "select date(date_trunc('day', creation_date)) as period, count(1) as ...
Andrey Beletsky's user avatar
0 votes
1 answer
404 views

I want to join two tables and read all the columns within java. In java the resultset contains all the fields but they have the same names for both tables. Their are about 65 columns and I do not want ...
ninjaxelite's user avatar
  • 1,188
1 vote
1 answer
2k views

I am trying to call a stored procedure which returns a non entity object using JPA. Here is what I do. StoredProcedureQuery query = entityManager.createStoredProcedureQuery( "DepAndTerm", ...
fjkjava's user avatar
  • 1,464
2 votes
3 answers
4k views

In Java application which uses JPA 2.1 with Hibernate 4.3.11 implementation I am trying to use SqlResultSetMapping to map native query results to entity. Query includes joined two tables with same ...
Miha's user avatar
  • 45
3 votes
2 answers
3k views

I'd like to map data from a native query to an object with a list in it. Let's say I have this query (it's a contrived example of what I want to do) select p.id, p.name, a.address, a.city, s....
JohnL's user avatar
  • 65
2 votes
1 answer
595 views

I have an entity called order which contains 10 columns and also has embedded id(composite key) columns which contains 5 fields in entity order. Here is my sql query <named-native-query name="...
user5981335's user avatar
1 vote
1 answer
930 views

I have 2 non related entities: External and Internal. I need to union select all results from entities. I am using ResultSetMapping and Native SQL to do this: $em = $this->getDoctrine() -&...
user3793667's user avatar
0 votes
1 answer
166 views

I have a table as Country State USA Texas USA Alasca India Delhi India Bombay India Madras Russia Mosco Russia Petersberg ...
Sajeev Zacharias's user avatar
0 votes
1 answer
45 views

@DateMonth as INT, @DateYear as INT AS --set @DateMonth = 08 --SET @DateYear = 2015 DECLARE @FromDate DateTime; DECLARE @ToDate DateTime; SET @FromDate = CONVERT(DateTime, ...
FloatingPC's user avatar
1 vote
1 answer
4k views

I have two entities, Users and Annotations, and I want to add a set of results from a query on the Annotations table to a transient variable in the Users entity. Entities: Users @Entity ...
mrks_'s user avatar
  • 369
0 votes
0 answers
150 views

Cont. on jpa native query retrieve multiple entities My database (testing) company - ID {PK}, name staff - ID{PK}, name, companyID{FK} department - ID{PK}, name, companyID{FK}, staffID{FK} project - ...
KKL Michael's user avatar
0 votes
1 answer
2k views

I have an archive table (id, title, author) and a download_history table (id, id_archive, date) to keep track of how many download for each archive. Now I want to build a report to view the most ...
user3174311's user avatar
  • 2,033
3 votes
1 answer
4k views

I have a database with 4 tables: company,staff,department,project Company.java @Entity @Table(name = "company") @SqlResultSetMapping(name = "COMPANY", entities = { @EntityResult(entityClass = ...
KKL Michael's user avatar