Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » JPQL Refactoring? (Is there any support for refactoring of JPQL queries?)
icon5.gif  JPQL Refactoring? [message #1046960] Mon, 22 April 2013 11:47 Go to previous message
Peer  Törngren is currently offline Peer Törngren
Messages: 9
Registered: July 2009
Location: Sweden
Junior Member
Looking into Dali primarily in search for refactoring tools that support JPQL queries.

Is there some way to write a JPQL query to ensure it is updated when types or attributes are renamed (without "updating textual references")?

Writing a regular string that is passed into the query will obviously (?) not work:
return em.createQuery("select c from Company c where c.type = :type", Company.class)
.setParameter("type", type.toString())
.getResultList();

PS: I did have a look at patterns for typesafe JPA queries using the CriteriaQuery API (http://www.ibm.com/developerworks/java/library/j-typesafejpa), but most of us feel that this requires too much extra code to be an attractive option.
 
Read Message icon5.gif
Read Message
Previous Topic:Hibernate to JPA 2.0 migration issues
Goto Forum:
  


Current Time: Wed May 29 01:30:36 EDT 2013

Powered by FUDForum. Page generated in 0.07717 seconds