Here is my proposal for the discussion in the JDO TCK conference call. I
try to address the use of a persistence-capable interface as the type of
a field or property used by a query and as the candidate class of a query.
<proposal>
If the metadata for a persistence-capable interface indicates (via the
explicit or implicit setting of the requires-extent attribute) that an
extent is managed for the interface, then the extent consists of the
datastore objects of the persistence-capable classes implementing the
interface including the datastore objects created with
PersistenceManager.newInstance.
The candidate class of a JDOQL query may be a persistence-capable
interface. In this case the candidate class name scope includes the
persistent properties as defined in the metadata of the
persistence-capable interface. JDOQL supports navigation through a field
or property of the type of a persistence-capable interface. Such an
expression may then be further decomposed in order to access a
persistent properties defined in the metadata of the persistence-capable
interface.
</proposal>
Another remark:
Section18.3 ELEMENT interface says: "The requires-extent attribute is
optional. If set to "false", the JDO implementation does not need to
support extents of factory-made persistent instances."
I understand that "factory-made persistent instances" refers to
instances created by PM.newInstance. Then I propose to remove
"factory-made", because the extent of a persistence-capable interface
may consist of the extents of the persistence-capable classes
implementing the interface and then there are no "factory-made"
persistence instances are involved.
Regards Michael
There are three scenarios for using persistent interfaces:
- as the parameter of the PersistenceManager.newInstance method
- as the type of a field or property of a persistent interface or class
- as the type of a field or property used by a query
I'd like to discuss the following in tomorrow's conference call.
The PersistenceManager.newInstance method discusses requirements if
the parameter is a persistent interface, but it's incomplete.
<spec>
In order for the newInstance method to be used, the parameter
interface must be completely mapped. For relational implementations,
the interface must be mapped to a table and all persistent properties
must be mapped to columns. Additionally, interfaces that are the
targets of all relationships from persistent properties must also be
mapped. Otherwise, JDOUserException is thrown by the newInstance method.
</spec>
I'd like to clarify it a bit:
<proposed>
In order for the newInstance method to be used with a persistent
interface, the parameter interface must be completely mapped. That
is, the interface must be declared in metadata using the interface
element.
Additionally, for relational implementations,
o the interface must be mapped to a table; portable applications will
use the table attribute for this purpose
o all persistent properties must be mapped to columns; portable
applications will use the column attribute of the property element
contained in the interface element
o interfaces that are of types of relationships declared as persistent
properties of the parameter interface must all be completely mapped
If any of the above conditions is not met, JDOUserException is thrown
by the newInstance method.
</proposed>
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!
--
[EMAIL PROTECTED] Engineering GmbH Tel.: +49/(0)30/235 520-33
Buelowstr. 66 Fax.: +49/(0)30/217 520-12
10783 Berlin mailto:[EMAIL PROTECTED]
Geschaeftsfuehrung: Dr. Gerhard Mueller-Proefrock
Anna-Kristin Proefrock
Sitz Berlin, Amtsgericht Charlottenburg, HRB 564 52