use of javax.ejb.FinderException in project tomee by apache.
the class JpaCmpEngine method queryBeans.
public List<Object> queryBeans(final BeanContext beanContext, final String signature, final Object[] args) throws FinderException {
final EntityManager entityManager = getEntityManager(beanContext);
Query query = createNamedQuery(entityManager, signature);
if (query == null) {
final int parenIndex = signature.indexOf('(');
if (parenIndex > 0) {
final String shortName = signature.substring(0, parenIndex);
query = createNamedQuery(entityManager, shortName);
}
if (query == null) {
throw new FinderException("No query defined for method " + signature);
}
}
return executeSelectQuery(query, args);
}
use of javax.ejb.FinderException in project tomee by apache.
the class EjbSelect method execute_void.
/**
* Perform a select operation when the return value is
* a void. This one is slightly different from the
* rest, as the container operation performed is an
* update() rather than a select() because there's
* no value to return.
*
* @param obj The ejb object we're executing on behalf of.
* @param methodSignature The signature of the selectxxxx method being invoked.
* @param args The arguments to the select. These need to match
* the method signature.
* @throws FinderException
*/
public static void execute_void(final Object obj, final String methodSignature, final Object... args) throws FinderException {
final BeanContext beanContext = (BeanContext) obj;
final Container container = beanContext.getContainer();
if (!(container instanceof CmpContainer)) {
throw new FinderException("Deployment is not connected to a CmpContainer " + beanContext.getDeploymentID());
}
final CmpContainer cmpContainer = (CmpContainer) container;
cmpContainer.update(beanContext, methodSignature, args);
}
use of javax.ejb.FinderException in project tomee by apache.
the class EjbSelect method execute_short.
public static short execute_short(final Object obj, final String methodSignature, final Object... args) throws FinderException {
final BeanContext beanContext = (BeanContext) obj;
final Container container = beanContext.getContainer();
if (!(container instanceof CmpContainer)) {
throw new FinderException("Deployment is not connected to a CmpContainer " + beanContext.getDeploymentID());
}
final CmpContainer cmpContainer = (CmpContainer) container;
final Number result = (Number) cmpContainer.select(beanContext, methodSignature, "short", args);
return result.shortValue();
}
use of javax.ejb.FinderException in project tomee by apache.
the class EjbSelect method execute_char.
public static char execute_char(final Object obj, final String methodSignature, final Object... args) throws FinderException {
final BeanContext beanContext = (BeanContext) obj;
final Container container = beanContext.getContainer();
if (!(container instanceof CmpContainer)) {
throw new FinderException("Deployment is not connected to a CmpContainer " + beanContext.getDeploymentID());
}
final CmpContainer cmpContainer = (CmpContainer) container;
final Character result = (Character) cmpContainer.select(beanContext, methodSignature, "char", args);
return result.charValue();
}
use of javax.ejb.FinderException in project tomee by apache.
the class EjbSelect method execute_long.
public static long execute_long(final Object obj, final String methodSignature, final Object... args) throws FinderException {
final BeanContext beanContext = (BeanContext) obj;
final Container container = beanContext.getContainer();
if (!(container instanceof CmpContainer)) {
throw new FinderException("Deployment is not connected to a CmpContainer " + beanContext.getDeploymentID());
}
final CmpContainer cmpContainer = (CmpContainer) container;
final Number result = (Number) cmpContainer.select(beanContext, methodSignature, "long", args);
return result.longValue();
}
Aggregations