ca.shiftfocus.krispii.core.repositories

TaskRepositoryPostgres

Related Doc: package repositories

class TaskRepositoryPostgres extends TaskRepository with PostgresRepository[Task] with SpecificTaskConstructors

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TaskRepositoryPostgres
  2. SpecificTaskConstructors
  3. PostgresRepository
  4. TaskRepository
  5. Repository
  6. Lifting
  7. Serialized
  8. FutureMonad
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TaskRepositoryPostgres()

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 CommonFields: String

  5. def CommonFieldsWithTable(table: String = Table): String

  6. val Delete: String

  7. val DeleteByPart: String

  8. val DeleteWhere: String

  9. val Insert: String

  10. val InsertLongAnswer: String

  11. val InsertMatching: String

  12. val InsertMultipleChoice: String

  13. val InsertOrdering: String

  14. val InsertShortAnswer: String

  15. val Join: String

  16. val OrderBy: String

  17. val QMarks: String

  18. val SelectAll: String

  19. val SelectByPartId: String

  20. val SelectByPosition: String

  21. val SelectByProjectId: String

  22. val SelectNowByUserId: String

  23. val SelectNowFromAll: String

  24. val SelectOne: String

  25. val SpecificFields: String

  26. val Table: String

  27. val Update: String

  28. val UpdateLongAnswer: String

  29. val UpdateMatching: String

  30. val UpdateMultipleChoice: String

  31. val UpdateOrdering: String

  32. val UpdateShortAnswer: String

  33. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  34. 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
  35. 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
  36. def cacheComponentKey(compId: UUID): String

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    Repository
  62. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. def constructLongAnswerTask(row: RowData): LongAnswerTask

    Create a LongAnswerTask from a row returned by the database.

    Create a LongAnswerTask from a row returned by the database.

    row

    a RowData object returned from the db.

    returns

    a LongAnswerTask object

    Attributes
    protected
    Definition Classes
    SpecificTaskConstructors
  64. def constructMatchingTask(row: RowData): MatchingTask

    Create a MatchingTask from a row returned by the database.

    Create a MatchingTask from a row returned by the database.

    row

    a RowData object returned from the db.

    returns

    a MatchingTask object

    Attributes
    protected
    Definition Classes
    SpecificTaskConstructors
  65. def constructMultipleChoiceTask(row: RowData): MultipleChoiceTask

    Create a MultipleChoiceTask from a row returned by the database.

    Create a MultipleChoiceTask from a row returned by the database.

    row

    a RowData object returned from the db.

    returns

    a MultipleChoiceTask object

    Attributes
    protected
    Definition Classes
    SpecificTaskConstructors
  66. def constructOrderingTask(row: RowData): OrderingTask

    Create a OrderingTask from a row returned by the database.

    Create a OrderingTask from a row returned by the database.

    row

    a RowData object returned from the db.

    returns

    a OrderingTask object

    Attributes
    protected
    Definition Classes
    SpecificTaskConstructors
  67. def constructShortAnswerTask(row: RowData): ShortAnswerTask

    Create a ShortAnswerTask from a row returned by the database.

    Create a ShortAnswerTask from a row returned by the database.

    row

    a RowData object returned from the db.

    returns

    a ShortAnswerTask object

    Attributes
    protected
    Definition Classes
    SpecificTaskConstructors
  68. def constructor(row: RowData): Task

  69. def delete(part: Part)(implicit conn: Connection, cache: ScalaCache): Future[\/[error.RepositoryError.Fail, IndexedSeq[Task]]]

    Delete all tasks belonging to a part.

    Delete all tasks belonging to a part.

    part

    the part to delete tasks from.

    returns

    A boolean indicating whether the operation was successful.

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  70. def delete(task: Task)(implicit conn: Connection, cache: ScalaCache): Future[\/[error.RepositoryError.Fail, Task]]

    Delete a task.

    Delete a task.

    task

    The task to delete.

    returns

    A boolean indicating whether the operation was successful.

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

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  75. def find(project: Project, part: Part, taskNum: Int)(implicit conn: Connection, cache: ScalaCache): Future[\/[error.RepositoryError.Fail, Task]]

    Find a task given its position within a part, its part's position within a project, and its project.

    Find a task given its position within a part, its part's position within a project, and its project.

    project

    the project to search within

    part

    the part to get position

    taskNum

    the number of the task within its part

    returns

    an optional task if one was found

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  76. def find(id: UUID)(implicit conn: Connection, cache: ScalaCache): Future[\/[error.RepositoryError.Fail, Task]]

    Find a single entry by ID.

    Find a single entry by ID.

    id

    the UUID to search for

    returns

    an optional task if one was found

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  77. def findNow(user: User, project: Project)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Task]]

    Find a task on which user is working on now.

    Find a task on which user is working on now.

    user
    project
    returns

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  78. def findNowFromAll(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Task]]

    Find a task from all tasks on which someone is working on now.

    Find a task from all tasks on which someone is working on now.

    conn
    returns

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  79. implicit val futureMonad: Monad[Future]

    Definition Classes
    FutureMonad
  80. def getCached[V](key: String)(implicit cache: ScalaCache): Future[\/[error.RepositoryError.Fail, V]]

    Definition Classes
    Repository
  81. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  83. def insert(task: Task)(implicit conn: Connection, cache: ScalaCache): Future[\/[error.RepositoryError.Fail, Task]]

    Insert a new task into the database.

    Insert a new task into the database.

    This method handles all task types in one place.

    task

    The task to be inserted

    returns

    the new task

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  84. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    Lifting
  88. def list(project: Project)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[Task]]]

    Find all tasks belonging to a given project.

    Find all tasks belonging to a given project.

    project

    The project to return parts from.

    returns

    a vector of the returned tasks

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  89. def list(part: Part)(implicit conn: Connection, cache: ScalaCache): Future[\/[error.RepositoryError.Fail, IndexedSeq[Task]]]

    Find all tasks belonging to a given part.

    Find all tasks belonging to a given part.

    part

    The part to return tasks from.

    returns

    a vector of the returned tasks

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  90. def list(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[Task]]]

    Find all tasks.

    Find all tasks.

    returns

    a vector of the returned tasks

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  91. final def ne(arg0: AnyRef): Boolean

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

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

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

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

    Definition Classes
    Lifting
  96. def putCache[V](key: String)(value: V, ttl: Option[Duration] = None)(implicit cache: ScalaCache): Future[\/[error.RepositoryError.Fail, Unit]]

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

    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
  98. 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
  99. def queryOne(queryText: String, parameters: Seq[Any] = Seq.empty[Any])(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Task]]

    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
  100. def removeCached(key: String)(implicit cache: ScalaCache): Future[\/[error.RepositoryError.Fail, Unit]]

    Definition Classes
    Repository
  101. def serialized[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[R])(implicit ec: ExecutionContext): Future[IndexedSeq[R]]

    Definition Classes
    Serialized
  102. 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
  103. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  104. def toString(): String

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

    Definition Classes
    Repository
  106. def update(task: Task)(implicit conn: Connection, cache: ScalaCache): Future[\/[error.RepositoryError.Fail, Task]]

    Update a task.

    Update a task.

    task

    The task to be updated.

    returns

    the updated task

    Definition Classes
    TaskRepositoryPostgresTaskRepository
  107. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from SpecificTaskConstructors

Inherited from PostgresRepository[Task]

Inherited from TaskRepository

Inherited from Repository

Inherited from Lifting[error.RepositoryError.Fail]

Inherited from Serialized

Inherited from FutureMonad

Inherited from AnyRef

Inherited from Any

Ungrouped