This commit is contained in:
krishan-gandhi2 2017-12-30 15:49:08 +05:30 committed by Grzegorz Piwowarek
parent 91be3244f2
commit b5c7ffeb19
4 changed files with 17 additions and 13 deletions

View File

@ -36,12 +36,16 @@
<artifactId>katharsis-servlet</artifactId> <artifactId>katharsis-servlet</artifactId>
<version>${katharsis.version}</version> <version>${katharsis.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.10</version>
</dependency>
</dependencies> </dependencies>
<properties> <properties>
<katharsis.version>1.0.1</katharsis.version> <katharsis.version>2.1.3</katharsis.version>
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version> <cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
</properties> </properties>

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.katharsis; package org.baeldung.persistence.katharsis;
import io.katharsis.queryParams.RequestParams; import io.katharsis.queryParams.QueryParams;
import io.katharsis.repository.ResourceRepository; import io.katharsis.repository.ResourceRepository;
import org.baeldung.persistence.dao.RoleRepository; import org.baeldung.persistence.dao.RoleRepository;
@ -15,17 +15,17 @@ public class RoleResourceRepository implements ResourceRepository<Role, Long> {
private RoleRepository roleRepository; private RoleRepository roleRepository;
@Override @Override
public Role findOne(Long id, RequestParams params) { public Role findOne(Long id, QueryParams params) {
return roleRepository.findOne(id); return roleRepository.findOne(id);
} }
@Override @Override
public Iterable<Role> findAll(RequestParams params) { public Iterable<Role> findAll(QueryParams params) {
return roleRepository.findAll(); return roleRepository.findAll();
} }
@Override @Override
public Iterable<Role> findAll(Iterable<Long> ids, RequestParams params) { public Iterable<Role> findAll(Iterable<Long> ids, QueryParams params) {
return roleRepository.findAll(ids); return roleRepository.findAll(ids);
} }

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.katharsis; package org.baeldung.persistence.katharsis;
import io.katharsis.queryParams.RequestParams; import io.katharsis.queryParams.QueryParams;
import io.katharsis.repository.ResourceRepository; import io.katharsis.repository.ResourceRepository;
import org.baeldung.persistence.dao.UserRepository; import org.baeldung.persistence.dao.UserRepository;
@ -15,17 +15,17 @@ public class UserResourceRepository implements ResourceRepository<User, Long> {
private UserRepository userRepository; private UserRepository userRepository;
@Override @Override
public User findOne(Long id, RequestParams params) { public User findOne(Long id, QueryParams params) {
return userRepository.findOne(id); return userRepository.findOne(id);
} }
@Override @Override
public Iterable<User> findAll(RequestParams params) { public Iterable<User> findAll(QueryParams params) {
return userRepository.findAll(); return userRepository.findAll();
} }
@Override @Override
public Iterable<User> findAll(Iterable<Long> ids, RequestParams params) { public Iterable<User> findAll(Iterable<Long> ids, QueryParams params) {
return userRepository.findAll(ids); return userRepository.findAll(ids);
} }

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.katharsis; package org.baeldung.persistence.katharsis;
import io.katharsis.queryParams.RequestParams; import io.katharsis.queryParams.QueryParams;
import io.katharsis.repository.RelationshipRepository; import io.katharsis.repository.RelationshipRepository;
import java.util.HashSet; import java.util.HashSet;
@ -52,13 +52,13 @@ public class UserToRoleRelationshipRepository implements RelationshipRepository<
} }
@Override @Override
public Role findOneTarget(Long sourceId, String fieldName, RequestParams requestParams) { public Role findOneTarget(Long sourceId, String fieldName, QueryParams QueryParams) {
// not for many-to-many // not for many-to-many
return null; return null;
} }
@Override @Override
public Iterable<Role> findManyTargets(Long sourceId, String fieldName, RequestParams requestParams) { public Iterable<Role> findManyTargets(Long sourceId, String fieldName, QueryParams QueryParams) {
final User user = userRepository.findOne(sourceId); final User user = userRepository.findOne(sourceId);
return user.getRoles(); return user.getRoles();
} }