38
38
public class CollectionServiceImpl implements CollectionService {
39
39
private static final Logger LOG = LoggerFactory .getLogger (CollectionServiceImpl .class );
40
40
41
- private final JdbcCollectionDao jdbcCollectionDao ;
41
+ private final JdbcCollectionDao collectionDao ;
42
42
43
43
@ Override
44
44
@ Transactional
@@ -52,7 +52,7 @@ public void createCollection(User user) {
52
52
Validate .isTrue (slug != null , "Slug for string '%s' is null" , user .getLogin ());
53
53
collection .setSlug (slug );
54
54
55
- Integer id = jdbcCollectionDao .add (collection );
55
+ Integer id = collectionDao .add (collection );
56
56
57
57
LOG .info ("Collection #{} has been created ({})" , id , collection );
58
58
}
@@ -64,10 +64,10 @@ public UrlEntityDto addToCollection(Integer userId, Integer seriesId) {
64
64
Validate .isTrue (userId != null , "User id must be non null" );
65
65
Validate .isTrue (seriesId != null , "Series id must be non null" );
66
66
67
- UrlEntityDto url = jdbcCollectionDao .findCollectionUrlEntityByUserId (userId );
67
+ UrlEntityDto url = collectionDao .findCollectionUrlEntityByUserId (userId );
68
68
Integer collectionId = url .getId ();
69
69
70
- jdbcCollectionDao .addSeriesToCollection (collectionId , seriesId );
70
+ collectionDao .addSeriesToCollection (collectionId , seriesId );
71
71
72
72
LOG .info (
73
73
"Series #{} has been added to collection #{} of user #{}" ,
@@ -86,10 +86,10 @@ public UrlEntityDto removeFromCollection(Integer userId, Integer seriesId) {
86
86
Validate .isTrue (userId != null , "User id must be non null" );
87
87
Validate .isTrue (seriesId != null , "Series id must be non null" );
88
88
89
- UrlEntityDto url = jdbcCollectionDao .findCollectionUrlEntityByUserId (userId );
89
+ UrlEntityDto url = collectionDao .findCollectionUrlEntityByUserId (userId );
90
90
Integer collectionId = url .getId ();
91
91
92
- jdbcCollectionDao .removeSeriesFromCollection (collectionId , seriesId );
92
+ collectionDao .removeSeriesFromCollection (collectionId , seriesId );
93
93
94
94
LOG .info (
95
95
"Series #{} has been removed from collection of user #{}" ,
@@ -110,7 +110,7 @@ public boolean isSeriesInCollection(Integer userId, Integer seriesId) {
110
110
return false ;
111
111
}
112
112
113
- boolean isSeriesInCollection = jdbcCollectionDao .isSeriesInUserCollection (userId , seriesId );
113
+ boolean isSeriesInCollection = collectionDao .isSeriesInUserCollection (userId , seriesId );
114
114
115
115
LOG .debug (
116
116
"Series #{} belongs to collection of user #{}: {}" ,
@@ -125,15 +125,15 @@ public boolean isSeriesInCollection(Integer userId, Integer seriesId) {
125
125
@ Override
126
126
@ Transactional (readOnly = true )
127
127
public long countCollectionsOfUsers () {
128
- return jdbcCollectionDao .countCollectionsOfUsers ();
128
+ return collectionDao .countCollectionsOfUsers ();
129
129
}
130
130
131
131
@ Override
132
132
@ Transactional (readOnly = true )
133
133
public Iterable <LinkEntityDto > findRecentlyCreated (int quantity ) {
134
134
Validate .isTrue (quantity > 0 , "Quantity must be greater than 0" );
135
135
136
- return jdbcCollectionDao .findLastCreated (quantity );
136
+ return collectionDao .findLastCreated (quantity );
137
137
}
138
138
139
139
}
0 commit comments