org.jboss.ejb.plugins.cmp.jdbc
Class JDBCLoadEntityCommand

java.lang.Object
  extended byorg.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand

public final class JDBCLoadEntityCommand
extends java.lang.Object

JDBCLoadEntityCommand loads the data for an instance from the table. This command implements specified eager loading. For CMP 2.x, the entity can be configured to only load some of the fields, which is helpful for entitys with lots of data.


Constructor Summary
JDBCLoadEntityCommand(JDBCStoreManager (src)  manager)
           
 
Method Summary
 boolean execute(EntityEnterpriseContext (src)  ctx, boolean failIfNotFound)
          Loads entity.
 void execute(JDBCCMPFieldBridge (src)  requiredField, EntityEnterpriseContext (src)  ctx)
          Loads entity or required field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCLoadEntityCommand

public JDBCLoadEntityCommand(JDBCStoreManager (src)  manager)
                      throws DeploymentException (src) 
Method Detail

execute

public boolean execute(EntityEnterpriseContext (src)  ctx,
                       boolean failIfNotFound)
Loads entity. If failIfNotFound is true and entity wasn't found then NoSuchEntityException is thrown. Otherwise, if entity wasn't found, returns false. If entity was loaded successfully return true.

Parameters:
ctx - - entity context;
failIfNotFound - - whether to fail if entity wasn't found;
Returns:
true if entity was loaded, false - otherwise.

execute

public void execute(JDBCCMPFieldBridge (src)  requiredField,
                    EntityEnterpriseContext (src)  ctx)
Loads entity or required field. If entity not found throws NoSuchEntityException.

Parameters:
requiredField - - required field or null;
ctx - - the corresponding context;