Top Description Fields Constructors Methods
org.hibernate.sql

public Class SimpleSelect

extends Object
implements RestrictionRenderingContext
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.RestrictionRenderingContext
Annotations
@Internal
Imports
java.util.ArrayList, .HashMap, .HashSet, .List, .Map, .Set, org.hibernate.Internal, .LockMode, .LockOptions, org.hibernate.dialect.Dialect, org.hibernate.engine.jdbc.spi.JdbcServices, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.sql.ast.spi.ParameterMarkerStrategy

A SQL SELECT statement with no table joins.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
protected Map<String, String>
protected List<String>
protected String
private final Dialect
protected LockOptions
protected String
private int
private final ParameterMarkerStrategy
protected List<Restriction>
protected String

Constructor Summary

AccessConstructor and Description
public
SimpleSelect(final SessionFactoryImplementor factory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Method Summary

Modifier and TypeMethod and Description
public SimpleSelect
addColumn(String columnName)

Adds a selection

public SimpleSelect
addColumn(String columnName, String alias)

Adds a selection, with an alias

public SimpleSelect
addColumns(String[] columnNames)

Adds selections

public SimpleSelect
addRestriction(String columnName)

Appends a restriction comparing the columnName for equality with a parameter

public SimpleSelect
addRestriction(String lhs, ComparisonRestriction.Operator op, String rhs)

Appends a restriction based on the comparison between lhs and rhs.

public SimpleSelect
addRestriction(String... columnNames)

Appends a restriction comparing each name in columnNames for equality with a parameter

public SimpleSelect
addWhereToken(String condition)

Appends a complete where condition.

private void
private void
private void
private void
private void
public String
public SimpleSelect
setComment(String comment)

public SimpleSelect
public SimpleSelect
public SimpleSelect
setOrderBy(String orderBy)

public SimpleSelect
setTableName(String tableName)

Sets the name of the table we are selecting from

public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasesback to summary
protected Map<String, String> aliases
columnsback to summary
protected List<String> columns
commentback to summary
protected String comment
dialectback to summary
private final Dialect dialect
lockOptionsback to summary
protected LockOptions lockOptions
orderByback to summary
protected String orderBy
parameterCountback to summary
private int parameterCount
parameterMarkerStrategyback to summary
private final ParameterMarkerStrategy parameterMarkerStrategy
restrictionsback to summary
protected List<Restriction> restrictions
tableNameback to summary
protected String tableName

Constructor Detail

SimpleSelectback to summary
public SimpleSelect(final SessionFactoryImplementor factory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Method Detail

addColumnback to summary
public SimpleSelect addColumn(String columnName)

Adds a selection

addColumnback to summary
public SimpleSelect addColumn(String columnName, String alias)

Adds a selection, with an alias

addColumnsback to summary
public SimpleSelect addColumns(String[] columnNames)

Adds selections

addRestrictionback to summary
public SimpleSelect addRestriction(String columnName)

Appends a restriction comparing the columnName for equality with a parameter

See Also
addRestriction(String, ComparisonRestriction.Operator, String)
addRestrictionback to summary
public SimpleSelect addRestriction(String lhs, ComparisonRestriction.Operator op, String rhs)

Appends a restriction based on the comparison between lhs and rhs.

The rhs is checked for parameter marker and processed via ParameterMarkerStrategy if needed.

addRestrictionback to summary
public SimpleSelect addRestriction(String... columnNames)

Appends a restriction comparing each name in columnNames for equality with a parameter

See Also
addRestriction(String)
addWhereTokenback to summary
public SimpleSelect addWhereToken(String condition)

Appends a complete where condition. The condition is added as-is.

applyCommentback to summary
private void applyComment(StringBuilder buf)
applyFromClauseback to summary
private void applyFromClause(StringBuilder buf)
applyOrderByback to summary
private void applyOrderBy(StringBuilder buf)
applySelectClauseback to summary
private void applySelectClause(StringBuilder buf)
applyWhereClauseback to summary
private void applyWhereClause(StringBuilder buf)
makeParameterMarkerback to summary
public String makeParameterMarker()

Implements org.hibernate.sql.RestrictionRenderingContext.makeParameterMarker.

Annotations
@Override
setCommentback to summary
public SimpleSelect setComment(String comment)
setLockModeback to summary
public SimpleSelect setLockMode(LockMode lockMode)
setLockOptionsback to summary
public SimpleSelect setLockOptions(LockOptions lockOptions)
setOrderByback to summary
public SimpleSelect setOrderBy(String orderBy)
setTableNameback to summary
public SimpleSelect setTableName(String tableName)

Sets the name of the table we are selecting from

toStatementStringback to summary
public String toStatementString()