JDO metadata must be available both during class enhancement and at runtime. The metadata document listing a persistence-capable class must be available as a resource from the class' class loader, and must exist in one of two standard locations:
In a resource called class-name.jdo, where class-name is the name of the class the document applies to, without package name. The resource must be located in the same package as the class.
In a resource called package-name.jdo, where package-name is the last token of the package's full name. The resource should be placed in the corresponding package, or in the package's parent package. Package-level documents should contain the metadata for all the persistence-capable classes in the package, except those classes that have individual class-name.jdo resources associated with them.
org/mag/Magazine.jdo
org/mag/mag.jdo
org/mag.jdo
![]() | Note |
---|---|
Some JDO implementations may not support all of the metadata placements discussed, or may support additional placements. Kodo JDO supports the standard metadata locations listed as well as a package-level resource called package.jdo and a system.jdo resource defining the metadata for the entire system, located in any top-level directory of the CLASSPATH. |