cmpComponent.getComponentClass().getDeclaredMethod(finderMethod.getName(), finderMethod.getParameterTypes());
return super.invokeFind(context, instance);
} catch (NoSuchMethodException ignored) {
}
final JDBCEntityPersistenceStore store = cmpComponent.getStoreManager();
final CmpEntityBeanContext entityContext = cmpInstance.getEjbContext();
// as per the spec 9.6.4, entities must be synchronized with the datastore when an ejbFind<METHOD> is called.
if (!store.getCmpConfig().isSyncOnCommitOnly()) {
cmpComponent.synchronizeEntitiesWithinTransaction(entityContext.getTransaction());
}
final JDBCQueryCommand.EntityProxyFactory factory = new JDBCQueryCommand.EntityProxyFactory() {
public Object getEntityObject(final Object primaryKey) {
return localHome ? cmpComponent.getEJBLocalObject(primaryKey) : cmpComponent.getEJBObject(primaryKey);
}
};
if (getReturnType() == ReturnType.SINGLE) {
return store.findEntity(context.getMethod(), context.getParameters(), entityContext, factory);
} else {
return store.findEntities(context.getMethod(), context.getParameters(), entityContext, factory);
}
}