Examples of JDBCReadAheadMetaData


Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

         selectFunction = compiler.getSelectFunction();
      }

      boolean[] mask;
      List leftJoinCMRList;
      JDBCReadAheadMetaData readahead = metadata.getReadAhead();
      if(selectEntity != null && readahead.isOnFind())
      {
         mask = selectEntity.getLoadGroupMask(readahead.getEagerLoadGroup());
         boolean modifiedMask = false;
         leftJoinCMRList = compiler.getLeftJoinCMRList();

         // exclude non-searchable columns if distinct is used
         if(compiler.isSelectDistinct())
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

         // set the select entity
         setSelectEntity(selectEntity);

         // set the preload fields
         JDBCReadAheadMetaData readahead = metadata.getReadAhead();
         if(readahead.isOnFind())
         {
            setEagerLoadGroup(readahead.getEagerLoadGroup());
            setOnFindCMRList(compiler.getLeftJoinCMRList());

            // exclude non-searchable columns if distinct is used
            if(compiler.isSelectDistinct())
            {
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

         {
            // try to get the finder method on the home interface
            Method method = homeClass.getMethod(FIND_BY_PK, new Class[]{entity.getPrimaryKeyClass()});

            JDBCQueryMetaData findByPKMD = manager.getMetaData().getQueryMetaDataForMethod(method);
            JDBCReadAheadMetaData readAhead = (findByPKMD == null ?
               entity.getMetaData().getReadAhead() : findByPKMD.getReadAhead());

            // got it add it to known finders
            JDBCQueryMetaData q = new JDBCAutomaticQueryMetaData(
                  method,
                  readAhead,
               entity.getMetaData().getQLCompiler(),
               false
            );
            knownQueries.put(method, factory.createFindByPrimaryKeyQuery(q));

            if(log.isDebugEnabled())
               log.debug("Added findByPrimaryKey query command for home interface");
         } catch(NoSuchMethodException e)
         {
            throw new DeploymentException("Home interface does not have a findByPrimaryKey method");
         }
      }

      if(localHomeClass != null)
      {

         Method method;
         try
         {
            // try to get the finder method on the local home interface
            method = localHomeClass.getMethod(FIND_BY_PK, new Class[] { entity.getPrimaryKeyClass() });
         } catch(NoSuchMethodException e)
         {
            throw new DeploymentException("Local home interface does " +
                  "not have the method findByPrimaryKey(" +
                  entity.getPrimaryKeyClass().getName() + ")");
         }

         // got it add it to known finders
         JDBCQueryMetaData findByPKMD = manager.getMetaData().getQueryMetaDataForMethod(method);
         JDBCReadAheadMetaData readAhead = (findByPKMD == null ?
            entity.getMetaData().getReadAhead() : findByPKMD.getReadAhead());
         JDBCQueryMetaData q = new JDBCAutomaticQueryMetaData(method, readAhead, entity.getMetaData().getQLCompiler(), false);
         knownQueries.put(method, factory.createFindByPrimaryKeyQuery(q));

         if(log.isDebugEnabled())
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

               }
            }
         }

         // set all of the preloaded values
         JDBCReadAheadMetaData readAhead = relatedCMRField.getReadAhead();
         for(Iterator iter = resultsMap.keySet().iterator(); iter.hasNext();)
         {
            Object key = iter.next();

            // get the results for this key
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

      super(manager, q);

      JDBCEntityBridge entity = (JDBCEntityBridge) manager.getEntityBridge();

      // set the preload fields
      JDBCReadAheadMetaData readAhead = q.getReadAhead();
      if(readAhead.isOnFind())
      {
         setEagerLoadGroup(readAhead.getEagerLoadGroup());
      }

      // generate the sql
      StringBuffer sql = new StringBuffer(300);
      sql.append(SQLUtil.SELECT);
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

         // set the select entity
         setSelectEntity(selectEntity);

         // set the preload fields
         JDBCReadAheadMetaData readahead = metadata.getReadAhead();
         if(readahead.isOnFind())
         {
            setEagerLoadGroup(readahead.getEagerLoadGroup());
            setOnFindCMRList(compiler.getLeftJoinCMRList());

            // exclude non-searchable columns if distinct is used
            if(compiler.isSelectDistinct())
            {
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

      // set the select object (either selectEntity or selectField)
      initSelectObject(manager);

      // set the preload fields
      JDBCReadAheadMetaData readAhead = metadata.getReadAhead();
      JDBCEntityBridge selectEntity = getSelectEntity();
      if(selectEntity != null && readAhead.isOnFind())
      {
         setEagerLoadGroup(readAhead.getEagerLoadGroup());
      }

      // set the sql and parameters
      String sql = buildSQL();
      setSQL(parseParameters(sql));
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

         throw new IllegalArgumentException(
            "No finder for this method: " + finderName);
      }

      // set the preload fields
      JDBCReadAheadMetaData readAhead = q.getReadAhead();
      if(readAhead.isOnFind())
      {
         setEagerLoadGroup(readAhead.getEagerLoadGroup());
      }

      // generate the sql
      StringBuffer sql = new StringBuffer(300);
      sql.append(SQLUtil.SELECT);
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

      from.append(entity.getQualifiedTableName())
         .append(' ')
         .append(alias);

      // set the preload fields
      JDBCReadAheadMetaData readAhead = q.getReadAhead();
      if(readAhead.isOnFind())
      {
         setEagerLoadGroup(readAhead.getEagerLoadGroup());
         if(getEagerLoadMask() != null)
         {
            SQLUtil.appendColumnNamesClause(entity.getTableFields(), getEagerLoadMask(), alias, select);

            List onFindCMRList = JDBCAbstractQueryCommand.getLeftJoinCMRNodes(
               entity, entity.getQualifiedTableName(), readAhead.getLeftJoins(), null);

            if(!onFindCMRList.isEmpty())
            {
               setOnFindCMRList(onFindCMRList);
               JDBCAbstractQueryCommand.leftJoinCMRNodes(alias, onFindCMRList, aliasManager, from);
               JDBCAbstractQueryCommand.appendLeftJoinCMRColumnNames(onFindCMRList, aliasManager, select);
            }
         }
      }

      StringBuffer where = new StringBuffer();
      SQLUtil.getWhereClause(entity.getPrimaryKeyFields(), alias, where);

      // generate the sql
      StringBuffer sql = new StringBuffer(300);
      if(rowLocking && readAhead.isOnFind() && getEagerLoadMask() != null)
      {
         JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
         rowLockingTemplate.getFunctionSql(
            new Object[]{
               select,
View Full Code Here

Examples of org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData

   public JDBCCustomFinderQuery(JDBCStoreManager manager, Method finderMethod)
   {
      this.finderMethod = finderMethod;
      this.manager = manager;

      JDBCReadAheadMetaData readAheadMetaData = manager.getMetaData().getReadAhead();
      if((readAheadMetaData != null) && readAheadMetaData.isOnLoad())
      {
         this.readAheadCache = manager.getReadAheadCache();
         this.readAheadMetaData = readAheadMetaData;
      }
      else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.