You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Craig Russell <Cr...@Sun.COM> on 2005/09/07 18:53:16 UTC

Spec clarification on pm.newInstance object id

Javadogs,

I'd like to clarify the specification for the object-id for instances  
created using pm.newInstance.

Here's the original text, for context.

<spec>
The following method is used to create an instance of a persistence- 
capable interface, or of a concrete or abstract class.
Object newInstance(Class persistenceCapable);
The parameter must be one of the following:
an abstract class that is declared in the metadata using the class  
element, or
an interface that is declared in the metadata using the interface  
element, or
a concrete class that is declared in the metadata as persistence- 
capable. In this case, there must be a public no-args constructor.
The returned instance is transient, and is an “instanceof” the  
parameter. Applications might use the instance via the get and set  
property methods and change its life cycle state exactly as if it  
were an instance of a persistence-capable class.
</spec>

Here's the clarification to be added:

<proposed>
For interfaces and classes that use a SingleFieldIdentity as the  
object-id class, if the returned instance is subsequently made  
persistent, the target class stored in the object-id instance is the  
parameter of the newInstance method that created it.
</proposed>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Spec clarification on pm.newInstance object id

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Wes,

Thank you for nitpicking. It's really important that we get these  
nits removed.

Even better if you open a JIRA and provide a patch.

Craig

On Feb 10, 2006, at 10:30 AM, Wes Biggs wrote:

> More nitpicking.  The jdo2-api javadoc should be updated to reflect  
> that concrete classes may be parameters of  
> PersistenceManager.newInstance(); it currently reads:
>
> java.lang.Object newInstance(java.lang.Class pcClass)
> Creates an instance of a persistence-capable interface or abstract  
> class. The returned instance is transient.
>
> Parameters:
> pcClass - Must be an abstract class or interface that is declared  
> in the metadata.
>
> Regards,
>
> Wes
>
>
> Craig Russell wrote:
>> Javadogs,
>>
>> I'd like to clarify the specification for the object-id for  
>> instances created using pm.newInstance.
>>
>> Here's the original text, for context.
>>
>> <spec>
>> The following method is used to create an instance of a  
>> persistence-capable interface, or of a concrete or abstract class.
>> Object newInstance(Class persistenceCapable);
>> The parameter must be one of the following:
>> an abstract class that is declared in the metadata using the class  
>> element, or
>> an interface that is declared in the metadata using the interface  
>> element, or
>> a concrete class that is declared in the metadata as persistence- 
>> capable. In this case, there must be a public no-args constructor.
>> The returned instance is transient, and is an “instanceof” the  
>> parameter. Applications might use the instance via the get and set  
>> property methods and change its life cycle state exactly as if it  
>> were an instance of a persistence-capable class.
>> </spec>
>>
>> Here's the clarification to be added:
>>
>> <proposed>
>> For interfaces and classes that use a SingleFieldIdentity as the  
>> object-id class, if the returned instance is subsequently made  
>> persistent, the target class stored in the object-id instance is  
>> the parameter of the newInstance method that created it.
>> </proposed>
>>
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!