Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Minutes: Design Specification: MOXy Support for Dynamic Persistence

Review: Design Specification: MOXy Support for Dynamic Persistence
Tuesday January 10 2010
Attendees: Rick Barkhouse, David Twelves, Doug Clarke, Shaun Smith, Blaise Doughan, Mike Norman, Polly Chang

Minutes:

API / DynamicJAXBContextFactory
  • Create names can be shorter, omit 'Context'
  • XSD is an acccepted abbreviation for XML Schema
  • We will refer to External Metadata as OXM (possibly subject to change)
  • createFromXSD(), createFromOXM(), createFromProject()
  • Minimize number of createFromOXM and createFromProject APIs, focus on and maximize XSD constructors
  • Should add XSD constructors for STAX, and add EntityResolvers to all XSD constructors
Q. Would it be better for users to go through standard JAXB API, rather than creating new API?
  • This may be an alternative route for users to access new functionality - could be an enhancement after core feature is complete.
  • Would require 'jaxb.properties' on classpath, which may be an issue for users that just have a schema and nothing on filesystem at all (currently don't require a jaxb.properties file with proposed API)
  • Could also support bootstrapping via the (String contextPath, Map properties) APIs (future)
Problem encountered by JPA: If asked to create a Static Class that doesn't exist, hard to know whether to go ahead and create a dynamic class or not, or if it is just an error.  JPA just treats this as an error and doesn't create dynamic class (correct?)  This should be raised as a new open issue.

Should we have a flag in OXM.xml to explicitly indicate that classes should be generated and not loaded?

API / Use Cases


Polly raised usecase of DynaBeans (sp?) where an XPath mapping is stored in the D/B.  We would handle this as a separate ORM mapping to the D/B schema and create JAXBContext from there.  We have a solution to this at present - would be worth creating an example to capture how we do this.
    
She also raised another usecase - she has statically defined objects but needs to map extra properties (in addition to the defined mappings) but doesn't know what these will be until runtime.

This is similar to the SDO concept of defined and open content properties, where open content is defined later.  Enhancement request: We may want to create an additional core OXM mapping feature to handle this scenario for JAXB as well.
    
API / ClassLoader parameter
    
Currently default to default classloader  - parameter is there to allow a different classloader to be defined (OSGi usecase requires this)

Do we want another method without the classloader parameter?  No, just leave as is and pass in null, want to avoid creating too much API.
    
Also discussed whether StreamReader and EventReader should be included and whether these are commonly used. Could wait to see if users raise requests for these and add in API later.

Examples

No need for QNames in method parameters, use (String ns, String name) instead.

Would be nice to have the ability to perform sets on DynamicEntities using XPaths
  • enhancement request for base DynamicEntity code (Mike)
  • could be achieved today using Blaise's new XPath querying API in XMLContext
XMLExample: No namespace qualification.  Need default namespace and ability to specify it.  This could be an incremental enhancement.

Open Issues
 
002 Concurrency/Threading
  • Dynamic persistence API allows mapping to be added to a descriptor on the fly.
  • If entity already exists, it will lazily add a slot for the new mapping (that will be null)
  • New version of the schema created on the fly.  Generate new dynamic context from new schema and start using that.  In-flight requests will continue to use old schema/old dynamic content.
  • Can't remove mappings on the fly - a new context would need to be created.
006 Dynamic entities and normal concrete Java classes used together?
  • Nice to have enhancement, post 2.1
  • JPA - right now is either all dynamic or all static, hybrid model not officially supported.
008 Helper Object?

Might be a good idea to move this API to separate Helper object.  Main thing is to be consistent with SDO and JPA.

Feature Priority
  • Creating dynamic entities from Project is higher priority than creating from a Schema.
  • An XML-names approach seems to be more favored over Java names.


--
Oracle
Rick Barkhouse | Software Developer, EclipseLink | 613.288.4613
Oracle Development
45 O'Connor Street, Suite 400 | Ottawa, Ontario K1P 1A4

Back to the top