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 SQLSELECTstatement with no table joins.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>aliasesprotected List<String>columnsprotected Stringcommentprotected LockOptionslockOptionsprotected StringorderByprotected List<Restriction>restrictionsprotected StringtableName
-
Constructor Summary
Constructors Constructor Description SimpleSelect(SessionFactoryImplementor factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleSelectaddColumn(String columnName)Adds a selectionSimpleSelectaddColumn(String columnName, String alias)Adds a selection, with an aliasSimpleSelectaddColumns(String[] columnNames)Adds selectionsSimpleSelectaddRestriction(String columnName)Appends a restriction comparing thecolumnNamefor equality with a parameterSimpleSelectaddRestriction(String... columnNames)Appends a restriction comparing each name incolumnNamesfor equality with a parameterSimpleSelectaddRestriction(String lhs, ComparisonRestriction.Operator op, String rhs)Appends a restriction based on the comparison betweenlhsandrhs.SimpleSelectaddWhereToken(String condition)Appends a complete where condition.StringmakeParameterMarker()SimpleSelectsetComment(String comment)SimpleSelectsetLockMode(LockMode lockMode)SimpleSelectsetLockOptions(LockOptions lockOptions)SimpleSelectsetOrderBy(String orderBy)SimpleSelectsetTableName(String tableName)Sets the name of the table we are selecting fromStringtoStatementString()
-
-
-
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:
makeParameterMarkerin 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. Theconditionis added as-is.
-
addRestriction
public SimpleSelect addRestriction(String columnName)
Appends a restriction comparing thecolumnNamefor equality with a parameter
-
addRestriction
public SimpleSelect addRestriction(String lhs, ComparisonRestriction.Operator op, String rhs)
Appends a restriction based on the comparison betweenlhsandrhs. Therhsis checked for parameter marker and processed viaParameterMarkerStrategyif needed.
-
addRestriction
public SimpleSelect addRestriction(String... columnNames)
Appends a restriction comparing each name incolumnNamesfor 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()
-
-