General
- Home
- Why JDO?
- JDO v JPA
- JDO v JPA : API
- JDO v JPA : ORM
- Downloads
- License
JDO Implementation
JDO Usage
- Implementations
- API Javadoc
- Types of Classes
- Types of Fields
- MetaData
- jdo DTD/XSD
- orm DTD/XSD
- jdoquery DTD/XSD
- Bytecode Enhancement
- JDOHelper
- PersistenceManagerFactory
- PersistenceManager
- Transactions
- Object States
- Object Retrieval
- Extents
- Guides
- References
- Exceptions
- Glossary
Community
- Get Involved
- Project Team
- Mailing Lists
- FAQ
- Wiki
Development
- RoadMap / TODO
- Source Code
- Coding Standards
- Issue Tracking
- Dependencies
Persistence MetaData
JDO 1.0 and JDO 2.0 support specification of persistence using XML MetaData. JDO 2.1 adds on the ability to specify persistence using Java5 annotations.
XML MetaData
JDO (1.0.1, 2.0, 2.1) expects any XML MetaData to be specified in a file or files in particular positions in the file system. For example, if you have a class com.mycompany.sample.MyExample, JDO will look for any of the following files until it finds one (in the order stated) :-
META-INF/package.jdoWEB-INF/package.jdopackage.jdocom/package.jdocom/mycompany/package.jdocom/mycompany/sample/package.jdocom/mycompany/sample/MyExample.jdo
In addition to specifying XML MetaData in a jdo file, if defining O/R mapping information you can also split this out into an ORM file. The locations for ORM files are similar in nature to those for JDO files.
META-INF/package-{mapping}.ormWEB-INF/package-{mapping}.ormpackage-{mapping}.ormcom/package-{mapping}.ormcom/mycompany/package-{mapping}.ormcom/mycompany/sample/package-{mapping}.ormcom/mycompany/sample/MyExample-{mapping}.orm
where {mapping} is a property specified by the user and may be "mysql" for ORM information for MySQL datastores, and "oracle" for ORM information for Oracle datastores, and so on.
Annotations
JDO 2.1 provides support for annotations. Classes and fields/properties can be annotated defining the persistence and, optionally, any ORM information.
Be an Apache Software Foundation sponsor
Thanks to ASF sponsors!Documentation published: 06 November 2007
2005-2007 Apache Software Foundation