Here you can find the source of getDocIdString(Collection
Parameter | Description |
---|---|
docIds | a parameter |
public static String getDocIdString(Collection<String> docIds)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.util.Collection; public class Main { /**/*from ww w. j ava2 s. c o m*/ * Decodes the encoded document IDs and returns the comma-separated * String of quoted document IDs. * * @param docIds * @return comma separated list of doc ids. */ public static String getDocIdString(Collection<String> docIds) { StringBuilder docIdString = new StringBuilder(""); // TODO(bmj): This should be fixed for numeric primary keys. // Enclosing them in quotes is a SQL syntax error. for (String docId : docIds) { docIdString.append("'" + docId + "'" + ","); } return docIdString.substring(0, docIdString.length() - 1); } }