-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34a5e68
commit d9c6bc1
Showing
10 changed files
with
58 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.capstone.potlatch; | ||
|
||
/** | ||
* Created by alvaro on 2/11/14. | ||
*/ | ||
public interface Constants { | ||
public static final String DEFAULT_PAGE_SIZE = "20"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/com/capstone/potlatch/models/GiftChainRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package com.capstone.potlatch.models; | ||
|
||
import org.springframework.data.repository.CrudRepository; | ||
import org.springframework.data.repository.PagingAndSortingRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface GiftChainRepository extends CrudRepository<GiftChain, Long>{ | ||
public interface GiftChainRepository extends PagingAndSortingRepository<GiftChain, Long> { | ||
} |
11 changes: 5 additions & 6 deletions
11
src/main/java/com/capstone/potlatch/models/GiftRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
package com.capstone.potlatch.models; | ||
|
||
import java.util.Collection; | ||
|
||
import org.springframework.data.repository.CrudRepository; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.repository.PagingAndSortingRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface GiftRepository extends CrudRepository<Gift, Long>{ | ||
// Find all gifts with a matching title | ||
public Collection<Gift> findByTitle(String title); | ||
public interface GiftRepository extends PagingAndSortingRepository<Gift, Long> { | ||
public Page<Gift> findByTitleLike(String title, Pageable pageable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
src/main/java/com/capstone/potlatch/models/UserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package com.capstone.potlatch.models; | ||
|
||
import org.springframework.data.repository.CrudRepository; | ||
import org.springframework.data.repository.PagingAndSortingRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Collection; | ||
|
||
@Repository | ||
public interface UserRepository extends CrudRepository<User, Long>{ | ||
public interface UserRepository extends PagingAndSortingRepository<User, Long> { | ||
public User findByUsername(String username); | ||
// @Query(nativeQuery = true, value = "select u.* from User as u left join Gift as g on u.id = g.user_id group by u.id order by count(g.id) desc") //Todo: hacer la query con el count | ||
// public List<User> aQuery(); | ||
} |