/**
 * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
 *
 * 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 io.gravitee.repository.jdbc.management;

import io.gravitee.repository.jdbc.orm.JdbcObjectMapper;
import io.gravitee.repository.management.api.ParameterRepository;
import io.gravitee.repository.management.model.Parameter;
import org.springframework.stereotype.Repository;

import java.sql.Types;

/**
 *
 * @author njt
 */
@Repository
public class JdbcParameterRepository extends JdbcAbstractCrudRepository<Parameter, String> implements ParameterRepository {

    private static final JdbcObjectMapper ORM = JdbcObjectMapper.builder(Parameter.class, "parameters", "key")
            .addColumn("key", Types.NVARCHAR, String.class)
            .addColumn("value", Types.NVARCHAR, String.class)
            .build();

    @Override
    protected JdbcObjectMapper getOrm() {
        return ORM;
    }

    @Override
    protected String getId(Parameter item) {
        return item.getKey();
    }
}
@@ -686,24 +686,86 @@
 agement;%0D%0A%0D%0A
+import io.gravitee.repository.exceptions.TechnicalException;%0D%0A
 import io.gr
@@ -952,70 +952,418 @@
 rg.s
-pringframework.stereotype.Repository;%0D%0A%0D%0Aimport java.sql.Types
+lf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;%0D%0Aimport org.springframework.stereotype.Repository;%0D%0A%0D%0Aimport java.sql.PreparedStatement;%0D%0Aimport java.sql.Types;%0D%0Aimport java.util.ArrayList;%0D%0Aimport java.util.Collections;%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport static io.gravitee.repository.jdbc.common.AbstractJdbcRepositoryConfiguration.escapeReservedWord;%0D%0Aimport static org.springframework.util.StringUtils.isEmpty
 ;%0D%0A%0D
@@ -1368,20 +1368,16 @@
 %0A%0D%0A/**%0D%0A
- *%0D%0A
  * @auth
@@ -1384,16 +1384,118 @@
 or njt%0D%0A
+ * @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)%0D%0A * @author GraviteeSource Team%0D%0A *%0D%0A
  */%0D%0A@Re
@@ -1627,24 +1627,124 @@
 sitory %7B%0D%0A%0D%0A
+    private static final Logger LOGGER = LoggerFactory.getLogger(JdbcParameterRepository.class);%0D%0A%0D%0A
     private 
@@ -2178,10 +2178,884 @@
 %0D%0A    %7D%0D
+%0A%0D%0A    @Override%0D%0A    public List%3CParameter%3E findAll(List%3CString%3E keys) throws TechnicalException %7B%0D%0A        LOGGER.debug(%22JdbcParameterRepository.findAll(%7B%7D)%22, keys);%0D%0A        try %7B%0D%0A            if (isEmpty(keys)) %7B%0D%0A                return Collections.emptyList();%0D%0A            %7D%0D%0A            List%3CParameter%3E parameters = jdbcTemplate.query(%22select * from parameters where %22 + escapeReservedWord(%22key%22) + %22 in ( %22%0D%0A                            + ORM.buildInClause(keys) + %22 )%22%0D%0A                    , (PreparedStatement ps) -%3E ORM.setArguments(ps, keys, 1)%0D%0A                    , ORM.getRowMapper()%0D%0A            );%0D%0A            return new ArrayList%3C%3E(parameters);%0D%0A        %7D catch (final Exception ex) %7B%0D%0A            LOGGER.error(%22Failed to find parameters by keys:%22, ex);%0D%0A            throw new TechnicalException(%22Failed to find parameters by keys%22, ex);%0D%0A        %7D%0D%0A    %7D%0D
 %0A%7D

move constants.json config to database