Class 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 Detail

      • messages

        protected static final ResourceBundle messages
        I18N message handler
      • logger

        protected static final com.sun.jdo.spi.persistence.utility.logging.Logger logger
    • Constructor Detail

      • JDOEJB11HelperImpl

        public JDOEJB11HelperImpl()
    • Method Detail

      • convertPCToEJBObject

        public jakarta.ejb.EJBObject convertPCToEJBObject​(Object pc,
                                                          com.sun.jdo.api.persistence.support.PersistenceManager pm)
        Converts persistence-capable instance to EJBObject.
        Specified by:
        convertPCToEJBObject in interface com.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:
        convertEJBObjectToPC in interface com.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:
        convertCollectionPCToEJBObject in interface com.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:
        convertCollectionPCToEJBObjectSet in interface com.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:
        convertCollectionEJBObjectToPC in interface com.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:
        convertPCToPrimaryKey in interface com.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:
        convertCollectionPCToPrimaryKey in interface com.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

        public abstract Object convertObjectIdToPrimaryKey​(Object objectId)
        Converts Object Id of a persistence-capable instance to an instance of the PrimaryKey Class.
        Specified by:
        convertObjectIdToPrimaryKey in interface com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
        Parameters:
        objectId - the Object Id to be converted.
        Returns:
        instance of the PrimaryKey Class.
      • convertPrimaryKeyToObjectId

        public abstract Object convertPrimaryKeyToObjectId​(Object key)
        Converts instance of a PrimaryKey Class to an instance of the Object Id of a corresponding persistence-capable Class.
        Specified by:
        convertPrimaryKeyToObjectId in interface com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
        Parameters:
        key - the PrimaryKey instance to be converted.
        Returns:
        instance of the Object Id.
      • convertCollectionObjectIdToPrimaryKey

        public Collection convertCollectionObjectIdToPrimaryKey​(Collection oids)
        Converts Collection of Object Id's of persistence-capable instances to a Collection of of the PrimaryKey instances.
        Specified by:
        convertCollectionObjectIdToPrimaryKey in interface com.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

        public Collection convertCollectionPrimaryKeyToObjectId​(Collection keys)
        Converts Collection of PrimaryKey instances to a Collection of Object Id's of a corresponding persistence-capable Class.
        Specified by:
        convertCollectionPrimaryKeyToObjectId in interface com.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

        public byte[] writeSerializableObjectToByteArray​(Serializable serializableObject)
        Serializes serializableObject into a byte array
        Specified by:
        writeSerializableObjectToByteArray in interface com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
        Parameters:
        serializableObject - Instance of a Serializable Object
        Returns:
        serializableObject serialized into a byte array
      • readSerializableObjectFromByteArray

        public Serializable readSerializableObjectFromByteArray​(byte[] byteArray)
        Constructs a Serializable object from byteArray. It is expected that byteArray was constructed using a previous call to writeSerializableObjectToByteArray
        Specified by:
        readSerializableObjectFromByteArray in interface com.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:
        writeSerializableObjectToByteArray(Serializable)
      • 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:
        getNumericConverter in interface com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
        Returns:
        NumericConverter for given object policy
      • getPCClass

        public abstract Class getPCClass()
        Returns the class object of the corresponding persistence-capable class of the concrete bean class.
        Specified by:
        getPCClass in interface com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
        Returns:
        the pc class object
      • assertInstanceOfRemoteInterfaceImpl

        public abstract void assertInstanceOfRemoteInterfaceImpl​(Object o)
        Validates that this instance is of the correct implementation class of a remote interface type.
        Specified by:
        assertInstanceOfRemoteInterfaceImpl in interface com.sun.jdo.spi.persistence.support.sqlstore.ejb.JDOEJB11Helper
        Parameters:
        o - the instance to validate.
        Throws:
        IllegalArgumentException - if validation fails.
      • assertInstanceOfRemoteInterfaceImpl

        protected void assertInstanceOfRemoteInterfaceImpl​(Object o,
                                                           String beanName)
        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

        protected void assertPrimaryKeyNotNull​(Object pk)
        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

        public void assertPrimaryKeyFieldNotNull​(Object pkfield,
                                                 String pkfieldName,
                                                 String beanName)
        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

        protected void assertObjectIdNotNull​(Object oid)
        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.