private String getUpdateConditions(Column cl) throws IOException, SQLException { PropertyMap map = cl.getProperties(); Property exprp = map.get(PropertyMap.EXPRESSION_PROP); if (exprp != null) { Set<String> setu = SQLConverter.getFormulaDependencies(exprp.getValue().toString()); if (setu.size() > 0) { String or = ""; StringBuffer cw = new StringBuffer(); for (String dep : setu) { dep = escapeIdentifier(dep); cw.append(or).append("oldrow.").append(dep).append("<>").append("newrow.").append(dep); or = " OR "; } return cw.toString(); } } return " FALSE "; }
for(PropertyMapImpl propMap : maps) { for(PropertyMap.Property prop : propMap) { propNames.add(prop.getName());
parentMetadata.add(JackcessParser.MDB_PROPERTY_PREFIX + p.getName(), toString(p.getValue(), p.getType())); parentMetadata.add(JackcessParser.USER_DEFINED_PROPERTY_PREFIX+ p.getName(), toString(p.getValue(), p.getType())); parentMetadata.set(TikaCoreProperties.TITLE, toString(title.getValue(), title.getType())); found.add(title.getName()); if (author != null && author.getValue() != null) { String authorString = toString(author.getValue(), author.getType()); SummaryExtractor.addMulti(parentMetadata, TikaCoreProperties.CREATOR, authorString); found.add(author.getName()); parentMetadata.set(OfficeOpenXMLExtended.COMPANY, toString(company.getValue(), company.getType())); found.add(company.getName()); if (! found.contains(p.getName())) { parentMetadata.add(JackcessParser.SUMMARY_PROPERTY_PREFIX + p.getName(), toString(p.getValue(), p.getType()));
parentMetadata.add(JackcessParser.MDB_PROPERTY_PREFIX + p.getName(), toString(p.getValue(), p.getType())); parentMetadata.add(JackcessParser.USER_DEFINED_PROPERTY_PREFIX+ p.getName(), toString(p.getValue(), p.getType())); parentMetadata.set(TikaCoreProperties.TITLE, toString(title.getValue(), title.getType())); found.add(title.getName()); if (author != null && author.getValue() != null) { String authorString = toString(author.getValue(), author.getType()); SummaryExtractor.addMulti(parentMetadata, TikaCoreProperties.CREATOR, authorString); found.add(author.getName()); parentMetadata.set(OfficeOpenXMLExtended.COMPANY, toString(company.getValue(), company.getType())); found.add(company.getName()); if (! found.contains(p.getName())) { parentMetadata.add(JackcessParser.SUMMARY_PROPERTY_PREFIX + p.getName(), toString(p.getValue(), p.getType()));
parentMetadata.add(JackcessParser.MDB_PROPERTY_PREFIX + p.getName(), toString(p.getValue(), p.getType())); parentMetadata.add(JackcessParser.USER_DEFINED_PROPERTY_PREFIX+ p.getName(), toString(p.getValue(), p.getType())); parentMetadata.set(TikaCoreProperties.TITLE, toString(title.getValue(), title.getType())); found.add(title.getName()); if (author != null && author.getValue() != null) { String authorString = toString(author.getValue(), author.getType()); SummaryExtractor.addMulti(parentMetadata, TikaCoreProperties.CREATOR, authorString); found.add(author.getName()); parentMetadata.set(OfficeOpenXMLExtended.COMPANY, toString(company.getValue(), company.getType())); found.add(company.getName()); if (! found.contains(p.getName())) { parentMetadata.add(JackcessParser.SUMMARY_PROPERTY_PREFIX + p.getName(), toString(p.getValue(), p.getType()));
/** * Sets all attributes except name from the given Column template (including * all column properties except GUID). */ public ColumnBuilder setFromColumn(Column template) throws IOException { DataType type = template.getType(); setType(type); setLength(template.getLength()); setAutoNumber(template.isAutoNumber()); if(type.getHasScalePrecision()) { setScale(template.getScale()); setPrecision(template.getPrecision()); } setCalculated(template.isCalculated()); setCompressedUnicode(template.isCompressedUnicode()); setHyperlink(template.isHyperlink()); if(template instanceof ColumnImpl) { setTextSortOrder(((ColumnImpl)template).getTextSortOrder()); } PropertyMap colProps = template.getProperties(); for(PropertyMap.Property colProp : colProps) { // copy everything but guid if(!PropertyMap.GUID_PROP.equalsIgnoreCase(colProp.getName())) { setProperty(colProp.getName(), colProp); } } return this; }
private String getExpression(Column cl) throws IOException { PropertyMap map = cl.getProperties(); Property exprp = map.get(PropertyMap.EXPRESSION_PROP); if (exprp != null) { Table tl = cl.getTable(); String expr = SQLConverter.convertPowOperator((String) exprp.getValue()); for (Column cl1 : tl.getColumns()) { expr = expr.replaceAll("\\[(?i)(" + Pattern.quote(cl1.getName()) + ")\\]", "newrow.$0"); } return expr; } return null; }
private Object readColumnProperty(com.healthmarketscience.jackcess.Column column, String propertyName, Object defaultValue) throws IOException { PropertyMap.Property property = column.getProperties().get(propertyName); if (property != null) return property.getValue(); return defaultValue; }
@Override public void putAll(Iterable<? extends Property> props) { if(props == null) { return; } for(Property prop : props) { if(isPrimaryKey(prop.getName())) { ((PropertyMapImpl)_primary).put(prop); } else { ((PropertyMapImpl)_complex).put(prop); } } }
@Override public Object getValue(String name, Object defaultValue) { Property prop = get(name); return ((prop != null) ? prop.getValue() : defaultValue); }
private DataType getReturnType(Column cl) throws IOException { if (cl.getProperties().get(PropertyMap.EXPRESSION_PROP) == null || cl.getProperties().get(PropertyMap.RESULT_TYPE_PROP) == null) { return null; } byte pos = (Byte) cl.getProperties().get(PropertyMap.RESULT_TYPE_PROP).getValue(); return DataType.fromByte(pos); }