1 22 package org.jboss.ejb.plugins.cmp.jdbc; 23 24 import org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge; 25 import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCQueryMetaData; 26 import org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCReadAheadMetaData; 27 import org.jboss.deployment.DeploymentException; 28 29 40 public final class JDBCFindAllQuery extends JDBCAbstractQueryCommand 41 { 42 43 public JDBCFindAllQuery(JDBCStoreManager manager, JDBCQueryMetaData q) throws DeploymentException 44 { 45 super(manager, q); 46 47 JDBCEntityBridge entity = (JDBCEntityBridge) manager.getEntityBridge(); 48 49 JDBCReadAheadMetaData readAhead = q.getReadAhead(); 51 if(readAhead.isOnFind()) 52 { 53 setEagerLoadGroup(readAhead.getEagerLoadGroup()); 54 } 55 56 StringBuffer sql = new StringBuffer (300); 58 sql.append(SQLUtil.SELECT); 59 SQLUtil.getColumnNamesClause(entity.getPrimaryKeyFields(), sql); 61 if(getEagerLoadGroup() != null) 62 { 63 SQLUtil.appendColumnNamesClause(entity, getEagerLoadGroup(), sql); 64 } 65 sql.append(SQLUtil.FROM).append(entity.getQualifiedTableName()); 66 67 setSQL(sql.toString()); 68 } 69 } 70 | Popular Tags |