BEA Systems, Inc.

com.beasys.commerce.axiom.document
Class SPIDocumentSmartBMP

java.lang.Object
  |
  +--com.beasys.commerce.axiom.document.SPIDocumentSmartBMP

public class SPIDocumentSmartBMP
extends java.lang.Object
implements SmartBMP

A DocumentImpl SmartBMP which can utilize the SPI JDBC driver to get documents and metadata.

Since:
2.0

Constructor Summary
SPIDocumentSmartBMP()
           
 
Method Summary
 void close(java.sql.Connection con)
          Helper method to close a connection, ignoring any exceptions.
static void close(DocumentIterator iterator)
          Close a document iterator, ignoring any exceptions.
static void close(java.sql.Statement stmt)
          Helper method to close a statement, ignoring any sql exceptions.
 void create(SmartKey smartKey, EntityImpl entityImpl)
          Implements BMP functionality of ejbCreate() method.
 boolean exists(SmartKey smartKey, EntityImpl impl)
          Indicates if a bean with the specified primary key exists in the persistent store.
 java.util.Enumeration findAll(EntityImpl impl)
          Implements BMP functionality of ejbFindAll() method.
 java.util.Enumeration findBySearchParams(Search params, EntityImpl impl)
          Services the findBySearchParams method on the Document bean.
protected static java.sql.Connection getConnection(EntityImpl impl)
          Get a connection form the "/jdbc/docPool" environment DataSource of the specified entity.
 byte[] getContent(java.lang.String identifier, EntityImpl impl)
          Services the getContent method on the Document bean.
 void refresh(SmartKey smartKey, EntityImpl entityImpl)
          Implements BMP functionality of ejbLoad() method.
 void remove(SmartKey smartKey)
          Implements BMP functionality of ejbRemove() method.
 void remove(SmartKey key, EntityImpl impl)
          Implements BMP functionality of ejbRemove() method.
 void update(SmartKey smartKey, EntityImpl entityImpl)
          Implements BMP functionality of ejbStore() and ejbPostCreate() methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPIDocumentSmartBMP

public SPIDocumentSmartBMP()
Method Detail

getConnection

protected static java.sql.Connection getConnection(EntityImpl impl)
                                            throws BMPException
Get a connection form the "/jdbc/docPool" environment DataSource of the specified entity.

create

public void create(SmartKey smartKey,
                   EntityImpl entityImpl)
            throws BMPException
Implements BMP functionality of ejbCreate() method.

Initialize the representation of the entity bean in persistent store using the smartKey as primary key. Attributes of the entity bean in persistent store should be set to the implementation's equivalent of default or null values.

The entity is invalid at this point. The metadata may be useful to the implementation.

This method always throws a BMPException.

Specified by:
create in interface SmartBMP
Parameters:
smartKey - the primary key of the bean
entityImpl - READ ONLY, invalid, uninitialized instance of the entity bean.
Throws:
BMPException - wrapper for provider exception

refresh

public void refresh(SmartKey smartKey,
                    EntityImpl entityImpl)
             throws BMPException
Implements BMP functionality of ejbLoad() method. Copies attributes from persistent store to the entity bean using the smartKey as primary key.
Specified by:
refresh in interface SmartBMP
Parameters:
smartKey - the primary key of the bean
entityImpl - READ/WRITE instance of the entity bean.
Throws:
BMPException - wrapper for provider exception

update

public void update(SmartKey smartKey,
                   EntityImpl entityImpl)
            throws BMPException
Implements BMP functionality of ejbStore() and ejbPostCreate() methods. Copies attributes of entity bean to persistent store using the smartKey as primary key.

This implementation does nothing.

Specified by:
update in interface SmartBMP
Parameters:
smartKey - the primary key of the bean
entityImpl - READ ONLY instance of the entity bean.
Throws:
BMPException - wrapper for provider exception

remove

public void remove(SmartKey smartKey)
            throws BMPException
Implements BMP functionality of ejbRemove() method. Remove the entity bean from persistent store using the smartKey as primary key.

This implementation does nothing.

Parameters:
smartKey - the primary key of the bean
Throws:
BMPException - wrapper for provider exception

remove

public void remove(SmartKey key,
                   EntityImpl impl)
            throws BMPException
Implements BMP functionality of ejbRemove() method. Remove the entity bean from persistent store using the smartKey as primary key.

This implementation does nothing.

Specified by:
remove in interface SmartBMP
Parameters:
smartKey - the primary key of the bean
impl - READ ONLY instance of the entity bean.
Throws:
BMPException - wrapper for provider exception

exists

public boolean exists(SmartKey smartKey,
                      EntityImpl impl)
               throws BMPException
Indicates if a bean with the specified primary key exists in the persistent store.
Specified by:
exists in interface SmartBMP
Parameters:
smartKey - the primary key of the bean
impl - READ ONLY instance of the entity bean.
Returns:
true if a bean with the specified primary key exists
Throws:
BMPException - wrapper for provider exception

findAll

public java.util.Enumeration findAll(EntityImpl impl)
                              throws BMPException
Implements BMP functionality of ejbFindAll() method.

This method returns an empty Enumeration.

Specified by:
findAll in interface SmartBMP
Parameters:
impl - an instance of the entity bean.
Returns:
an enumeration of all instances of a type of bean.
Throws:
BMPException - wrapper for provider exception

findBySearchParams

public java.util.Enumeration findBySearchParams(Search params,
                                                EntityImpl impl)
                                         throws BMPException
Services the findBySearchParams method on the Document bean.
Parameters:
params - the search parameters.
impl - an instance of the entity bean.
Returns:
Enumeration of the primary keys of the beans matching the Seacrh parameters.
Throws:
BMPException - wrapper for provider exception

getContent

public byte[] getContent(java.lang.String identifier,
                         EntityImpl impl)
                  throws BMPException
Services the getContent method on the Document bean.
Parameters:
identifier - the identifier (primary key) of a Document object
impl - the DocumentImpl object to execute for
Returns:
byte[] the content of the document
Throws:
BMPException - wrapper for provider exception

close

public static final void close(java.sql.Statement stmt)
Helper method to close a statement, ignoring any sql exceptions.

close

public static final void close(DocumentIterator iterator)
Close a document iterator, ignoring any exceptions.

close

public final void close(java.sql.Connection con)
Helper method to close a connection, ignoring any exceptions.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved