Re: How to use datanucleus.CurrentUserProvider?


1919wang@...
 
Edited

Thanks Andy. 
I have several more questions:
  • The 1st option you mentioned is `JDOPersistenceManagerFactory.setPersistenceProperties()`, right? The underlying logic of those 2 options seems identical - saving the properties via `Configuration.setPersistenceProperties`, please correct me if I misunderstood.
  • One thing confusing is that PersistenceUnitMetaData only support String value properties, while overrideProps supports Object value; And when constructing PMF, those 2 properties are actually merged into one Map. So one question is - Is it better to make PersistenceUnitMetaData support Object value?
    public JDOPersistenceManagerFactory(PersistenceUnitMetaData pumd, Map overrideProps)
    {
    // Build up map of all properties to apply (from persistence-unit + overridden + defaulted)
    Map props = new HashMap();
    if (pumd != null && pumd.getProperties() != null)
    {
    props.putAll(pumd.getProperties());
    }
    if (overrideProps != null)
    {
    props.putAll(overrideProps);
    }

Join {main@datanucleus.groups.io to automatically receive all group messages.