ca.shiftfocus.krispii.core.repositories

UserRepositoryPostgres

Related Doc: package repositories

class UserRepositoryPostgres extends UserRepository with PostgresRepository[User]

Linear Supertypes
PostgresRepository[User], UserRepository, Repository, Lifting[error.RepositoryError.Fail], Serialized, FutureMonad, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. UserRepositoryPostgres
  2. PostgresRepository
  3. UserRepository
  4. Repository
  5. Lifting
  6. Serialized
  7. FutureMonad
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UserRepositoryPostgres()

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. val Delete: String

  5. val Fields: String

  6. val FieldsWithTable: String

  7. val FieldsWithoutHash: String

  8. val Insert: String

  9. val OrderBy: String

  10. val QMarks: String

  11. val SelectAll: String

  12. val SelectAllWithCourse: String

  13. val SelectAllWithRole: String

  14. val SelectOne: String

  15. val SelectOneByIdentifier: String

  16. val Table: String

  17. val UpdateNoPass: String

  18. val UpdateWithPass: String

  19. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  20. def buildEntity[B](maybeResultSet: Option[ResultSet], build: (RowData) ⇒ B): \/[error.RepositoryError.Fail, B]

    Generic method to build an entity from postgresql database results, since the postgresql database may not return results.

    Generic method to build an entity from postgresql database results, since the postgresql database may not return results.

    B

    the type of entity to be built

    maybeResultSet

    an optional ResultSet returned from the database

    build

    a function that can build entities of type A from a RowData object

    returns

    a disjunction containing either a RepositoryError.Fail, or an object of type A

    Attributes
    protected
    Definition Classes
    PostgresRepository
  21. def buildEntityList[B](maybeResultSet: Option[ResultSet], build: (RowData) ⇒ B): \/[error.RepositoryError.Fail, IndexedSeq[B]]

    Generic method to build a list of entities from postgresql database results, since the postgresql database may not return results.

    Generic method to build a list of entities from postgresql database results, since the postgresql database may not return results.

    TODO: check in which case the database driver will return "None" instead of Some(ResultSet)

    B

    the type of entity to be built

    maybeResultSet

    an optional ResultSet returned from the database

    build

    a function that can build entities of type A from a RowData object

    returns

    a disjunction containing either a RepositoryError.Fail, or an object of type A

    Attributes
    protected
    Definition Classes
    PostgresRepository
  22. def cacheComponentKey(compId: UUID): String

    Definition Classes
    Repository
  23. def cacheComponentsKey(id: UUID): String

    Definition Classes
    Repository
  24. def cacheCourseKey(id: UUID): String

    Definition Classes
    Repository
  25. def cacheCourseSlugKey(slug: String): String

    Definition Classes
    Repository
  26. def cacheCoursesKey(id: UUID): String

    Definition Classes
    Repository
  27. def cacheExceptionKey(id: UUID): String

    Definition Classes
    Repository
  28. def cacheExceptionsKey(courseId: UUID, userId: UUID): String

    Definition Classes
    Repository
  29. def cacheExceptionsKey(courseId: UUID): String

    Definition Classes
    Repository
  30. def cachePartKey(id: UUID): String

    Definition Classes
    Repository
  31. def cachePartPosKey(projectId: UUID, partNum: Int): String

    Definition Classes
    Repository
  32. def cachePartsKey(projectId: UUID): String

    Definition Classes
    Repository
  33. def cacheProjectKey(id: UUID): String

    Definition Classes
    Repository
  34. def cacheProjectSlugKey(slug: String): String

    Definition Classes
    Repository
  35. def cacheProjectsKey(courseId: UUID): String

    Definition Classes
    Repository
  36. def cacheRoleKey(id: UUID): String

    Definition Classes
    Repository
  37. def cacheRoleNameKey(name: String): String

    Definition Classes
    Repository
  38. def cacheRolesKey(userId: UUID): String

    Definition Classes
    Repository
  39. def cacheScheduleKey(id: UUID): String

    Definition Classes
    Repository
  40. def cacheSchedulesKey(courseId: UUID): String

    Definition Classes
    Repository
  41. def cacheStudentsKey(id: UUID): String

    Definition Classes
    Repository
  42. def cacheTaskKey(id: UUID): String

    Definition Classes
    Repository
  43. def cacheTaskPosKey(projectId: UUID, partId: UUID, taskNum: Int): String

    Definition Classes
    Repository
  44. def cacheTasksKey(id: UUID): String

    Definition Classes
    Repository
  45. def cacheTeachingKey(id: UUID): String

    Definition Classes
    Repository
  46. def cacheUserKey(id: UUID): String

    Definition Classes
    Repository
  47. def cacheUsernameKey(username: String): String

    Definition Classes
    Repository
  48. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. def constructor(row: RowData): User

  50. def delete(user: User)(implicit conn: Connection, cache: ScalaCachePool): Future[\/[error.RepositoryError.Fail, User]]

    Delete a user from the database.

    Delete a user from the database.

    user

    the user to be deleted

    returns

    a future disjunction containing either the deleted user, or a failure

    Definition Classes
    UserRepositoryPostgresUserRepository
  51. implicit def eitherRunner[B](eithert: EitherT[Future, error.RepositoryError.Fail, B]): Future[\/[error.RepositoryError.Fail, B]]

    Definition Classes
    Lifting
  52. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  53. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  54. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  55. def find(identifier: String)(implicit conn: Connection, cache: ScalaCachePool): Future[\/[error.RepositoryError.Fail, User]]

    Find a user by their identifiers.

    Find a user by their identifiers.

    identifier

    a String representing their e-mail or username.

    returns

    a future disjunction containing either the user, or a failure

    Definition Classes
    UserRepositoryPostgresUserRepository
  56. def find(id: UUID)(implicit conn: Connection, cache: ScalaCachePool): Future[\/[error.RepositoryError.Fail, User]]

    Find a user by ID.

    Find a user by ID.

    id

    the UUID of the user to search for.

    returns

    a future disjunction containing either the user, or a failure

    Definition Classes
    UserRepositoryPostgresUserRepository
  57. implicit val futureMonad: Monad[Future]

    Definition Classes
    FutureMonad
  58. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  59. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  60. def insert(user: User)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, User]]

    Save a new User.

    Save a new User.

    Because we're using UUID, we assume we can always successfully create a user. The failure conditions will be things that result in an exception.

    user

    the user to insert into the database

    returns

    a future disjunction containing either the inserted user, or a failure

    Definition Classes
    UserRepositoryPostgresUserRepository
  61. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  62. def lift[B]: (Future[\/[error.RepositoryError.Fail, B]]) ⇒ EitherT[Future, error.RepositoryError.Fail, B]

    Definition Classes
    Lifting
  63. def liftSeq[B](fIntermediate: Future[IndexedSeq[\/[error.RepositoryError.Fail, B]]])(implicit ec: ExecutionContext): EitherT[Future, error.RepositoryError.Fail, IndexedSeq[B]]

    Definition Classes
    Lifting
  64. def liftSeq[B](interList: IndexedSeq[Future[\/[error.RepositoryError.Fail, B]]])(implicit ec: ExecutionContext): EitherT[Future, error.RepositoryError.Fail, IndexedSeq[B]]

    Definition Classes
    Lifting
  65. def list(course: Course)(implicit conn: Connection, cache: ScalaCachePool): Future[\/[error.RepositoryError.Fail, IndexedSeq[User]]]

    List users in a given course.

    List users in a given course.

    returns

    a future disjunction containing either the users, or a failure

    Definition Classes
    UserRepositoryPostgresUserRepository
  66. def list(role: Role)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[User]]]

    List all users who have a role.

    List all users who have a role.

    role
    conn
    returns

    Definition Classes
    UserRepositoryPostgresUserRepository
  67. def list(userIds: IndexedSeq[UUID])(implicit conn: Connection, cache: ScalaCachePool): Future[\/[error.RepositoryError.Fail, IndexedSeq[User]]]

    List users with a specified set of user Ids.

    List users with a specified set of user Ids.

    userIds

    an IndexedSeq of UUID of the users to list.

    returns

    a future disjunction containing either the users, or a failure

    Definition Classes
    UserRepositoryPostgresUserRepository
  68. def list(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[User]]]

    List all users.

    List all users.

    returns

    a future disjunction containing either the users, or a failure

    Definition Classes
    UserRepositoryPostgresUserRepository
  69. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  70. final def notify(): Unit

    Definition Classes
    AnyRef
  71. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  72. def predicate(fCondition: Future[Boolean])(fail: error.RepositoryError.Fail)(implicit ec: ExecutionContext): EitherT[Future, error.RepositoryError.Fail, Unit]

    Definition Classes
    Lifting
  73. def predicate(condition: Boolean)(fail: error.RepositoryError.Fail): EitherT[Future, error.RepositoryError.Fail, Unit]

    Definition Classes
    Lifting
  74. def queryList(queryText: String, parameters: Seq[Any] = Seq.empty[Any])(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[User]]]

    Send a query to the database and retrieve a list of entities.

    Send a query to the database and retrieve a list of entities.

    queryText
    parameters
    conn
    returns

    Attributes
    protected
    Definition Classes
    PostgresRepository
  75. def queryNumRows(queryText: String, parameters: Seq[Any] = Seq.empty[Any])(compare: (Long) ⇒ Boolean)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Boolean]]

    Send query to the database and compare the number of rows affected.

    Send query to the database and compare the number of rows affected.

    queryText
    parameters
    conn
    returns

    Attributes
    protected
    Definition Classes
    PostgresRepository
  76. def queryOne(queryText: String, parameters: Seq[Any] = Seq.empty[Any])(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, User]]

    Send query to the database and retrieve a single entity.

    Send query to the database and retrieve a single entity.

    queryText
    parameters
    conn
    returns

    Attributes
    protected
    Definition Classes
    PostgresRepository
  77. def serialized[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[R])(implicit ec: ExecutionContext): Future[IndexedSeq[R]]

    Definition Classes
    Serialized
  78. def serializedT[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[\/[error.RepositoryError.Fail, R]])(implicit ec: ExecutionContext): Future[\/[error.RepositoryError.Fail, IndexedSeq[R]]]

    Definition Classes
    Lifting
  79. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  80. def toString(): String

    Definition Classes
    AnyRef → Any
  81. val ttl: Some[FiniteDuration]

    Definition Classes
    Repository
  82. def update(user: User)(implicit conn: Connection, cache: ScalaCachePool): Future[\/[error.RepositoryError.Fail, User]]

    Update an existing user.

    Update an existing user.

    Because you already have a user object, we assume that this user exists in the database and will return the updated user. If your user is out of date, or it's no longer found, an exception should be thrown.

    user

    the user to update in the database

    returns

    a future disjunction containing either the updated user, or a failure

    Definition Classes
    UserRepositoryPostgresUserRepository
  83. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  84. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  85. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from PostgresRepository[User]

Inherited from UserRepository

Inherited from Repository

Inherited from Lifting[error.RepositoryError.Fail]

Inherited from Serialized

Inherited from FutureMonad

Inherited from AnyRef

Inherited from Any

Ungrouped