Package javax.ejb

Examples of javax.ejb.FinderException


                }
            } finally {
                con.close();
            }
        } catch (final Exception e) {
            throw new FinderException("FindByPrimaryKey failed");
        }

        if (found) return primaryKey;
        else throw new javax.ejb.ObjectNotFoundException();
    }
View Full Code Here


            boolean isSingleValued = !returnType.equals("java.util.Collection") && !returnType.equals("java.util.Set");
            ProxyFactory proxyFactory = null;
            for (Object value : results) {
                // if this is a single valued query and we already have results, throw FinderException
                if (isSingleValued && !proxies.isEmpty()) {
                    throw new FinderException("The single valued query " + methodSignature + "returned more than one item");
                }

                // if we have an EntityBean, we need to proxy it
                if (value instanceof EntityBean) {
                    EntityBean entityBean = (EntityBean) value;
View Full Code Here

        String fullName = queryName.toString();
        Query query = createNamedQuery(entityManager, fullName);
        if (query == null) {
            query = createNamedQuery(entityManager, shortName);
            if (query == null) {
                throw new FinderException("No query defined for method " + fullName);
            }
        }
        return executeQuery(query, args);
    }
View Full Code Here

            if (parenIndex > 0) {
                String shortName = signature.substring(0, parenIndex);
                query = createNamedQuery(entityManager, shortName);
            }
            if (query == null) {
                throw new FinderException("No query defined for method " + signature);
            }
        }
        return executeQuery(query, args);
    }
View Full Code Here

public class EjbSelect {
    public static Object execute(Object di, String methodSignature, String returnType, Object... args) throws FinderException {
        DeploymentInfo deploymentInfo = (DeploymentInfo) di;
        Container container = deploymentInfo.getContainer();
        if (!(container instanceof CmpContainer)) {
            throw new FinderException("Deployment is not connected to a CmpContainer " + deploymentInfo.getDeploymentID());
        }
        CmpContainer cmpContainer = (CmpContainer) container;
        Object result = cmpContainer.select(deploymentInfo, methodSignature, returnType, args);
        if (result instanceof Number) {
            Number number = (Number) result;
View Full Code Here

            statement = assembly.createStatement(connection);

            set = statement.executeQuery();

            if (!set.next())
                throw new FinderException("Person #" + personId + " does not exist.");

            Object[] columns = new Object[Person.N_COLUMNS];
            result = convertRowToPerson(set, columns);

        }
View Full Code Here

            statement = assembly.createStatement(connection);

            set = statement.executeQuery();

            if (!set.next())
                throw new FinderException("Book " + bookId + " does not exist.");

            Object[] columns = new Object[Book.N_COLUMNS];
            result = convertRowToBook(set, columns);

        }
View Full Code Here

     */
    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);
    }
View Full Code Here

     */
    public static Object execute_Object(final Object obj, final String methodSignature, final String returnType, 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;

        return cmpContainer.select(beanContext, methodSignature, returnType, args);
    }
View Full Code Here

    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();
View Full Code Here

TOP

Related Classes of javax.ejb.FinderException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.