Class PostsRepositoryImpl

java.lang.Object
com.patreonshout.rest.BaseSvc
com.patreonshout.jpa.PostsRepositoryImpl

@Repository
public class PostsRepositoryImpl
extends BaseSvc
Implementation of custom Spring Data Repository for custom SQL functionality not automatically provided in JpaRepository
  • Field Summary

    Fields
    Modifier and Type Field Description
    private javax.persistence.EntityManager em
    em is the EntityManager that handles all the transactions with our database
  • Constructor Summary

    Constructors
    Constructor Description
    PostsRepositoryImpl()  
  • Method Summary

    Modifier and Type Method Description
    java.util.List<PostBean> getExistingPosts​(java.util.List<PostBean> pbList)
    getExistingPosts() checks what posts in the PostBean object list are already in the database
    private java.lang.String getUrlList​(java.util.List<PostBean> pbList)
    Gets the existing posts from a particular content creator

    Methods inherited from class com.patreonshout.rest.BaseSvc

    catchCustomException, catchSQLIntegrityConstraintViolationException

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • em

      private javax.persistence.EntityManager em
      em is the EntityManager that handles all the transactions with our database
  • Constructor Details

    • PostsRepositoryImpl

      public PostsRepositoryImpl()
  • Method Details

    • getExistingPosts

      @Transactional public java.util.List<PostBean> getExistingPosts​(java.util.List<PostBean> pbList)
      getExistingPosts() checks what posts in the PostBean object list are already in the database
      Parameters:
      pbList - is the list of PostBean objects that we want to check the database for
      Returns:
      a list of PostBean objects that were shown to be in the database
    • getUrlList

      private java.lang.String getUrlList​(java.util.List<PostBean> pbList)
      Gets the existing posts from a particular content creator
      Parameters:
      pbList - is the list of PostBean objects that we want to check the database for
      Returns:
      a list of urls from the pbList provided