Save This Page
Home » apache-openjpa-1.1.0-source » org.apache.openjpa.jdbc » sql » [javadoc | source]
org.apache.openjpa.jdbc.sql
public class: SelectImpl [javadoc | source]
java.lang.Object
   org.apache.openjpa.jdbc.sql.SelectImpl

All Implemented Interfaces:
    Select, PathJoins

Standard Select implementation. Usage note: though this class implements Joins , it should not be used for joining directly. Instead, use the return value of #newJoins .
Nested Class Summary:
public static class  SelectImpl.SelectResult  A {@link Result} implementation wrapped around this select. 
protected static class  SelectImpl.Selects  Helper class to track selected columns, with fast contains method. Acts as a list of select ids, with additional methods to manipulate the alias of each selected id. 
Field Summary
protected final  SelectImpl.Selects _selects     
protected  SelectImpl _outer     
Constructor:
 public SelectImpl(JDBCConfiguration conf) 
    Constructor. Supply configuration.
Method from org.apache.openjpa.jdbc.sql.SelectImpl Summary:
addJoinClassConditions,   and,   append,   clearOrdering,   clearPlaceholderSelects,   clearSelects,   crossJoin,   eagerClone,   execute,   execute,   execute,   executeQuery,   fullClone,   getAutoDistinct,   getColumnAlias,   getColumnAlias,   getColumnAlias,   getColumnAlias,   getConfiguration,   getCount,   getCount,   getEager,   getEagerMap,   getEagerResult,   getEndIndex,   getExpectedResultCount,   getFromSelect,   getGrouping,   getHaving,   getIdentifierAliases,   getJoinIterator,   getJoinSyntax,   getJoins,   getOrderedIndexes,   getOrdering,   getParent,   getSelectAliases,   getSelects,   getStartIndex,   getSubselectPath,   getSubselects,   getTableAliases,   getWhere,   groupBy,   groupBy,   groupBy,   groupBy,   groupBy,   groupBy,   groupBy,   groupBy,   groupBy,   groupBy,   hasEagerJoin,   hasJoin,   having,   having,   having,   having,   indexOf,   insertPlaceholder,   isAggregate,   isDirty,   isDistinct,   isEmpty,   isLRS,   isLob,   isOuter,   isSelected,   join,   joinCount,   joinRelation,   joins,   newJoins,   newOuterJoins,   newSelects,   nullJoins,   or,   orderBy,   orderBy,   orderBy,   orderBy,   orderBy,   orderBy,   orderBy,   orderBy,   orderBy,   orderBy,   orderBy,   orderBy,   orderByPrimaryKey,   orderByPrimaryKey,   orderByPrimaryKey,   outer,   outerJoin,   outerJoinRelation,   path,   prepareStatement,   select,   select,   select,   select,   select,   select,   select,   select,   select,   select,   select,   selectIdentifier,   selectIdentifier,   selectIdentifier,   selectIdentifier,   selectIdentifier,   selectIdentifier,   selectPlaceholder,   selectPrimaryKey,   selectPrimaryKey,   setAggregate,   setAutoDistinct,   setDistinct,   setExpectedResultCount,   setFromSelect,   setJoinSyntax,   setLRS,   setLob,   setOuter,   setParent,   setRange,   setRecordOrderedIndexes,   setSubselect,   setTimeout,   setVariable,   supportsLocking,   supportsRandomAccess,   toAlias,   toOrderAlias,   toSelect,   toSelectCount,   toString,   where,   where,   where,   where,   where,   whereClone,   whereForeignKey,   wherePrimaryKey
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.openjpa.jdbc.sql.SelectImpl Detail:
 public  void addJoinClassConditions() 
 public Joins and(Joins joins1,
    Joins joins2) 
 public  void append(SQLBuffer buf,
    Joins joins) 
 public  void clearOrdering() 
 public  void clearPlaceholderSelects() 
    Clear selected placeholders, and return removed select indexes.
 public  void clearSelects() 
 public Joins crossJoin(Table localTable,
    Table foreignTable) 
 public SelectExecutor eagerClone(FieldMapping key,
    int eagerType,
    boolean toMany,
    int sels) 
 public Result execute(JDBCStore store,
    JDBCFetchConfiguration fetch) throws SQLException 
 public Result execute(JDBCStore store,
    JDBCFetchConfiguration fetch,
    int lockLevel) throws SQLException 
 protected Result execute(StoreContext ctx,
    JDBCStore store,
    JDBCFetchConfiguration fetch,
    int lockLevel) throws SQLException 
    Execute this select in the context of the given store manager. The context is passed in separately for profiling purposes.
 protected ResultSet executeQuery(Connection conn,
    PreparedStatement stmnt,
    SQLBuffer sql,
    boolean isLRS,
    JDBCStore store) throws SQLException 
    This method is to provide override for non-JDBC or JDBC-like implementation of executing query.
 public SelectExecutor fullClone(int sels) 
 public boolean getAutoDistinct() 
 public String getColumnAlias(Column col) 
 public String getColumnAlias(Column col,
    Joins joins) 
 public String getColumnAlias(String col,
    Table table) 
 public String getColumnAlias(String col,
    Table table,
    Joins joins) 
 public JDBCConfiguration getConfiguration() 
 public int getCount(JDBCStore store) throws SQLException 
 protected int getCount(ResultSet rs) throws SQLException 
    This method is to provide override for non-JDBC or JDBC-like implementation of getting count from the result set.
 public SelectExecutor getEager(FieldMapping key) 
 public Map getEagerMap() 
    Return view of eager selects. May be null.
 protected Result getEagerResult(Connection conn,
    PreparedStatement stmnt,
    ResultSet rs,
    JDBCStore store,
    JDBCFetchConfiguration fetch,
    boolean forUpdate,
    String sqlStr) throws SQLException 
    This method is to provide override for non-JDBC or JDBC-like implementation of executing eager selects.
 public long getEndIndex() 
 public int getExpectedResultCount() 
 public Select getFromSelect() 
 public SQLBuffer getGrouping() 
 public SQLBuffer getHaving() 
 public List getIdentifierAliases() 
 public Iterator getJoinIterator() 
 public int getJoinSyntax() 
 public Joins getJoins() 
 List getOrderedIndexes() 
    Return the indexes in the select list of all items we're ordering by, or null if none. For use with unions.
 public SQLBuffer getOrdering() 
 public Select getParent() 
 public List getSelectAliases() 
 public List getSelects() 
 public long getStartIndex() 
 public String getSubselectPath() 
 public List getSubselects() 
 public Collection getTableAliases() 
 public SQLBuffer getWhere() 
 public  void groupBy(SQLBuffer sql) 
 public  void groupBy(String sql) 
 public  void groupBy(Column col) 
 public  void groupBy(Column[] cols) 
 public  void groupBy(SQLBuffer sql,
    Joins joins) 
 public  void groupBy(String sql,
    Joins joins) 
 public  void groupBy(Column col,
    Joins joins) 
 public  void groupBy(Column[] cols,
    Joins joins) 
 public  void groupBy(ClassMapping mapping,
    int subclasses,
    JDBCStore store,
    JDBCFetchConfiguration fetch) 
 public  void groupBy(ClassMapping mapping,
    int subclasses,
    JDBCStore store,
    JDBCFetchConfiguration fetch,
    Joins joins) 
 public boolean hasEagerJoin(boolean toMany) 
 public boolean hasJoin(boolean toMany) 
 public  void having(SQLBuffer sql) 
 public  void having(String sql) 
 public  void having(SQLBuffer sql,
    Joins joins) 
 public  void having(String sql,
    Joins joins) 
 public int indexOf() 
 public  void insertPlaceholder(String sql,
    int pos) 
    Insert a placeholder at the given index; use a negative index to count from the back of the select list.
 public boolean isAggregate() 
 public boolean isDirty() 
 public boolean isDistinct() 
 public boolean isEmpty() 
 public boolean isLRS() 
 public boolean isLob() 
 public boolean isOuter() 
 public boolean isSelected(Table table) 
 public Joins join(ForeignKey fk,
    boolean inverse,
    boolean toMany) 
 public int joinCount() 
 public Joins joinRelation(String name,
    ForeignKey fk,
    ClassMapping target,
    int subs,
    boolean inverse,
    boolean toMany) 
 public JoinSet joins() 
 public Joins newJoins() 
 public Joins newOuterJoins() 
 protected SelectImpl.Selects newSelects() 
 public  void nullJoins() 
 public Joins or(Joins joins1,
    Joins joins2) 
 public boolean orderBy(Column col,
    boolean asc,
    boolean sel) 
 public int orderBy(Column[] cols,
    boolean asc,
    boolean sel) 
 public boolean orderBy(SQLBuffer sql,
    boolean asc,
    boolean sel) 
 public boolean orderBy(String sql,
    boolean asc,
    boolean sel) 
 public boolean orderBy(Column col,
    boolean asc,
    Joins joins,
    boolean sel) 
 public int orderBy(Column[] cols,
    boolean asc,
    Joins joins,
    boolean sel) 
 public boolean orderBy(SQLBuffer sql,
    boolean asc,
    Joins joins,
    boolean sel) 
 public boolean orderBy(String sql,
    boolean asc,
    Joins joins,
    boolean sel) 
 boolean orderBy(Column col,
    boolean asc,
    Joins joins,
    boolean sel,
    boolean aliasOrder) 
    Allow unions to set aliases on order columns.
 int orderBy(Column[] cols,
    boolean asc,
    Joins joins,
    boolean sel,
    boolean aliasOrder) 
    Allow unions to set aliases on order columns.
 boolean orderBy(SQLBuffer sql,
    boolean asc,
    Joins joins,
    boolean sel,
    boolean aliasOrder) 
    Allow unions to set aliases on order columns.
 boolean orderBy(String sql,
    boolean asc,
    Joins joins,
    boolean sel,
    boolean aliasOrder) 
    Allow unions to set aliases on order columns.
 public int orderByPrimaryKey(ClassMapping mapping,
    boolean asc,
    boolean sel) 
 public int orderByPrimaryKey(ClassMapping mapping,
    boolean asc,
    Joins joins,
    boolean sel) 
 public int orderByPrimaryKey(ClassMapping mapping,
    boolean asc,
    Joins joins,
    boolean sel,
    boolean aliasOrder) 
    Allow unions to set aliases on order columns.
 public Joins outer(Joins joins) 
 public Joins outerJoin(ForeignKey fk,
    boolean inverse,
    boolean toMany) 
 public Joins outerJoinRelation(String name,
    ForeignKey fk,
    ClassMapping target,
    int subs,
    boolean inverse,
    boolean toMany) 
 public StringBuffer path() 
 protected PreparedStatement prepareStatement(Connection conn,
    SQLBuffer sql,
    JDBCFetchConfiguration fetch,
    int rsType,
    int rsConcur,
    boolean isLRS) throws SQLException 
    This method is to provide override for non-JDBC or JDBC-like implementation of preparing statement.
 public boolean select(Column col) 
 public int select(Column[] cols) 
 public boolean select(SQLBuffer sql,
    Object id) 
 public boolean select(String sql,
    Object id) 
 public boolean select(Column col,
    Joins joins) 
 public int select(Column[] cols,
    Joins joins) 
 public boolean select(SQLBuffer sql,
    Object id,
    Joins joins) 
 public boolean select(String sql,
    Object id,
    Joins joins) 
 public  void select(ClassMapping mapping,
    int subclasses,
    JDBCStore store,
    JDBCFetchConfiguration fetch,
    int eager) 
 public  void select(ClassMapping mapping,
    int subclasses,
    JDBCStore store,
    JDBCFetchConfiguration fetch,
    int eager,
    Joins joins) 
  void select(Select wrapper,
    ClassMapping mapping,
    int subclasses,
    JDBCStore store,
    JDBCFetchConfiguration fetch,
    int eager,
    Joins joins,
    boolean ident) 
    Select the given mapping.
 public boolean selectIdentifier(Column col) 
 public int selectIdentifier(Column[] cols) 
 public boolean selectIdentifier(Column col,
    Joins joins) 
 public int selectIdentifier(Column[] cols,
    Joins joins) 
 public  void selectIdentifier(ClassMapping mapping,
    int subclasses,
    JDBCStore store,
    JDBCFetchConfiguration fetch,
    int eager) 
 public  void selectIdentifier(ClassMapping mapping,
    int subclasses,
    JDBCStore store,
    JDBCFetchConfiguration fetch,
    int eager,
    Joins joins) 
 public  void selectPlaceholder(String sql) 
 public int selectPrimaryKey(ClassMapping mapping) 
 public int selectPrimaryKey(ClassMapping mapping,
    Joins joins) 
 public  void setAggregate(boolean agg) 
 public  void setAutoDistinct(boolean val) 
 public  void setDistinct(boolean distinct) 
 public  void setExpectedResultCount(int expectedResultCount,
    boolean force) 
 public  void setFromSelect(Select sel) 
 public  void setJoinSyntax(int joinSyntax) 
 public  void setLRS(boolean lrs) 
 public  void setLob(boolean lob) 
 public PathJoins setOuter(boolean outer) 
 public  void setParent(Select parent,
    String path) 
 public  void setRange(long start,
    long end) 
  void setRecordOrderedIndexes(boolean record) 
    Allow unions to record the select list indexes of items we order by.
 public Joins setSubselect(String alias) 
 protected  void setTimeout(PreparedStatement stmnt,
    boolean forUpdate,
    JDBCFetchConfiguration fetch) throws SQLException 
    This method is to provide override for non-JDBC or JDBC-like implementation of setting query timeout.
 public Joins setVariable(String var) 
 public boolean supportsLocking() 
 public boolean supportsRandomAccess(boolean forUpdate) 
 static String toAlias(int index) 
    Helper method to return the proper table alias for the given alias index.
 public static String toOrderAlias(int index) 
    Helper method to return the proper order alias for the given order column index.
 public SQLBuffer toSelect(boolean forUpdate,
    JDBCFetchConfiguration fetch) 
 public SQLBuffer toSelectCount() 
 public String toString() 
 public  void where(Joins joins) 
 public  void where(SQLBuffer sql) 
 public  void where(String sql) 
 public  void where(SQLBuffer sql,
    Joins joins) 
 public  void where(String sql,
    Joins joins) 
 public SelectExecutor whereClone(int sels) 
 public  void whereForeignKey(ForeignKey fk,
    Object oid,
    ClassMapping mapping,
    JDBCStore store) 
 public  void wherePrimaryKey(Object oid,
    ClassMapping mapping,
    JDBCStore store)