implement join fetch method
package won.owner.repository;
-import java.net.URI;
-
import org.springframework.data.jpa.repository.Query;
-
import won.owner.model.User;
import won.protocol.repository.WonRepository;
+import java.net.URI;
+
/**
* User: t.kozel
* Date: 11/7/13
@@ -23,4 +22,6 @@ public interface UserRepository extends WonRepository<User> {
@Query(value = "SELECT u from User u JOIN u.userNeeds n where n.uri = ?1")
public User findByNeedUri(URI needUri);
+ @Query(value = "SELECT u from User u JOIN FETCH u.keystorePasswordHolder where u.username = ?1")
+ public User findByUsernameWithKeystorePassword(String username);
}
