You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Dianne Richards (JIRA)" <ji...@apache.org> on 2009/01/26 00:48:59 UTC

[jira] Updated: (OPENJPA-849) Add metadata-type getter methods to EntityManager

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

Dianne Richards updated OPENJPA-849:
------------------------------------

    Attachment: patch.txt

I'm attaching a patch so please review. For anyone who applies this patch, be aware of the following. I changed the pom file for running the test suite, changing the property name "openjpa.ConnectionDriverName" to "javax.persistence.jdbc.driver". This allows me to run some additional tests and also makes sure we support at least one of the new spec properties correctly. But, this caused some of the other test cases to fail, becuuse there's code to prevent both property names from being specified. I fixed these test cases as well as a persistence.xml. But, if you try to run these test cases with a system value for the "openjpa.ConnectionDriverName" property, a number of these will fail. Change the system property name to "javax.persistence.jdbc.driver".

Some details related to this patch:
1 - If a property has 2 names (such as openjpaConnectionDriverName and javax.persistence.jdbc.driver, the getPropertys() method returns only 1 name, as follows:
   a - If the value has been set, the name by which it has been set is returned
   b - If the value has not been set, the spec value is returned with the default value
2 - The getSupportedProperties returns properties as follows:
   a - If a supported property has 2 keys, such openjpa.LockTimeout and javax.persistence.lock.timeout, both keys are returned.
   b - The supported properties related to the PersistenceContext annotation and the EntityManagerFactory createEntityManager() method are currently limited to those with supported setters on the OpenJPAEntityManager interface. To allow additional  properties, additional setters/getters will have to be added and code that retrieves those properties would have to change to use these getter methods rather than retrieving the configuration values.
3 - In setting the framework for supporting the getSupportedProperties() methods on the EntityManager and EntityManagerFactory, consideration and support was also provided for the Query getSupportedHints() method.

> Add metadata-type getter methods to EntityManager
> -------------------------------------------------
>
>                 Key: OPENJPA-849
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-849
>             Project: OpenJPA
>          Issue Type: Sub-task
>    Affects Versions: 2.0.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>         Attachments: patch.txt
>
>
> This task is for supporting the new 2.0 EntityManager methods getProperties() and getSupportedProperties()

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.