jpql « SQL « JPA Q&A





1. JPQL to SQL converter    stackoverflow.com

Is it possible to access the SQL which is generated by JPQL? I would like to use the SQL to later create a view for my purposes. I am using Hibernate ...

2. Are SQL injection attacks possible in JPA?    stackoverflow.com

I'm building a Java Web Application using Java EE 6 and JSF-2.0, using the persistence API for all database operations. The back-end is MySQL, but I have used the EntityManager functions ...

3. Is there any JPQL analyzer?    stackoverflow.com

I developed app using JPA Toplink which uses JPQL. According to my research JPA will call more SQL than what JPQL statement look like. I'm looking for some JPQL analyzer tools like ...

4. RESTFul Services SQL to JPQL    stackoverflow.com

I've two tables in Derby, first table holding Runner details and second the athletic meet details as follows: Runner: RunnerID, Firstame, LastName etc. Event: EventID, RunnerID, Distance, Duration etc. I want to create a ...

5. jpql INTERSECT without INTERSECT    stackoverflow.com

i have four queries that return intergers.

select listOfIntegers from [something]...
(edit: the results are ROWS) and need a way to do
select ...
intersect
select ...
intersect
select ...
intersect
select ...
but in jpql there is no intersect as such. so, ...

6. java.sql.SQLException: Fail to convert to internal representation    stackoverflow.com


I'm trying execute following query:
String query = "select entity, entity.id from Site entity"; List resultList = entityManager.createQuery(query).getResultList(); And take exception:
... Caused by: java.sql.SQLException: ...

7. JPQL to SQL translation error    forum.hibernate.org

Hi, I'm a new person here and not very familiar with neither Hibernate nor Java Persistence. I have a very simple JPQL query with one parameter: Code: select e from AtomicEUP e join e.generics g where g.processStep = :processStep AtomicEUP.generics is a many-to-many relationship with Generic.measurements on the opposite side. Generic.processStep is a one-to-one relationship to an entity of type ProcessStep. ...

8. SQL to JPQL    forums.oracle.com

Hi, Thanks for the suggestions. I read through JPQL Language Reference and came up with following query. Select r.firstname, r.lastname, (e.distance/e.duration) as speed from Runner r Inner Join r.event e Order BY speed Desc; But when I run it, it gives me following rror javax.servlt.ServletException: java.lang.ClassCastException: org.eclipse.persistence.internal.jpa.parsing.DivideNode cannot be cast to org.eclipse.persistence.internal.jpa.parsing.AliasableNode Can someone confirm if the query is right. If ...