Package org.glassfish.ejb.deployment.descriptor

Examples of org.glassfish.ejb.deployment.descriptor.QueryDescriptor


        PersistenceDescriptor desc = ((EjbCMPEntityDescriptor)ejbDesc).getPersistenceDescriptor();
       
        for (Iterator it = desc.getQueriedMethods().iterator(); it.hasNext();) {
            MethodDescriptor method = (MethodDescriptor) it.next();
            try {
                QueryDescriptor qDesc = desc.getQueryFor(method);
                query = qDesc.getQuery();
               
                if (qDesc.getIsEjbQl()) {
                    Method m = method.getMethod(ejbDesc);

                    int retypeMapping = mapRetType(qDesc.getReturnTypeMapping());
       
                    boolean finder = false;

                    if ((method.getName()).startsWith("find")) {
                       finder = true;
View Full Code Here


      Class c = Class.forName(home, false, getVerifierContext().getClassLoader());
      Method methods[] = c.getDeclaredMethods();
     
      for (int i=0; i< methods.length; i++) {
          if (methods[i].getName().startsWith("find") && !(methods[i].getName()).equals(FINDBYPRIMARYKEY)) {
        QueryDescriptor query = pers.getQueryFor(new MethodDescriptor(methods[i], methodIntf));
        if (query != null) {
            if (query.getQuery() != null && !"".equals(query.getQuery())) {
                result.addGoodDetails(smh.getLocalString
              ("tests.componentNameConstructor",
               "For [ {0} ]",
               new Object[] {compName.toString()}));
          result.addGoodDetails(smh.getLocalString
View Full Code Here

                    for (int i=0;i<mParms.length;i++) {
                        if (!mParms[i].getName().equals(queryParms[i]))
                            same=false;                   
                    }
                    if (same) {
                        QueryDescriptor qd = descriptor.getPersistenceDescriptor().getQueryFor(queryMethod);
                        String query = qd.getQuery();
                        if (query == null && qd.getSQL()==null) {
          result.addErrorDetails(smh.getLocalString
               ("tests.componentNameConstructor",
          "For [ {0} ]",
          new Object[] {compName.toString()}));
                            result.addErrorDetails(smh.getLocalString
View Full Code Here

   * @return a boolean representing the prefetch setting
   */
  public boolean isQueryPrefetchEnabled (Method method)
  {
    boolean enabled = true;
    QueryDescriptor queryDescriptor = getQueryDescriptor(method);

    if (queryDescriptor != null)
    {
      IASEjbCMPEntityDescriptor cmpDescriptor =
        (IASEjbCMPEntityDescriptor)getDescriptor();
      PrefetchDisabledDescriptor pdDescriptor =
        cmpDescriptor.getPrefetchDisabledDescriptor();

      if (pdDescriptor != null)
      {
        MethodDescriptor methodDescriptor =
          queryDescriptor.getQueryMethodDescriptor();

        enabled = !pdDescriptor.isPrefetchDisabledFor(
          methodDescriptor);
      }
    }
View Full Code Here

   * query string
   * @return a query string for the specified method
   */
  public String getQueryString (Method method)
  {
    QueryDescriptor queryDescriptor = getQueryDescriptor(method);

    return ((queryDescriptor != null) ? queryDescriptor.getQuery() : null);
  }
View Full Code Here

   * @return the return type for the specified method, one of
   * {@link #LOCAL_RETURN}, {@link #REMOTE_RETURN}, or {@link #NO_RETURN}
   */
  public int getQueryReturnType (Method method)
  {
    QueryDescriptor queryDescriptor = getQueryDescriptor(method);

    if (queryDescriptor != null)
    {
      if (queryDescriptor.getHasLocalReturnTypeMapping())
        return LOCAL_RETURN;
      if (queryDescriptor.getHasRemoteReturnTypeMapping())
        return REMOTE_RETURN;
    }

    return NO_RETURN;
  }
View Full Code Here

    @Override
    public void addDescriptor(Object  newDescriptor) {
        if (newDescriptor instanceof FieldDescriptor) {
           getCMPEntityDescriptor().getPersistenceDescriptor().addCMPField((FieldDescriptor) newDescriptor);          
        } else  if (newDescriptor instanceof QueryDescriptor) {
            QueryDescriptor newQuery = (QueryDescriptor) newDescriptor;
           getCMPEntityDescriptor().getPersistenceDescriptor().setQueryFor(
                        newQuery.getQueryMethodDescriptor(), newQuery);          
        } else {
            super.addDescriptor(newDescriptor);
        }
    }
View Full Code Here

    @Override
    public void addDescriptor(Object  newDescriptor) {
        if (newDescriptor instanceof FieldDescriptor) {
           getCMPEntityDescriptor().getPersistenceDescriptor().addCMPField((FieldDescriptor) newDescriptor);          
        } else  if (newDescriptor instanceof QueryDescriptor) {
            QueryDescriptor newQuery = (QueryDescriptor) newDescriptor;
           getCMPEntityDescriptor().getPersistenceDescriptor().setQueryFor(
                        newQuery.getQueryMethodDescriptor(), newQuery);          
        } else {
            super.addDescriptor(newDescriptor);
        }
    }
View Full Code Here

    @Override
    public void addDescriptor(Object  newDescriptor) {
        if (newDescriptor instanceof FieldDescriptor) {
           getCMPEntityDescriptor().getPersistenceDescriptor().addCMPField((FieldDescriptor) newDescriptor);          
        } else  if (newDescriptor instanceof QueryDescriptor) {
            QueryDescriptor newQuery = (QueryDescriptor) newDescriptor;
           getCMPEntityDescriptor().getPersistenceDescriptor().setQueryFor(
                        newQuery.getQueryMethodDescriptor(), newQuery);          
        } else {
            super.addDescriptor(newDescriptor);
        }
    }
View Full Code Here

                                                                MethodNode.class, "setQueryMethodDescriptor");                
    }

    @Override
    public QueryDescriptor getDescriptor() {
        if (descriptor == null) descriptor = new QueryDescriptor();
        return descriptor;       
    }
View Full Code Here

TOP

Related Classes of org.glassfish.ejb.deployment.descriptor.QueryDescriptor

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.