Class ColumnExpressionStatement
java.lang.Object
com.invirgance.convirgance.jdbc.sql.ColumnExpressionStatement
- All Implemented Interfaces:
NamedSchema,ExpressionStatement,SQLStatement
Represents a database column in SQL queries, with optional column aliasing (naming).
DatabaseSchemaLayout layout = getHSQLLayout();
Column column = layout.getCurrentSchema().getTable("customer").getColumn("zip");
ColumnExpressionStatement expression = new
ColumnExpressionStatement(layout, column);
expression.setName("zipcode");
- Author:
- jbanes
-
Constructor Summary
ConstructorsConstructorDescriptionColumnExpressionStatement(DatabaseSchemaLayout layout, Column column) Creates a column expression that can be used in SQL statements like SELECT, WHERE, etc.ColumnExpressionStatement(DatabaseSchemaLayout layout, Column column, String name) Creates a column expression with an alias (for "AS" clauses in SELECT statements). -
Method Summary
Modifier and TypeMethodDescriptionReturns the column.getName()Get the schema name of this database objectIf this statement is part of a larger statement, this returns the parent statement.Get the schema name of this database object quoted for use in a SQL statementrender(SQLRenderer renderer) voidSets the alias name for this expression.voidsetParent(SQLStatement parent) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.invirgance.convirgance.jdbc.sql.SQLStatement
query, query
-
Constructor Details
-
ColumnExpressionStatement
Creates a column expression that can be used in SQL statements like SELECT, WHERE, etc.- Parameters:
layout- The database schema layout with table and driver information.column- The database column to reference.
-
ColumnExpressionStatement
Creates a column expression with an alias (for "AS" clauses in SELECT statements).- Parameters:
layout- The database schema layout with table and driver information.column- The database column to reference.name- The alias to give this column (creates "column AS name" in SQL)
-
-
Method Details
-
getParent
Description copied from interface:SQLStatementIf this statement is part of a larger statement, this returns the parent statement.- Specified by:
getParentin interfaceSQLStatement- Returns:
- the parent statement
-
setParent
- Specified by:
setParentin interfaceSQLStatement
-
getColumn
Returns the column.- Returns:
- Column
-
getName
Description copied from interface:NamedSchemaGet the schema name of this database object- Specified by:
getNamein interfaceNamedSchema- Returns:
- name of the object with exact database capitalization
-
setName
Sets the alias name for this expression.- Parameters:
name- Name.
-
getQuotedName
Description copied from interface:NamedSchemaGet the schema name of this database object quoted for use in a SQL statement- Specified by:
getQuotedNamein interfaceNamedSchema- Returns:
- name of the object quoted for use in a SQL statement
-
render
- Specified by:
renderin interfaceSQLStatement
-
toString
-