private boolean isRichText(Column c) throws IOException { if (c == null) { return false; } PropertyMap m = c.getProperties(); if (m == null) { return false; } if (c.getType() == null || ! c.getType().equals(DataType.MEMO)) { return false; } Object b = m.getValue(TEXT_FORMAT_KEY); if (b instanceof Byte) { if (((Byte)b).byteValue() == RICH_TEXT_FORMAT) { return true; } } return false; }
public static String getTrimmedStringProperty( PropertyMap props, String propName) { return DatabaseImpl.trimToNull((String)props.getValue(propName)); }
public String defaultValue4SQL(Column cl) throws SQLException, IOException { PropertyMap pm = cl.getProperties(); Object defaulT = pm.getValue(PropertyMap.DEFAULT_VALUE_PROP); if (defaulT == null) { return null; } return this.tablesLoader.defaultValue4SQL(defaulT, cl.getType()); }
private void setHsqldbNotNull(String tableName, String columnName, String type, Column cl) throws SQLException, IOException { UcanaccessConnection conn = UcanaccessConnection.getCtxConnection(); Boolean req = (Boolean) cl.getProperties().getValue(PropertyMap.REQUIRED_PROP); req = req != null && req; Statement stNN = null; try { if (req) { stNN = conn.getHSQLDBConnection().createStatement(); stNN.execute(SQLConverter .convertSQL("ALTER TABLE " + tableName + " ALTER COLUMN " + columnName + " SET NOT NULL ") .getSql()); } } finally { if (stNN != null) { stNN.close(); } } }
private boolean isRichText(Column c) throws IOException { if (c == null) { return false; } PropertyMap m = c.getProperties(); if (m == null) { return false; } if (c.getType() == null || ! c.getType().equals(DataType.MEMO)) { return false; } Object b = m.getValue(TEXT_FORMAT_KEY); if (b instanceof Byte) { if (((Byte)b).byteValue() == RICH_TEXT_FORMAT) { return true; } } return false; }
@Override public FileFormat getFileFormat() throws IOException { if(_fileFormat == null) { Map<String,FileFormat> possibleFileFormats = getFormat().getPossibleFileFormats(); if(possibleFileFormats.size() == 1) { // single possible format (null key), easy enough _fileFormat = possibleFileFormats.get(null); } else { // need to check the "AccessVersion" property String accessVersion = (String)getDatabaseProperties().getValue( PropertyMap.ACCESS_VERSION_PROP); if(isBlank(accessVersion)) { // no access version, fall back to "generic" accessVersion = null; } _fileFormat = possibleFileFormats.get(accessVersion); if(_fileFormat == null) { throw new IllegalStateException(withErrorContext( "Could not determine FileFormat")); } } } return _fileFormat; }
private boolean isRichText(Column c) throws IOException { if (c == null) { return false; } PropertyMap m = c.getProperties(); if (m == null) { return false; } if (c.getType() == null || ! c.getType().equals(DataType.MEMO)) { return false; } Object b = m.getValue(TEXT_FORMAT_KEY); if (b instanceof Byte) { if (((Byte)b).byteValue() == RICH_TEXT_FORMAT) { return true; } } return false; }
private void setDefaultValue(Column cl, String ntn, List<String> arTrigger) throws IOException, SQLException { PropertyMap pm = cl.getProperties(); String ncn = procedureEscapingIdentifier(cl.getName()); Object defaulT = pm.getValue(PropertyMap.DEFAULT_VALUE_PROP); if (defaulT != null) { String default4SQL = defaultValue4SQL(defaulT, cl.getType());
Object required = pm.getValue(PropertyMap.REQUIRED_PROP); if (constraints && required != null && required instanceof Boolean && ((Boolean) required)) { sbC.append(" NOT NULL ");
String calcExpr = (String)props.getValue(PropertyMap.EXPRESSION_PROP); calcCol = new CalcColEvalContext(this).setExpr(calcExpr); boolean required = (Boolean)props.getValue(PropertyMap.REQUIRED_PROP, Boolean.FALSE); if(required) { (Boolean)props.getValue(PropertyMap.ALLOW_ZERO_LEN_PROP, Boolean.TRUE); if(!allowZeroLen) {
Byte resultType = (Byte)colProps.getValue(PropertyMap.RESULT_TYPE_PROP); if(resultType != null) { colType = resultType;