I'm using entity manager to create a table with native query,and insert rows to another table with em.persist().
when the native query which is create table failed,I rolled back,but the em.persist() is always successful.Does anyone know the answer??…
I've been triyng to create a query using a dblink with some parameters.
I'm using Hibernate 4 and the database is a MSSQL.
But I either get:
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '@P0'.
if my query is…
I'm getting invalid column name error while using JPA nativequery in netweaver server .The database is Oracle 10g
here is my code
Query query = em.createNativeQuery("select et.eqt_desc from ge_equip_type et",GeEquipType.class);
final List…
I have the following DAO method:
public String getSomeTable(final String param1) {
String sqlString = "select * from table where name ilike ?";
Query query = this.getEntityManager().createNativeQuery(sqlString);
query.setParameter(1,…
We use JPA in our project but there are certain complex queries that need to be done straightforward in native query. We make use JPA native queries for this, like the one below
Query query = em.createNativeQuery(sql.toString(),…
So we've got a whole lot of Postgres SQL queries stored in files and used from PHP. The task is to replace PHP with Java. We want to reuse as much of the queries "as is" to keep the migration path short. I can't get the Array parameters to…
I have a result set that is returned from a pretty complex query which I would prefer to run using SQL rather than HQL.
Just for context - It is a suggestions result set that suggest replacing existing objects that the customer pays for, to another…
How to have named native queries for 2 databases and have the EclipseLink run the right one on the db?
I give an example: I have a solution that can run with Oracle Db and PostgreSQL. There is a need for native queries to be run on db. So the native…
I am using hibernate OGM to talk to my MongoDB instance. I had to get a list of all the products with category "abc". I am using the native query approach to achieve this as following:
String stringQuery = "db.Message.find({'CATEGORY':'" + category…
I have query which returns data from multiple entities
@Override
public List testPlayerQuerry() {
return copyTest(em.createNativeQuery("select player_name, pg.player_game_score, g.game_description from player p\n"
+…
I have following query
@Override
public List testPlayerQuerry() {
return copyPlayersToDetails(em.createNativeQuery("select player_name from player p\n"
+ "join Player_Game pg on p.player_id = pg.fk_player_id\n"
…
Using Spring data JPA, trying to create a generic method to upload csv data to database using Load Data mysql. The below code is my attempt. The problem is, the second parameter tablename is getting replaced with quotes. Eg: LOAD DATA LOCAL INFILE…
I have a sql query too complex to translate in QueryBuilder. It works by nativequery. The problem is that my entity type asks me a QueryBuilder not a query. Do you have a solution?
This is my query :
SELECT v.* FROM vat_rates v
INNER JOIN (
…