In my DB I nave a table Subject with columns
id (long)
name (String)
ifActive (0 or 1)
text (very long String)
In my web page I must display list of names of Active Subjects. So I declare the following native query in xml…
In my code I have the following query string:
private static final String QUERY = format(
" SELECT t2.address " +
" FROM schema.table1 t1 ," +
" schema.table2 t2 ," +
…
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 ---
I am mapping the result to two entities, so I…
anyone can help me. this is a problem i've spent much
time on it. I'm using JTA'S BMT transaction, and I'm going to execute
3 steps in same transaction:
Insert one row to a table with entitymanager;
Drop a table if it exists with native…
I've got a legacy SQL Server database, and they've given to me a query, which does some join between several tables.
SELECT TipoDia, ServBus, Instante, Evento, [VistaHorariosActivos].Linea, Coche, [VistaHorariosActivos].Sublinea,…
hi guys my dout is i got a jsonobject and im sending this object as a parameter to a nativeQuery:
Query query = entityManager
.createNativeQuery("{call myprocedure(?)} ");
query.setParameter(1, myjson);
i got the error…
I am using Hibernate with native query to update a field in a table with 17000 rows in Oracle.
When I execute the query on Toad, it takes 0.5s to be executed and with the below code no finish ever.
Query query = em.createNativeQuery("UPDATE table…
I get following error: "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Card.findPrefix'"
for:
…
I create a file sql from multiple query and I run file into my app, but the special character encoding fail!
My code:
InputStream fis = Main.class.getResourceAsStream("/myapp/patch/file.sql");
String sql =…
I have a (simplified) table structure that looks something like that:
customer table:
id name
-------------------
1 customer1
alias table:
customer_id alias
-------------------------------
1 customer one
1 …
I'm trying to do a simple aggregation in mongoDB using NativeQuery. Is it possible? I made many tests but I can't find a solution.
The query is :
String query = "{ $match :
{ dateTimestamp :
{…
I created an SQL query:
SELECT ORDER_NUM, STUFF2, STUFF3 FROM table1 t1 WHERE (STUFF3 = 'poor')
AND NOT EXISTS
(SELECT ORDER_NUM FROM table2 t2 WHERE t1.ORDER_NUM = t2.ORDER_NUM)
The query works correctly and I get the desired result; However, I…