org.onetwo.common.db.filequery.OneCommentBasedSqlFileParser Maven / Gradle / Ivy
The newest version!
package org.onetwo.common.db.filequery;
import java.util.List;
import java.util.Properties;
import org.onetwo.common.db.spi.NamedQueryInfoParser;
import org.onetwo.common.propconf.JFishProperties;
import org.onetwo.common.propconf.ResourceAdapter;
import org.onetwo.common.utils.LangUtils;
import org.onetwo.common.utils.StringUtils;
/****
* --@queryname
* [email protected] = template
*
* @author way
*
*/
@Deprecated
public class OneCommentBasedSqlFileParser extends DefaultSqlFileParser implements NamedQueryInfoParser {
// public static final String GLOBAL_NS_KEY = "global";
// public static final String COMMENT = "--";
// public static final String MULTIP_COMMENT_START = "/*";
// public static final String MULTIP_COMMENT_END = "*/";
public static final String CONFIG_PREFIX = "--@@";
public static final String NAME_PREFIX = "--@";
// public static final String EQUALS_MARK = "=";
@Override
protected JFishPropertiesData loadSqlFile(ResourceAdapter> f){
// String fname = FileUtils.getFileNameWithoutExt(f.getName());
if(!f.getName().endsWith(POSTFIX)){
logger.info("file["+f.getName()+" is not a ["+POSTFIX+"] file, ignore it.");
return null;
}
JFishPropertiesData jpData = null;
Properties pf = new Properties();
Properties config = new Properties();
try {
List fdatas = readResourceAsList(f);
String key = null;
StringBuilder value = null;
// String line = null;
boolean matchConfig = false;
boolean matchName = false;
boolean multiCommentStart = false;
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy