Class SQLColumns
- java.lang.Object
-
- net.ontopia.persistence.query.sql.SQLColumns
-
- All Implemented Interfaces:
SQLValueIF
public class SQLColumns extends Object implements SQLValueIF
INTERNAL: Represents a set of columns from a given table. The columns are grouped for a reason. Columns are often used as join criteria.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
alias
protected String[]
cols
protected static FieldHandlerIF
DEFAULT_FIELD_HANDLER
protected static Class
DEFAULT_VALUE_TYPE
protected FieldHandlerIF
fhandler
protected SQLTable
table
protected Class
vtype
-
Constructor Summary
Constructors Constructor Description SQLColumns(SQLTable table, String col)
SQLColumns(SQLTable table, String[] cols)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getAlias()
INTERNAL: The column alias to use if this value is included in the projection.int
getArity()
INTERNAL: Returns the [column] arity of the value.String[]
getColumns()
FieldHandlerIF
getFieldHandler()
INTERNAL: Returns the field handler for the columns.SQLValueIF
getReference()
INTERNAL: Returns the referenced value if one exists.SQLTable
getTable()
int
getType()
INTERNAL: Returns the value class type.int
getValueArity()
INTERNAL: Returns the value arity of the value.Class
getValueType()
INTERNAL: Returns the value type.int
hashCode()
boolean
isReference()
INTERNAL: Returns true if this value is a reference to another.void
setAlias(String alias)
INTERNAL: Sets the column alias.void
setFieldHandler(FieldHandlerIF fhandler)
INTERNAL: Sets the field handler for the value.void
setValueType(Class vtype)
INTERNAL: Sets the value type.String
toString()
-
-
-
Field Detail
-
DEFAULT_VALUE_TYPE
protected static final Class DEFAULT_VALUE_TYPE
-
DEFAULT_FIELD_HANDLER
protected static final FieldHandlerIF DEFAULT_FIELD_HANDLER
-
table
protected SQLTable table
-
cols
protected String[] cols
-
alias
protected String alias
-
vtype
protected Class vtype
-
fhandler
protected FieldHandlerIF fhandler
-
-
Method Detail
-
getType
public int getType()
Description copied from interface:SQLValueIF
INTERNAL: Returns the value class type. The type is represented by one of the constants in theSQLValueIF
interface.- Specified by:
getType
in interfaceSQLValueIF
-
getArity
public int getArity()
Description copied from interface:SQLValueIF
INTERNAL: Returns the [column] arity of the value. The number represents the number of "columns" the value spans, i.e. its composite width.- Specified by:
getArity
in interfaceSQLValueIF
-
getValueArity
public int getValueArity()
Description copied from interface:SQLValueIF
INTERNAL: Returns the value arity of the value. This number refers to the number of nested values this value contains including itself. Most values therefore have a value arity of 1. Nested values may have an arity higher than 1. SQLTuple is currently the only nested value type.- Specified by:
getValueArity
in interfaceSQLValueIF
-
getAlias
public String getAlias()
Description copied from interface:SQLValueIF
INTERNAL: The column alias to use if this value is included in the projection. The SQL select syntax is typically like "select value asfrom foo". - Specified by:
getAlias
in interfaceSQLValueIF
-
setAlias
public void setAlias(String alias)
Description copied from interface:SQLValueIF
INTERNAL: Sets the column alias.- Specified by:
setAlias
in interfaceSQLValueIF
-
isReference
public boolean isReference()
Description copied from interface:SQLValueIF
INTERNAL: Returns true if this value is a reference to another.- Specified by:
isReference
in interfaceSQLValueIF
-
getReference
public SQLValueIF getReference()
Description copied from interface:SQLValueIF
INTERNAL: Returns the referenced value if one exists.- Specified by:
getReference
in interfaceSQLValueIF
-
getTable
public SQLTable getTable()
-
getColumns
public String[] getColumns()
-
getValueType
public Class getValueType()
Description copied from interface:SQLValueIF
INTERNAL: Returns the value type.- Specified by:
getValueType
in interfaceSQLValueIF
-
setValueType
public void setValueType(Class vtype)
Description copied from interface:SQLValueIF
INTERNAL: Sets the value type.- Specified by:
setValueType
in interfaceSQLValueIF
-
getFieldHandler
public FieldHandlerIF getFieldHandler()
INTERNAL: Returns the field handler for the columns. Default field handler is DefaultFieldHandler with type java.sql.Types.VARCHAR when not specified.- Specified by:
getFieldHandler
in interfaceSQLValueIF
-
setFieldHandler
public void setFieldHandler(FieldHandlerIF fhandler)
Description copied from interface:SQLValueIF
INTERNAL: Sets the field handler for the value.- Specified by:
setFieldHandler
in interfaceSQLValueIF
-
-