Class JDOEJB11HelperImpl
java.lang.Object
com.sun.jdo.spi.persistence.support.ejb.cmp.JDOEJB11HelperImpl
- All Implemented Interfaces:
com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
- Direct Known Subclasses:
JDOEJB20HelperImpl
public abstract class JDOEJB11HelperImpl
extends Object
implements com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final com.sun.jdo.spi.persistence.utility.logging.Loggerprotected static final ResourceBundleI18N message handler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidValidates that this instance is of the correct implementation class of a remote interface type.protected voidassertInstanceOfRemoteInterfaceImpl(Object o, String beanName) Validates that this instance is of the correct implementation class of bean remote interface.protected voidValidates that the object id instance is not null.voidassertPrimaryKeyFieldNotNull(Object pkfield, String pkfieldName, String beanName) Validates that the primary key field of an Object type is not null.protected voidValidates that the primary key instance is not null.convertCollectionEJBObjectToPC(Collection coll, com.sun.jdo.api.persistence.support.PersistenceManager pm, boolean validate) Converts Collection of EJBObjects to a Collection of persistence-capable instances.Converts Collection of Object Id's of persistence-capable instances to a Collection of of the PrimaryKey instances.convertCollectionPCToEJBObject(Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts Collection of persistence-capable instances to a Collection of EJBObjects.convertCollectionPCToEJBObjectSet(Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts Collection of persistence-capable instances to a Set of EJBObjects.convertCollectionPCToPrimaryKey(Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts Collection of persistence-capable instances to a Collection of the PrimaryKey Class instances.Converts Collection of PrimaryKey instances to a Collection of Object Id's of a corresponding persistence-capable Class.convertEJBObjectToPC(jakarta.ejb.EJBObject o, com.sun.jdo.api.persistence.support.PersistenceManager pm, boolean validate) Converts EJBObject to persistence-capable instance.abstract ObjectconvertObjectIdToPrimaryKey(Object objectId) Converts Object Id of a persistence-capable instance to an instance of the PrimaryKey Class.jakarta.ejb.EJBObjectconvertPCToEJBObject(Object pc, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts persistence-capable instance to EJBObject.convertPCToPrimaryKey(Object pc, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts persistence-capable instance to an instance of the PrimaryKey Class.abstract ObjectConverts instance of a PrimaryKey Class to an instance of the Object Id of a corresponding persistence-capable Class.protected ObjectconvertPrimaryKeyToPC(Object key, com.sun.jdo.api.persistence.support.PersistenceManager pm, boolean validate) Converts PrimaryKey object to persistence-capable instance.com.sun.jdo.spi.persistence.support.sqlstore.utility.NumericConverterReturn NumericConverter for conversion from Number to BigDecimal or BigInteger for this bean type.abstract ClassReturns the class object of the corresponding persistence-capable class of the concrete bean class.readSerializableObjectFromByteArray(byte[] byteArray) Constructs a Serializable object from byteArray.byte[]writeSerializableObjectToByteArray(Serializable serializableObject) Serializes serializableObject into a byte arrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
getContainer
-
Field Details
-
messages
I18N message handler -
logger
protected static final com.sun.jdo.spi.persistence.utility.logging.Logger logger
-
-
Constructor Details
-
JDOEJB11HelperImpl
public JDOEJB11HelperImpl()
-
-
Method Details
-
convertPCToEJBObject
public jakarta.ejb.EJBObject convertPCToEJBObject(Object pc, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts persistence-capable instance to EJBObject.- Specified by:
convertPCToEJBObjectin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
pc- the persistence-capable instance to be converted as an Object.pm- the associated instance of PersistenceManager.- Returns:
- instance of EJBObject.
-
convertEJBObjectToPC
public Object convertEJBObjectToPC(jakarta.ejb.EJBObject o, com.sun.jdo.api.persistence.support.PersistenceManager pm, boolean validate) Converts EJBObject to persistence-capable instance.- Specified by:
convertEJBObjectToPCin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
o- the EJBObject instance to be converted.pm- the associated instance of PersistenceManager.validate- true if the existence of the instance is to be validated.- Returns:
- persistence-capable instance.
- Throws:
IllegalArgumentException- if validate is true and instance does not exist in the database or is deleted.
-
convertPrimaryKeyToPC
protected Object convertPrimaryKeyToPC(Object key, com.sun.jdo.api.persistence.support.PersistenceManager pm, boolean validate) Converts PrimaryKey object to persistence-capable instance.- Parameters:
key- the PrimaryKey object to be converted.pm- the associated instance of PersistenceManager.validate- true if the existence of the instance is to be validated.- Returns:
- persistence-capable instance.
- Throws:
IllegalArgumentException- if validate is true and instance does not exist in the database or is deleted.
-
convertCollectionPCToEJBObject
public Collection convertCollectionPCToEJBObject(Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts Collection of persistence-capable instances to a Collection of EJBObjects.- Specified by:
convertCollectionPCToEJBObjectin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
pcs- the Collection of persistence-capable instance to be converted.pm- the associated instance of PersistenceManager.- Returns:
- Collection of EJBObjects.
-
convertCollectionPCToEJBObjectSet
public Set convertCollectionPCToEJBObjectSet(Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts Collection of persistence-capable instances to a Set of EJBObjects.- Specified by:
convertCollectionPCToEJBObjectSetin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
pcs- the Collection of persistence-capable instance to be converted.pm- the associated instance of PersistenceManager.- Returns:
- Set of EJBObjects.
-
convertCollectionEJBObjectToPC
public Collection convertCollectionEJBObjectToPC(Collection coll, com.sun.jdo.api.persistence.support.PersistenceManager pm, boolean validate) Converts Collection of EJBObjects to a Collection of persistence-capable instances.- Specified by:
convertCollectionEJBObjectToPCin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
coll- the Collection of EJBObject instances to be converted.pm- the associated instance of PersistenceManager.validate- true if the existence of the instances is to be validated.- Returns:
- Collection of persistence-capable instance.
- Throws:
IllegalArgumentException- if validate is true and at least one instance does not exist in the database or is deleted.
-
convertPCToPrimaryKey
public Object convertPCToPrimaryKey(Object pc, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts persistence-capable instance to an instance of the PrimaryKey Class.- Specified by:
convertPCToPrimaryKeyin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
pc- the persistence-capable instance to be converted as an Object.pm- the associated instance of PersistenceManager.- Returns:
- instance of the PrimaryKey Class.
-
convertCollectionPCToPrimaryKey
public Collection convertCollectionPCToPrimaryKey(Collection pcs, com.sun.jdo.api.persistence.support.PersistenceManager pm) Converts Collection of persistence-capable instances to a Collection of the PrimaryKey Class instances.- Specified by:
convertCollectionPCToPrimaryKeyin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
pcs- Collection of the persistence-capable instances.pm- the associated instance of PersistenceManager.- Returns:
- Collection of the PrimaryKey Class instances.
-
convertObjectIdToPrimaryKey
Converts Object Id of a persistence-capable instance to an instance of the PrimaryKey Class.- Specified by:
convertObjectIdToPrimaryKeyin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
objectId- the Object Id to be converted.- Returns:
- instance of the PrimaryKey Class.
-
convertPrimaryKeyToObjectId
Converts instance of a PrimaryKey Class to an instance of the Object Id of a corresponding persistence-capable Class.- Specified by:
convertPrimaryKeyToObjectIdin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
key- the PrimaryKey instance to be converted.- Returns:
- instance of the Object Id.
-
convertCollectionObjectIdToPrimaryKey
Converts Collection of Object Id's of persistence-capable instances to a Collection of of the PrimaryKey instances.- Specified by:
convertCollectionObjectIdToPrimaryKeyin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
oids- Collection of the Object Id to be converted.- Returns:
- Collection of of the PrimaryKey Class instances.
-
convertCollectionPrimaryKeyToObjectId
Converts Collection of PrimaryKey instances to a Collection of Object Id's of a corresponding persistence-capable Class.- Specified by:
convertCollectionPrimaryKeyToObjectIdin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
keys- Collection of the PrimaryKey instances to be converted.- Returns:
- Collection of the Object Id's.
-
writeSerializableObjectToByteArray
Serializes serializableObject into a byte array- Specified by:
writeSerializableObjectToByteArrayin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
serializableObject- Instance of a Serializable Object- Returns:
- serializableObject serialized into a byte array
-
readSerializableObjectFromByteArray
Constructs a Serializable object from byteArray. It is expected that byteArray was constructed using a previous call to writeSerializableObjectToByteArray- Specified by:
readSerializableObjectFromByteArrayin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
byteArray- Array of byte obtained from a call to writeSerializableObjectToByteArray- Returns:
- A Serializable object contructed from byteArray
- See Also:
-
getNumericConverter
public com.sun.jdo.spi.persistence.support.sqlstore.utility.NumericConverter getNumericConverter()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.- Specified by:
getNumericConverterin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Returns:
- NumericConverter for given object policy
-
getPCClass
Returns the class object of the corresponding persistence-capable class of the concrete bean class.- Specified by:
getPCClassin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Returns:
- the pc class object
-
assertInstanceOfRemoteInterfaceImpl
Validates that this instance is of the correct implementation class of a remote interface type.- Specified by:
assertInstanceOfRemoteInterfaceImplin interfacecom.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper- Parameters:
o- the instance to validate.- Throws:
IllegalArgumentException- if validation fails.
-
assertInstanceOfRemoteInterfaceImpl
Validates that this instance is of the correct implementation class of bean remote interface. Throws IllegalArgumentException if the argument is of a wrong type.- Parameters:
o- the instance to validate.beanName- as String.- Throws:
IllegalArgumentException- if validation fails.
-
assertPrimaryKeyNotNull
Validates that the primary key instance is not null. Throws IllegalArgumentException otherwise.- Parameters:
pk- the primary key instance to validate.- Throws:
IllegalArgumentException- if validation fails.
-
assertPrimaryKeyFieldNotNull
Validates that the primary key field of an Object type is not null. Throws IllegalArgumentException otherwise.- Parameters:
pkfield- the primary key field instance to validate.pkfieldName- the primary key field name.beanName- the EJB name.- Throws:
IllegalArgumentException- if validation fails.
-
assertObjectIdNotNull
Validates that the object id instance is not null. Throws JDOFatalInternalException otherwise.- Parameters:
oid- the object id instance to validate.- Throws:
com.sun.jdo.api.persistence.support.JDOFatalInternalException- if validation fails.
-