/**
* I18n messages
*/
static interface i18n {
// i18n[PostgreSqlXmlTypeDataTypeComponent.cellErrorMsg=<Error: see log file>]
// i18n[OracleXmlTypeDataTypeComponent.cellErrorMsg=<Error: see log file>]
String CELL_ERROR_MSG = s_stringMgr.getString( [[#variable18d644e0]]);
}
/* IDataTypeComponent interface methods
/**
* @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#canDoFileIO()
*/
public boolean canDoFileIO() {
return true;
}
[[#variable18d64460]]String getClassName() {
return "java.lang.String";
}
/**
* @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#getDefaultValue(java.lang.String)
*/
public Object getDefaultValue(String dbDefaultValue) {
// At the moment, no default value
if (s_log.isInfoEnabled()) {
s_log.info("getDefaultValue: not yet implemented");
}
return [[#variable18d643a0]];
}
[[#variable18d64460]]String getWhereClauseValue(Object value, ISQLDatabaseMetaData md) {
// This results in "ERROR: operator does not exist: xml = unknown"
// return _colDef.getLabel() + "='" + SQLUtilities.escapeLine(value.toString(), md) + "'";
//
// So don't use xml type column in where clauses if it has a non-null value for now (which is what the
// base class implementation provides).
//
/*
* For Oracle 10g we could say something like :
*
* "where XMLSERIALIZE(CONTENT " + _colDef.getLabel() +") like '<value>'"
*
* This doesn't appear to work on Oracle 9i at the moment, so we will
* avoid using this column in any where clause if the value is non-null,
* which is what the superclass implementation does.
*
* TODO: Find a way to do this for both versions or split this behavior
* so that it works on 10g and is disabled on 9i.
*/
return super.getWhereClauseValue(value, md);
}
/**
* This Data Type can be edited in a table cell as long as there are no issues displaying the data. If we
* detect our error message in the cell, then we should prevent the user from editing the cell (our error
* message is not meant to be valid XML data; further, we don't want to let the user whack their data with
* our tool accidentally)
*
* @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInCell(java.lang.Object)
*/
/**
* This Data Type can be edited in a table cell as long as there are no issues using the XDK to display the
* data. If we should encounter Exceptions using XDK, then we should prevent the user from editing the cell
* (our error message is not meant to be valid XML data; further, we don't want to let the user whack their
* data with our tool accidentally)
*
* @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInCell(java.lang.Object)
*/
public boolean isEditableInCell(Object originalValue) {
return !i18n.CELL_ERROR_MSG.equals(originalValue);
}
/**
* This Data Type can be edited in a popup as long as there are no issues displaying the data. If we
* detect our error message in the cell, then we should prevent the user from editing the cell (our error
* message is not meant to be valid XML data; further, we don't want to let the user whack their data with
* our tool accidentally)
*
* @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInPopup(java.lang.Object)
*/
/**
* This Data Type can be edited in a popup as long as there are no issues using the XDK to display the
* data. If we should encounter Exceptions using XDK, then we should prevent the user from editing the cell
* (our error message is not meant to be valid XML data; further, we don't want to let the user whack their
* data with our tool accidentally)
*
* @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#isEditableInPopup(java.lang.Object)
*/
public boolean isEditableInPopup(Object originalValue) {
return !i18n.CELL_ERROR_MSG.equals(originalValue);
}
/**
* @see net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.IDataTypeComponent#needToReRead(java.lang.Object)
*/
public boolean needToReRead(Object originalValue) {
return false;
}
|