Skip to content

Commit 1927c79

Browse files
committed
refractor: remove useless option to optimize mongo index
1 parent a2165c0 commit 1927c79

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/main/java/org/apereo/openlrw/oneroster/service/EnrollmentService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
/**
2626
* @author ggilbert
2727
* @author xchopin <xavier.chopin@univ-lorraine.fr>
28-
*
2928
*/
29+
3030
@Service
3131
public class EnrollmentService {
3232

src/main/java/org/apereo/openlrw/oneroster/service/UserService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public UserService(MongoUserRepository mongoUserRepository, MongoOperations mong
4141

4242
public User findBySourcedId(final String tenantId, final String orgId, final String userSourcedId) throws UserNotFoundException {
4343

44-
MongoUser mongoUser = mongoUserRepository.findByTenantIdAndOrgIdAndUserSourcedIdIgnoreCase(tenantId, orgId, userSourcedId);
44+
MongoUser mongoUser = mongoUserRepository.findByTenantIdAndOrgIdAndUserSourcedId(tenantId, orgId, userSourcedId);
4545
if (mongoUser == null) {
4646
throw new UserNotFoundException("User not found");
4747
}
@@ -75,7 +75,7 @@ public boolean delete(final String tenantId, final String orgId, final String us
7575
if (StringUtils.isBlank(tenantId) || StringUtils.isBlank(orgId) || StringUtils.isBlank(userId))
7676
throw new IllegalArgumentException();
7777

78-
return mongoUserRepository.deleteByTenantIdAndOrgIdAndUserSourcedIdIgnoreCase(tenantId, orgId, userId) > 0;
78+
return mongoUserRepository.deleteByTenantIdAndOrgIdAndUserSourcedId(tenantId, orgId, userId) > 0;
7979
}
8080

8181
/**
@@ -143,7 +143,7 @@ public User save(final String tenantId, final String orgId, User user, boolean c
143143
MongoUser mongoUserToSave, existingMongoUser = null;
144144

145145
if (check)
146-
existingMongoUser = mongoUserRepository.findByTenantIdAndOrgIdAndUserSourcedIdIgnoreCase(tenantId, orgId, user.getSourcedId());
146+
existingMongoUser = mongoUserRepository.findByTenantIdAndOrgIdAndUserSourcedId(tenantId, orgId, user.getSourcedId());
147147

148148
if (existingMongoUser == null) {
149149
mongoUserToSave = new MongoUser.Builder()

src/main/java/org/apereo/openlrw/oneroster/service/repository/MongoUserRepository.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
*/
1111

1212
public interface MongoUserRepository extends MongoRepository<MongoUser, String> {
13-
14-
MongoUser findByTenantIdAndOrgIdAndUserSourcedIdIgnoreCase(String tenantId, String orgId, String userSourcedId);
15-
13+
MongoUser findByTenantIdAndOrgIdAndUserSourcedId(String tenantId, String orgId, String userSourcedId);
1614
Collection<MongoUser> findByTenantIdAndOrgId(final String tenantId, final String orgId);
17-
18-
Long deleteByTenantIdAndOrgIdAndUserSourcedIdIgnoreCase(String tenantId, String orgId, String userSourcedId);
19-
15+
Long deleteByTenantIdAndOrgIdAndUserSourcedId(String tenantId, String orgId, String userSourcedId);
2016
}

0 commit comments

Comments
 (0)