Package org.hibernate.sql
Class SimpleSelect
- java.lang.Object
-
- org.hibernate.sql.SimpleSelect
-
- All Implemented Interfaces:
RestrictionRenderingContext
@Internal public class SimpleSelect extends Object implements RestrictionRenderingContext
A SQLSELECT
statement with no table joins.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>
aliases
protected List<String>
columns
protected String
comment
protected LockOptions
lockOptions
protected String
orderBy
protected List<Restriction>
restrictions
protected String
tableName
-
Constructor Summary
Constructors Constructor Description SimpleSelect(SessionFactoryImplementor factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleSelect
addColumn(String columnName)
Adds a selectionSimpleSelect
addColumn(String columnName, String alias)
Adds a selection, with an aliasSimpleSelect
addColumns(String[] columnNames)
Adds selectionsSimpleSelect
addRestriction(String columnName)
Appends a restriction comparing thecolumnName
for equality with a parameterSimpleSelect
addRestriction(String... columnNames)
Appends a restriction comparing each name incolumnNames
for equality with a parameterSimpleSelect
addRestriction(String lhs, ComparisonRestriction.Operator op, String rhs)
Appends a restriction based on the comparison betweenlhs
andrhs
.SimpleSelect
addWhereToken(String condition)
Appends a complete where condition.String
makeParameterMarker()
SimpleSelect
setComment(String comment)
SimpleSelect
setLockMode(LockMode lockMode)
SimpleSelect
setLockOptions(LockOptions lockOptions)
SimpleSelect
setOrderBy(String orderBy)
SimpleSelect
setTableName(String tableName)
Sets the name of the table we are selecting fromString
toStatementString()
-
-
-
Field Detail
-
tableName
protected String tableName
-
orderBy
protected String orderBy
-
comment
protected String comment
-
restrictions
protected List<Restriction> restrictions
-
lockOptions
protected LockOptions lockOptions
-
-
Constructor Detail
-
SimpleSelect
public SimpleSelect(SessionFactoryImplementor factory)
-
-
Method Detail
-
makeParameterMarker
public String makeParameterMarker()
- Specified by:
makeParameterMarker
in interfaceRestrictionRenderingContext
-
setTableName
public SimpleSelect setTableName(String tableName)
Sets the name of the table we are selecting from
-
addColumns
public SimpleSelect addColumns(String[] columnNames)
Adds selections
-
addColumn
public SimpleSelect addColumn(String columnName)
Adds a selection
-
addColumn
public SimpleSelect addColumn(String columnName, String alias)
Adds a selection, with an alias
-
addWhereToken
public SimpleSelect addWhereToken(String condition)
Appends a complete where condition. Thecondition
is added as-is.
-
addRestriction
public SimpleSelect addRestriction(String columnName)
Appends a restriction comparing thecolumnName
for equality with a parameter
-
addRestriction
public SimpleSelect addRestriction(String lhs, ComparisonRestriction.Operator op, String rhs)
Appends a restriction based on the comparison betweenlhs
andrhs
. Therhs
is checked for parameter marker and processed viaParameterMarkerStrategy
if needed.
-
addRestriction
public SimpleSelect addRestriction(String... columnNames)
Appends a restriction comparing each name incolumnNames
for equality with a parameter- See Also:
addRestriction(String)
-
setLockOptions
public SimpleSelect setLockOptions(LockOptions lockOptions)
-
setLockMode
public SimpleSelect setLockMode(LockMode lockMode)
-
setOrderBy
public SimpleSelect setOrderBy(String orderBy)
-
setComment
public SimpleSelect setComment(String comment)
-
toStatementString
public String toStatementString()
-
-