sql.append("index_multiplier, is_required, content_type, ");
sql
.append("display_order, is_key_field, is_unique, visible_in_face) values ");
sql.append("(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ");
QueryParser qp = new QueryParser(sql.toString());
qp.addPreparedStmtElementDefinition(id);
qp.addPreparedStmtElementDefinition(elem.getProjectId());
qp.addPreparedStmtElementDefinition(QueryParserElement.INT, elem
.getCommunityId() == -1 ? null : elem.getCommunityId());
qp.addPreparedStmtElementDefinition(elem.getElement());
qp.addPreparedStmtElementDefinition(elem.getQualifier());
qp.addPreparedStmtElementDefinition(elem.getDisplayName());
qp.addPreparedStmtElementDefinition(elem.getDescription());
qp.addPreparedStmtElementDefinition(elem.isDublinCore());
qp.addPreparedStmtElementDefinition(elem.isRepeatable());
qp.addPreparedStmtElementDefinition(elem.getValidateRegex());
qp.addPreparedStmtElementDefinition(elem.getFieldType());
qp.addPreparedStmtElementDefinition(elem.getIndexMultiplier());
qp.addPreparedStmtElementDefinition(elem.isRequired());
qp.addPreparedStmtElementDefinition(elem.getContentType());
qp.addPreparedStmtElementDefinition(getNextDisplayOrderId(elem
.getProjectId(), elem.getContentType()));
qp.addPreparedStmtElementDefinition(elem.isKeyField());
qp.addPreparedStmtElementDefinition(elem.isUnique());
qp.addPreparedStmtElementDefinition(elem.isVisibleInFace());
try {
Configuration.getConnectionPool().executeInsertOrUpdate(qp);
} catch (SQLException e) {
Logger.error("Metadata record couldn't be added", e);