Questions tagged [nativequery]

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

Related links

355 questions
0
votes
1 answer

jpa date nativequery sql server

I'm developing something using jpa and sql server 2008 and I'm getting the following error Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting date and/or time from character string. Error Code:…
0
votes
2 answers

Symfony2 - Join with Native Query

I'm trying to putting up my first join with Symfony2 createNativeQuery. I made the first one without join and there's no problem. I think I lost some steps, to follow my code: $rsm = new ResultSetMapping; $rsm …
Roberto Rizzi
  • 1,525
  • 5
  • 26
  • 39
0
votes
2 answers

Jpa Native Query get results

I have created a native query Query q=em.createNativeQuery("select *\n" + "from contaarticoli ca,articolo a\n" + "where ca.articolo=a.id\n" + "order by ca.qta desc\n" + "limit 1;"); In workbench i have created a view : create view…
Alex
  • 7
  • 1
  • 6
0
votes
2 answers

Convert Named Query to Native Query

I have 2 separate tables mapped to SharedThing and TeamMember. I have the following named query; SELECT sharedThing FROM SharedThing sharedThing, TeamMember teamMember WHERE teamMember.sharedId = sharedThing.sharedId AND teamMember.userId…
copenndthagen
  • 49,230
  • 102
  • 290
  • 442
0
votes
2 answers

How to use sql function in a native query

I want to execute this query using native query SELECT name FROM `question` ORDER BY RAND() LIMIT 20 but when executing it i'm getting thgis error Exception Description: Syntax error parsing the query [Question.findrandom: SELECT q FROM…
user2327579
  • 449
  • 9
  • 24
0
votes
1 answer

app engine invalid connection id

We use app engine with CloudSQL and from time to time we get the following exception. It happens only when we do a native query from Java (it does not happen when we use JPA). Any idea how to get rid off it? Exception [EclipseLink-4002] (Eclipse…
0
votes
0 answers

create a function via nativeQuery

I'm trying to insert a function on database via native query, like this EntityManagerImpl entityManagerFunctionConta = (EntityManagerImpl) GermantechEntityManager.getEntityManager(); EntityTransaction transactionFunctionConta =…
Luiz E.
  • 6,769
  • 10
  • 58
  • 98
0
votes
2 answers

accessing native query list using ui:repeat

lets say i have a table test with columns id and name on my bean i got this query public List getTestList(){ Query q = em.createNativeQuery("select * from test"); List list = q.getResultList(); return list; } and on my jsf page i have:
galao
  • 1,281
  • 8
  • 26
  • 50
0
votes
1 answer

How to write JPA native query to join two tables. Eclipseink JPA,Glassfish3.x,EJB3.1, MySQL

What would be the correct way writing JPA native queries with joins and with Eclipselink JPA2.0 entities? Can some one tell me to execute the following SQL query using Eclipselink JPA native queries or JPQL? SQL query is: Select…
Sree Rama
  • 1,207
  • 12
  • 25
0
votes
2 answers

Exception [EclipseLink-4002] while using native query for joining two tables

I have 2 tables Sponsors and Study. The columns in Sponsor and Study tables are: Sponsors table structure: SponsorId: int primary key auto_increment, SponsorName: varchar(30) unique not null, Address: varchar(255) Study table structure: StudyId int…
jahnavi
  • 29
  • 2
  • 10
0
votes
1 answer

Alternative namedquery for nativequery

i need to change my query from native-query to (named-query or create-query) in jpa. em = getEntityManager(); String query = "SELECT kcu.table_Name FROM INFORMATION_SCHEMA.key_column_usage kcu,Information_schema.Tables kt " + "WHERE…
jackrobert
  • 131
  • 6
  • 22
0
votes
1 answer

how to make one to many mapping in hibernate struts2

i am having a tables login [login_id, login name] user[username, login_id, domain_id] doamin[domain_id,domain_name] i will pass a login name. and i need to get the domain name the sql query for that is SELECT m_domain.email FROM ( …
Ashok.N
  • 11
  • 1
  • 3
0
votes
1 answer

Error calling Oracle stored procedure from Hibernate Native query

Consider the following codes: String checkSeatQuery = "BEGIN USP_RESERVESEAT(IRESULT=>?, ICART_SESSION=>?, IEVENT_ID=>?, ISESSION_ID=>?, IPRICE_SCHEME_ID=>?, ISEAT_ID=>?, IBLOCK_ID=>?, INO_OF_SEAT=>?, IPOS=>?, ISOURCE=>?,…
Wilson60
  • 155
  • 3
  • 14
-1
votes
1 answer

How to show alias column in spring data jpa using native query?

I want to show it in my response distance field, but I am not able to do it please help. Here is my repo class in alias name (distance) I need to attach this distance column with my list of user results. Repository String countDistanceQuery = "(3959…
-1
votes
2 answers

Hibernate insert doesn't work with custom native query

In a spring boot project and database SQL Server, I'm doing some inserts where I need to return the id of the record I have a Entity with few fields: public class PackGroupEntity{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) …
xarqt
  • 137
  • 1
  • 2
  • 12
1 2 3
23
24