
br.com.anteros.persistence.parameter.NamedParameterParserResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Anteros-Persistence-Core Show documentation
Show all versions of Anteros-Persistence-Core Show documentation
Anteros Persistence Core for Java.
/*******************************************************************************
* Copyright 2012 Anteros Tecnologia
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package br.com.anteros.persistence.parameter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import br.com.anteros.core.resource.messages.AnterosBundle;
import br.com.anteros.core.resource.messages.AnterosResourceBundle;
import br.com.anteros.persistence.resource.messages.AnterosPersistenceCoreMessages;
import br.com.anteros.persistence.session.configuration.AnterosPersistenceProperties;
public class NamedParameterParserResult {
private static AnterosBundle MESSAGES = AnterosResourceBundle.getBundle(AnterosPersistenceProperties.ANTEROS_PERSISTENCE_CORE,AnterosPersistenceCoreMessages.class);
private String parsedSql;
private Map parsedParams = new LinkedHashMap();
public String getParsedSql() {
return parsedSql;
}
public void setParsedSql(String parsedSql) {
this.parsedSql = parsedSql;
}
public Map getParsedParams() {
return parsedParams;
}
public void setParsedParams(Map parsedParams) {
this.parsedParams = parsedParams;
}
@Override
public String toString() {
return MESSAGES.getMessage(NamedParameterParserResult.class.getSimpleName()+".toString", parsedSql, parsedParams);
}
public List getNamedParameters() {
List result = new ArrayList();
for (String param : parsedParams.keySet()) {
result.add(new NamedParameter(param));
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy