29
29
import ru .mystamps .web .common .JdbcUtils ;
30
30
import ru .mystamps .web .common .LinkEntityDto ;
31
31
import ru .mystamps .web .common .RowMappers ;
32
+ import ru .mystamps .web .common .SitemapInfoDto ;
32
33
import ru .mystamps .web .support .spring .jdbc .MapStringIntegerResultSetExtractor ;
33
34
34
35
import java .util .Collections ;
@@ -56,6 +57,7 @@ public class JdbcCategoryDao implements CategoryDao {
56
57
private final String findIdsByNamesSql ;
57
58
private final String findIdsByNamePatternSql ;
58
59
private final String findCategoriesNamesWithSlugSql ;
60
+ private final String findAllForSitemapSql ;
59
61
private final String findLinkEntityBySlugSql ;
60
62
@ SuppressWarnings ("PMD.LongVariable" )
61
63
private final String findCategoriesWithParentNamesSql ;
@@ -77,6 +79,7 @@ public JdbcCategoryDao(Environment env, NamedParameterJdbcTemplate jdbcTemplate)
77
79
this .findIdsByNamesSql = env .getRequiredProperty ("category.find_ids_by_names" );
78
80
this .findIdsByNamePatternSql = env .getRequiredProperty ("category.find_ids_by_name_pattern" );
79
81
this .findCategoriesNamesWithSlugSql = env .getRequiredProperty ("category.find_all_categories_names_with_slug" );
82
+ this .findAllForSitemapSql = env .getRequiredProperty ("category.find_all_for_sitemap" );
80
83
this .findLinkEntityBySlugSql = env .getRequiredProperty ("category.find_category_link_info_by_slug" );
81
84
this .findCategoriesWithParentNamesSql = env .getRequiredProperty ("category.find_categories_with_parent_names" );
82
85
this .findFromLastCreatedSeriesByUserSql = env .getRequiredProperty ("category.find_from_last_created_series_by_user" );
@@ -210,6 +213,15 @@ public List<LinkEntityDto> findAllAsLinkEntities(String lang) {
210
213
);
211
214
}
212
215
216
+ @ Override
217
+ public List <SitemapInfoDto > findAllForSitemap () {
218
+ return jdbcTemplate .query (
219
+ findAllForSitemapSql ,
220
+ Collections .emptyMap (),
221
+ RowMappers ::forSitemapInfoDto
222
+ );
223
+ }
224
+
213
225
@ Override
214
226
public LinkEntityDto findOneAsLinkEntity (String slug , String lang ) {
215
227
Map <String , Object > params = new HashMap <>();
0 commit comments