Package org.glassfish.ejb.deployment.descriptor

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


    public static boolean checkSyntax (EjbDescriptor ejbDesc,
            EJBQLC ejbqlDriver, Result result, String ownerClassName) {
       
        boolean hasError = false;
        String query = null;
        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);
View Full Code Here


    private boolean commonToBothInterfaces(String home, EjbDescriptor descriptor, String methodIntf) {
        boolean oneFailed = false;
  // RULE: Entity home interface are only allowed to have find<METHOD>
  //       methods which must throw javax.ejb.FinderException
  try {
      PersistenceDescriptor pers = ((EjbCMPEntityDescriptor)descriptor).getPersistenceDescriptor();

      VerifierTestContext context = getVerifierContext();
      ClassLoader jcl = context.getClassLoader();
      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} ]",
View Full Code Here

        if (descriptor instanceof EjbEntityDescriptor) {
      String persistentType =
    ((EjbEntityDescriptor)descriptor).getPersistenceType();
      if (EjbEntityDescriptor.CONTAINER_PERSISTENCE.equals(persistentType)) {
                EjbCMPEntityDescriptor cmpDesc = (EjbCMPEntityDescriptor) descriptor;
                PersistenceDescriptor persDesc = cmpDesc.getPersistenceDescriptor();
                if (persDesc.getCMPFields().size()==0) {
                    result.failed(smh.getLocalString
                                           (getClass().getName()+"failed",
                                            "For CMP entity bean [ {0} ], no cmp field are defined",
                                            new Object[] {descriptor.getName()}));
                } else {
View Full Code Here

            accept((ServiceReferenceDescriptor) itr.next());
        }

        if (ejb instanceof EjbCMPEntityDescriptor) {
            EjbCMPEntityDescriptor cmp = (EjbCMPEntityDescriptor)ejb;
            PersistenceDescriptor persistenceDesc = cmp.getPersistenceDescriptor();
            for (Iterator e=persistenceDesc.getCMPFields().iterator();e.hasNext();) {
                FieldDescriptor fd = (FieldDescriptor) e.next();
                accept(fd);
            }
        }
    }   
View Full Code Here

                String ejbName = ejbDesc.getName();
                //collect all ejbdesc
                ejbDescMap.put(ejbName, ejbDesc);

                //collect PersistenceDescriptor
                PersistenceDescriptor pers = ejbDesc.getPersistenceDescriptor();
                ejbPerDescMap.put(ejbName, pers);

                //collect pers fields
                Collection pFields = ejbDesc.getPersistentFields();
                HashMap fieldMap = new HashMap();
View Full Code Here

     */
    public String getRelationshipFieldType(String ejbName, String fieldName) {
        if (isGeneratedRelationship(ejbName, fieldName)) {
            return java.util.Collection.class.getName();
        } else {
            PersistenceDescriptor pers =
                (PersistenceDescriptor)ejbPerDescMap.get(ejbName);
            return pers.getCMRFieldReturnType(fieldName);
        }
    }
View Full Code Here

    EjbCMPEntityDescriptor descriptor = ((ejbName != null) ?
      getDescriptorForEjbName(ejbName) : null);

    if (descriptor != null)
    {
      PersistenceDescriptor persistenceDescriptor =
        descriptor.getPersistenceDescriptor();
      CMRFieldInfo cmrf =
        persistenceDescriptor.getCMRFieldInfoByName(ejbFieldName);
     
      return cmrf.role.getPartner().getOwner();
    }

    return null;
View Full Code Here

        String ejbName = (sourceIsNull ? sourceEjbName : sinkEjbName);
        String otherEjbName =
          (sourceIsNull ? sinkEjbName : sourceEjbName);
        List ejbField = Arrays.asList(new String[]{otherEjbName,
          (sourceIsNull ? sink.getCMRField() : sourceCMRField)});
        PersistenceDescriptor pDescriptor = ((EjbCMPEntityDescriptor)
          bundleDescriptor.getEjbByName(ejbName)).
          getPersistenceDescriptor();
        List generatedField = null;
        String uniqueName = null;
View Full Code Here

   * @return a query descriptor for the specified method. Returns
   * <code>null</code> for CMP 1.1 queries.
   */
  protected QueryDescriptor getQueryDescriptor (Method method)
  {
    PersistenceDescriptor persistenceDescriptor =
      getDescriptor().getPersistenceDescriptor();
    return persistenceDescriptor.getQueryFor(method);
  }
View Full Code Here

            accept((ServiceReferenceDescriptor) itr.next());
        }

        if (ejb instanceof EjbCMPEntityDescriptor) {
            EjbCMPEntityDescriptor cmp = (EjbCMPEntityDescriptor)ejb;
            PersistenceDescriptor persistenceDesc = cmp.getPersistenceDescriptor();
            for (Iterator e=persistenceDesc.getCMPFields().iterator();e.hasNext();) {
                FieldDescriptor fd = (FieldDescriptor) e.next();
                accept(fd);
            }
        }
    }   
View Full Code Here

TOP

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

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.