Public Member Functions | |
DatabaseColumn (String name, boolean isUnique) | |
DatabaseColumn (String name, boolean isUnique, int type) | |
String | getName () |
boolean | isUnique () |
void | setIsUnique (boolean bool) |
int | getType () |
boolean | equals (Object other) |
boolean | equalsIgnoreType (Object other) |
String | getXml () |
DatabaseColumn
represents a column of a database table. It is composed of a name, type (not used yet) and a boolean indicated whether or not rows are unique or not (like primary keys or columns created explicitely with the UNIQUE
keyword).
Definition at line 42 of file DatabaseColumn.java.
|
Creates a new
Definition at line 63 of file DatabaseColumn.java. 00064 {
00065 this(name, isUnique, Types.NULL);
00066 }
|
|
Creates a new
Definition at line 77 of file DatabaseColumn.java. 00078 { 00079 if (name == null) 00080 throw new IllegalArgumentException("Illegal null column name in DatabaseColumn constructor"); 00081 00082 this.name = name; 00083 this.isUnique = isUnique; 00084 this.type = type; 00085 }
|
|
Two
Definition at line 139 of file DatabaseColumn.java. References org.objectweb.cjdbc.common.sql.schema.DatabaseColumn.getName(), org.objectweb.cjdbc.common.sql.schema.DatabaseColumn.getType(), and org.objectweb.cjdbc.common.sql.schema.DatabaseColumn.isUnique. 00140 { 00141 if ((other == null) || !(other instanceof DatabaseColumn)) 00142 return false; 00143 00144 DatabaseColumn c = (DatabaseColumn) other; 00145 return (isUnique == c.isUnique()) 00146 && name.equals(c.getName()) 00147 && (type == c.getType()); 00148 }
|
|
This function is the same as equal but ignores the column type.
Definition at line 157 of file DatabaseColumn.java. References org.objectweb.cjdbc.common.sql.schema.DatabaseColumn.getName(), and org.objectweb.cjdbc.common.sql.schema.DatabaseColumn.isUnique. Referenced by org.objectweb.cjdbc.common.sql.schema.DatabaseTable.equalsIgnoreType(), and org.objectweb.cjdbc.common.sql.schema.DatabaseTable.mergeColumns(). 00158 { 00159 if ((other == null) || !(other instanceof DatabaseColumn)) 00160 return false; 00161 00162 DatabaseColumn c = (DatabaseColumn) other; 00163 return (isUnique == c.isUnique()) && name.equals(c.getName()); 00164 }
|
|
|
Returns the column type according to
Definition at line 127 of file DatabaseColumn.java. Referenced by org.objectweb.cjdbc.common.sql.schema.DatabaseColumn.equals(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseDynamicMetaData.getColumns(), and org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseDynamicMetaData.getPrimaryKeys(). 00128 {
00129 return type;
00130 }
|
|
Get xml information about this column.
Definition at line 171 of file DatabaseColumn.java. 00172 { 00173 StringBuffer info = new StringBuffer(); 00174 info.append( 00175 "<" 00176 + DatabasesXmlTags.ELT_DatabaseColumn 00177 + " " 00178 + DatabasesXmlTags.ATT_columnName 00179 + "=\"" 00180 + name 00181 + "\" " 00182 + DatabasesXmlTags.ATT_isUnique 00183 + "=\"" 00184 + isUnique 00185 + "\">"); 00186 info.append("</" + DatabasesXmlTags.ELT_DatabaseColumn + ">"); 00187 return info.toString(); 00188 }
|
|
Tests if the column has a
Definition at line 104 of file DatabaseColumn.java. 00105 {
00106 return isUnique;
00107 }
|
|
Sets the value of isUnique.
Definition at line 115 of file DatabaseColumn.java. Referenced by org.objectweb.cjdbc.common.sql.CreateRequest.parse(). 00116 { 00117 isUnique = bool; 00118 }
|