FileDocCategorySizeDatePackage
JDOEJB11Helper.javaAPI DocGlassfish v2 API8702Fri May 04 22:35:04 BST 2007com.sun.jdo.spi.persistence.support.sqlstore.ejb

JDOEJB11Helper

public interface JDOEJB11Helper
This is the helper interface for conversion of persistence-capable instances to and from EJB objects of type: EJBObject, PrimaryKey, and Collections of those. This interface is generic for CMP1.1 and CMP2.0.
author
Marina Vatkina

Fields Summary
Constructors Summary
Methods Summary
public voidassertInstanceOfRemoteInterfaceImpl(java.lang.Object o)
Validates that this instance is of the correct implementation class of a remote interface type.

param
o the instance to validate.
return
true if the type is correct.
throw
IllegalArgumentException if validation fails.

public java.util.CollectionconvertCollectionEJBObjectToPC(java.util.Collection coll, com.sun.jdo.api.persistence.support.PersistenceManager pm, boolean validate)
Converts Collection of EJBObjects to a Collection of persistence-capable instances.

param
coll the Collection of EJBObject instances to be converted.
param
pm the associated instance of PersistenceManager.
param
validate true if the existence of the instances is to be validated.
return
Collection of persistence-capable instance.
throw
IllegalArgumentException if validate is true and at least one instance does not exist in the database or is deleted.

public java.util.CollectionconvertCollectionObjectIdToPrimaryKey(java.util.Collection oids)
Converts Collection of Object Id's of persistence-capable instances to a Collection of of the PrimaryKey instances.

param
oids Collection of the Object Id to be converted.
return
Collection of of the PrimaryKey Class instances.

public java.util.CollectionconvertCollectionPCToEJBObject(java.util.Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm)
Converts Collection of persistence-capable instances to a Collection of EJBObjects.

param
pcs the Collection of persistence-capable instance to be converted.
param
pm the associated instance of PersistenceManager.
return
Collection of EJBObjects.

public java.util.SetconvertCollectionPCToEJBObjectSet(java.util.Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm)
Converts Collection of persistence-capable instances to a Set of EJBObjects.

param
pcs the Collection of persistence-capable instance to be converted.
param
pm the associated instance of PersistenceManager.
return
Set of EJBObjects.

public java.util.CollectionconvertCollectionPCToPrimaryKey(java.util.Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm)
Converts Collection of persistence-capable instances to a Collection of the PrimaryKey Class instances.

param
pcs Collection of the persistence-capable instances.
param
pm the associated instance of PersistenceManager.
return
Collection of the PrimaryKey Class instances.

public java.util.CollectionconvertCollectionPrimaryKeyToObjectId(java.util.Collection key)
Converts Collection of PrimaryKey instances to a Collection of Object Id's of a corresponding persistence-capable Class.

param
keys Collection of the PrimaryKey instances to be converted.
return
Collection of the Object Id's.

public java.lang.ObjectconvertEJBObjectToPC(javax.ejb.EJBObject o, com.sun.jdo.api.persistence.support.PersistenceManager pm, boolean validate)
Converts EJBObject to persistence-capable instance.

param
o the EJBObject instance to be converted.
param
pm the associated instance of PersistenceManager.
param
validate true if the existence of the instance is to be validated.
return
persistence-capable instance.
throw
IllegalArgumentException if validate is true and instance does not exist in the database or is deleted.

public java.lang.ObjectconvertObjectIdToPrimaryKey(java.lang.Object objectId)
Converts Object Id of a persistence-capable instance to an instance of the PrimaryKey Class.

param
objectId the Object Id to be converted.
return
instance of the PrimaryKey Class.

public javax.ejb.EJBObjectconvertPCToEJBObject(java.lang.Object pc, com.sun.jdo.api.persistence.support.PersistenceManager pm)
Converts persistence-capable instance to EJBObject.

param
pc the persistence-capable instance to be converted as an Object.
param
pm the associated instance of PersistenceManager.
return
instance of EJBObject.

public java.lang.ObjectconvertPCToPrimaryKey(java.lang.Object pc, com.sun.jdo.api.persistence.support.PersistenceManager pm)
Converts persistence-capable instance to an instance of the PrimaryKey Class.

param
pc the persistence-capable instance to be converted as an Object.
param
pm the associated instance of PersistenceManager.
return
instance of the PrimaryKey Class.

public java.lang.ObjectconvertPrimaryKeyToObjectId(java.lang.Object key)
Converts instance of a PrimaryKey Class to an instance of the Object Id of a corresponding persistence-capable Class.

param
key the PrimaryKey instance to be converted.
return
instance of the Object Id.

public java.lang.ObjectgetContainer()
Returns Container object associated with the corresponding concrete bean class.

return
a Container object.

public com.sun.jdo.spi.persistence.support.sqlstore.utility.NumericConvertergetNumericConverter()
Return NumericConverter for conversion from Number to BigDecimal or BigInteger for this bean type. It is responsible for passing the correct policy value to the NumericConverterFactory.

return
NumericConverter for given object policy

public java.lang.ClassgetPCClass()
Returns the class object of the corresponding persistence-capable class of the concrete bean class.

return
the pc class object

public java.io.SerializablereadSerializableObjectFromByteArray(byte[] byteArray)
Constructs a Serializable object from byteArray. It is expected that byteArray was constructed using a previous call to writeSerializableObjectToByteArray

param
byteArray Array of byte obtained from a call to writeSerializableObjectToByteArray
return
A Serializable object contructed from byteArray
see
#writeSerializableObjectToByteArray(Serializable)

public byte[]writeSerializableObjectToByteArray(java.io.Serializable serializableObject)
Serializes serializableObject into a byte array

param
serializableObject Instance of a Serializable Object
return
serializableObject serialized into a byte array