java data jdo

來源:互聯網
上載者:User
General
  • Home
  • Why JDO?
  • JDO v JPA
  • JDO v JPA : API
  • JDO v JPA : ORM
  • Downloads
  • License
JDO Implementation
  • Specifications
  • TCK
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

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.