Examples of JDBCReadAheadMetaData


Examples of org.jboss.as.cmp.jdbc.metadata.JDBCReadAheadMetaData

            try {
                // 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 MESSAGES.homeInterfaceNoPKMethod(homeClass);
            }
        }

        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 CmpMessages.MESSAGES.localHomeMissingFindByPrimaryKey(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.as.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<LeftJoinCMRNode> 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,
                            from,
View Full Code Here

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

                  return true;
               }

               public JDBCReadAheadMetaData getReadAhead()
               {
                  return new JDBCReadAheadMetaData("on-load", 100, "*");
               }

               public Class getQLCompilerClass()
               {
                  throw new UnsupportedOperationException();
View Full Code Here

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

                  return true;
               }

               public JDBCReadAheadMetaData getReadAhead()
               {
                  return new JDBCReadAheadMetaData("on-load", 100, "*");
               }

               public Class getQLCompilerClass()
               {
                  throw new UnsupportedOperationException();
View Full Code Here

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

            return true;
         }

         public JDBCReadAheadMetaData getReadAhead()
         {
            return new JDBCReadAheadMetaData("on-load", 4, "*");
         }

         public Class getQLCompilerClass()
         {
            throw new UnsupportedOperationException();
View Full Code Here

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

            return true;
         }

         public JDBCReadAheadMetaData getReadAhead()
         {
            return new JDBCReadAheadMetaData("on-load", 100, "*");
         }

         public Class getQLCompilerClass()
         {
            throw new UnsupportedOperationException();
View Full Code Here

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

                  return true;
               }

               public JDBCReadAheadMetaData getReadAhead()
               {
                  return new JDBCReadAheadMetaData("on-load", 100, "*");
               }

               public Class getQLCompilerClass()
               {
                  throw new UnsupportedOperationException();
View Full Code Here

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

                  return true;
               }

               public JDBCReadAheadMetaData getReadAhead()
               {
                  return new JDBCReadAheadMetaData("on-load", 100, "*");
               }

               public Class getQLCompilerClass()
               {
                  throw new UnsupportedOperationException();
View Full Code Here

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

            return true;
         }

         public JDBCReadAheadMetaData getReadAhead()
         {
            return new JDBCReadAheadMetaData("on-load", 4, "*");
         }

         public Class getQLCompilerClass()
         {
            throw new UnsupportedOperationException();
View Full Code Here

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

         {
            listCache.promote(entry.results);
         }

         // get the readahead metadata
         JDBCReadAheadMetaData readahead = entry.readahead;
         if(readahead == null)
         {
            readahead = manager.getMetaData().getReadAhead();
         }

         int from = entry.index;
         int to = Math.min(entry.results.size(), entry.index + readahead.getPageSize());
         List loadKeys = entry.results.subList(from, to);

         return new EntityReadAheadInfo(loadKeys, readahead);
      }
      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.