<commit_before>package fi.nls.oskari.wfs;

import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by SMAKINEN on 1.11.2016.
 */
public interface WFSChannelConfigMapper {
    @Select("SELECT c.wfs_layer_id, c.topic, c.description, c.params_for_search, c.is_default, c.is_address, " +
            "l.name as layerName, l.url, l.srs_name as srs, l.version, l.username, l.password " +
            " FROM oskari_wfs_search_channels c JOIN oskari_maplayer l ON c.wfs_layer_id=l.id where c.id=#{id}")
    @Results({
            @Result(property = "WFSLayerId", column = "wfs_layer_id"),
            @Result(property = "topic", column = "topic"),
            @Result(property = "desc", column = "description"),
            @Result(property = "paramsForSearch", column = "params_for_search"),
            @Result(property = "isDefault", column = "is_default"),
            @Result(property = "isAddress", column = "is_address")
    })
    WFSSearchChannelsConfiguration findChannelById(final long id);

    @Select("SELECT c.wfs_layer_id, c.topic, c.description, c.params_for_search, c.is_default, c.is_address, " +
            "l.name as layerName, l.url, l.srs_name as srs, l.version, l.username, l.password " +
            " FROM oskari_wfs_search_channels c JOIN oskari_maplayer l ON c.wfs_layer_id=l.id ORDER BY c.id ASC")
    @Results({
            @Result(property = "WFSLayerId", column = "wfs_layer_id"),
            @Result(property = "topic", column = "topic"),
            @Result(property = "desc", column = "description"),
            @Result(property = "paramsForSearch", column = "params_for_search"),
            @Result(property = "isDefault", column = "is_default"),
            @Result(property = "isAddress", column = "is_address")
    })
    List<WFSSearchChannelsConfiguration> findAll();

    @Insert("INSERT INTO oskari_wfs_search_channels (wfs_layer_id, topic, description, params_for_search, is_default, is_address) " +
            "VALUES (#{WFSLayerId}, #{topic}, #{desc}, #{paramsForSearch}, #{isDefault}, #{isAddress})")
    void insert(final WFSSearchChannelsConfiguration metadata);

    @Update("UPDATE oskari_wfs_search_channels SET " +
            "wfs_layer_id=#{WFSLayerId}, " +
            "topic=#{topic}, " +
            "description=#{desc}, " +
            "params_for_search=#{paramsForSearch}, " +
            "is_default=#{isDefault}, " +
            "is_address=#{isAddress} " +
            "WHERE id=#{id}")
    void update(final WFSSearchChannelsConfiguration config);

    @Delete("DELETE FROM oskari_wfs_search_channels WHERE id=#{id}")
    void delete(long id);
}<commit_msg>Include id in database ops<commit_after>package fi.nls.oskari.wfs;

import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by SMAKINEN on 1.11.2016.
 */
public interface WFSChannelConfigMapper {
    @Select("SELECT c.id, c.wfs_layer_id, c.topic, c.description, c.params_for_search, c.is_default, c.is_address, " +
            "l.name as layerName, l.url, l.srs_name as srs, l.version, l.username, l.password " +
            " FROM oskari_wfs_search_channels c JOIN oskari_maplayer l ON c.wfs_layer_id=l.id where c.id=#{id}")
    @Results({
            @Result(property = "WFSLayerId", column = "wfs_layer_id"),
            @Result(property = "topic", column = "topic"),
            @Result(property = "desc", column = "description"),
            @Result(property = "paramsForSearch", column = "params_for_search"),
            @Result(property = "isDefault", column = "is_default"),
            @Result(property = "isAddress", column = "is_address")
    })
    WFSSearchChannelsConfiguration findChannelById(final long id);

    @Select("SELECT c.id, c.wfs_layer_id, c.topic, c.description, c.params_for_search, c.is_default, c.is_address, " +
            "l.name as layerName, l.url, l.srs_name as srs, l.version, l.username, l.password " +
            " FROM oskari_wfs_search_channels c JOIN oskari_maplayer l ON c.wfs_layer_id=l.id ORDER BY c.id ASC")
    @Results({
            @Result(property = "WFSLayerId", column = "wfs_layer_id"),
            @Result(property = "topic", column = "topic"),
            @Result(property = "desc", column = "description"),
            @Result(property = "paramsForSearch", column = "params_for_search"),
            @Result(property = "isDefault", column = "is_default"),
            @Result(property = "isAddress", column = "is_address")
    })
    List<WFSSearchChannelsConfiguration> findAll();

    @Insert("INSERT INTO oskari_wfs_search_channels (wfs_layer_id, topic, description, params_for_search, is_default, is_address) " +
            "VALUES (#{WFSLayerId}, #{topic}, #{desc}, #{paramsForSearch}, #{isDefault}, #{isAddress})")
    @Options(useGeneratedKeys=true)
    void insert(final WFSSearchChannelsConfiguration config);

    @Update("UPDATE oskari_wfs_search_channels SET " +
            "wfs_layer_id=#{WFSLayerId}, " +
            "topic=#{topic}, " +
            "description=#{desc}, " +
            "params_for_search=#{paramsForSearch}, " +
            "is_default=#{isDefault}, " +
            "is_address=#{isAddress} " +
            "WHERE id=#{id}")
    void update(final WFSSearchChannelsConfiguration config);

    @Delete("DELETE FROM oskari_wfs_search_channels WHERE id=#{id}")
    void delete(long id);
}
{'fraction_non_alphanumeric': 0.14069223573433115, 'fraction_numerical': 0.0026192703461178674, 'mean_word_length': 3.249602543720191, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5110066', 'n_tokens_mistral': 1730, 'n_tokens_neox': 1704, 'n_words': 345}