public class SQLColumn extends java.lang.Object implements SQLColumnI
This class holds the logical name, the normalized SQL data type, and the underlying schema attribute of a column. It acts as the primary data structure for comparing the in-memory MyTISM schema with the physical database schema.
Security Contract:
The generation of the SQL fragment via getCreateStatement() strictly
utilizes the PostgreSQLDDLBuilder to guarantee safe quoting of the column
identifier, preventing SQL syntax errors and injection vulnerabilities.
| Constructor and Description |
|---|
SQLColumn(java.lang.String _name,
CBOAttributeI _attr)
Constructs a new column definition based on a schema attribute.
|
SQLColumn(java.lang.String _name,
java.lang.String _colType,
CBOAttributeI _attr)
Constructs a new column definition with a specific raw SQL type.
|
SQLColumn(java.lang.String _name,
java.lang.String _colTypeName,
int _colType,
int _colSize)
Constructs a new column directly from JDBC metadata.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(SQLColumnI o)
Checks if this column definition matches another column definition.
|
CBOAttributeI |
getAttribute() |
java.lang.String |
getColtype() |
java.lang.String |
getCreateStatement()
Generates the SQL statement fragment needed to create this column.
|
java.lang.String |
getName() |
java.lang.String |
normalizeColumnType(java.lang.String typeName,
int columnType,
int columnWidth)
Normalizes raw database type names into standard MyTISM schema types.
|
void |
setAttribute(CBOAttributeI $3) |
void |
setColtype(java.lang.String $2) |
void |
setName(java.lang.String $1) |
java.lang.String |
toString()
Returns the string representation of this column (its DDL creation fragment).
|
public SQLColumn(java.lang.String _name,
CBOAttributeI _attr)
_name - The logical name of the column._attr - The corresponding CBOAttribute definition.public SQLColumn(java.lang.String _name,
java.lang.String _colType,
CBOAttributeI _attr)
_name - The logical name of the column._colType - The raw SQL type string (e.g. "varchar(255)")._attr - The corresponding CBOAttributeI definition.public SQLColumn(java.lang.String _name,
java.lang.String _colTypeName,
int _colType,
int _colSize)
_name - The column name._colTypeName - The type name from JDBC metadata._colType - The java.sql.Types integer representation._colSize - The size/width of the column.public java.lang.String normalizeColumnType(java.lang.String typeName,
int columnType,
int columnWidth)
normalizeColumnType in interface SQLColumnItypeName - The raw type name from the database.columnType - The java.sql.Types integer representation.columnWidth - The column width/size.java.lang.IllegalArgumentException - if an unknown database type is encountered.public java.lang.String getCreateStatement()
Safely escapes the identifier using PostgreSQLDDLBuilder.quote().
getCreateStatement in interface SQLColumnI"my_column" varchar(255)).public boolean equals(SQLColumnI o)
equals in interface SQLColumnIo - The other column definition.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getName()
getName in interface SQLColumnIpublic void setName(java.lang.String $1)
public java.lang.String getColtype()
getColtype in interface SQLColumnIpublic void setColtype(java.lang.String $2)
public CBOAttributeI getAttribute()
getAttribute in interface SQLColumnIpublic void setAttribute(CBOAttributeI $3)
Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.