[jira] [Updated] (JDO-734) Ability to save a (created) query as a named query for later use

2015-08-26 Thread Andy Jefferson (JIRA)

 [ 
https://issues.apache.org/jira/browse/JDO-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Jefferson updated JDO-734:
---
Attachment: SaveAsNamedQuery.java

Test for saveAsNamedQuery() unless someone has a better suggestion ...

 Ability to save a (created) query as a named query for later use
 

 Key: JDO-734
 URL: https://issues.apache.org/jira/browse/JDO-734
 Project: JDO
  Issue Type: New Feature
  Components: api, specification, tck
Reporter: Andy Jefferson
 Fix For: JDO 3.2

 Attachments: JDO-734.api.patch, SaveAsNamedQuery.java


 When a user goes to the trouble of creating a query to retrieve some 
 information it is a common enough scenario that this will need to be 
 performed again during the application lifetime. Being able to save a query 
 (once created) as a named query (in the PMF) would mean that applications can 
 skip the generation step off for subsequent runs.
 Suggested API change would be to add a single method to Query.
 Query q = pm1.newQuery(SELECT p FROM Person p WHERE firstName == :param);
 q.saveAsNamedQuery(PeopleWithName);
 q.execute(John);
 ... (some time later)
 Query q = pm2.newNamedQuery(Person.class, PeopleWithName);
 q.execute(Brian);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JDO-735) Make PersistenceManager and Query support AutoCloseable (JDK1.7+)

2015-08-26 Thread Andy Jefferson (JIRA)

[ 
https://issues.apache.org/jira/browse/JDO-735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14712782#comment-14712782
 ] 

Andy Jefferson commented on JDO-735:


Test now in SVN, along with another for AutoCloseable, and previous test is 
removed from pm.conf

 Make PersistenceManager and Query support AutoCloseable (JDK1.7+)
 -

 Key: JDO-735
 URL: https://issues.apache.org/jira/browse/JDO-735
 Project: JDO
  Issue Type: New Feature
  Components: api, specification, tck
Reporter: Andy Jefferson
 Fix For: JDO 3.2

 Attachments: CloseWithActiveTxRollsBack.java


 So then it can be used with JDK1.7+ try-with-resources, as per 
 http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)