ca.shiftfocus.krispii.core.repositories

WorkRepositoryPostgres

Related Doc: package repositories

class WorkRepositoryPostgres extends WorkRepository with PostgresRepository[Work]

Linear Supertypes
PostgresRepository[Work], WorkRepository, Repository, Lifting[error.RepositoryError.Fail], Serialized, FutureMonad, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. WorkRepositoryPostgres
  2. PostgresRepository
  3. WorkRepository
  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 WorkRepositoryPostgres(documentRepository: DocumentRepository, revisionRepository: RevisionRepository)

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

  7. val DeleteAllRevisions: String

  8. val DeleteWhere: String

  9. val FindById: String

  10. val FindByIdVersion: String

  11. val FindByStudentTask: String

  12. val FindByStudentTaskVersion: String

  13. val Insert: String

  14. def InsertIntoDocumentWork(table: String): String

  15. def InsertIntoVersionedWork(table: String): String

  16. val Join: String

  17. def JoinMatchVersion(table: String = Table): String

  18. val QMarks: String

  19. val SelectAllForUserTask: String

  20. val SelectForTask: String

  21. val SelectForUserProject: String

  22. val SpecificFields: String

  23. val SpecificOrderBy: String

  24. val Table: String

  25. val Update: String

  26. def UpdateKeepLatestRevision(table: String): String

  27. def UpdateWithNewRevision(table: String): String

  28. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  29. 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
  30. 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
  31. def cacheComponentKey(compId: UUID): String

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    Repository
  57. def clone(): AnyRef

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

  59. def delete(task: Task)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[Work]]]

    Delete all work for a given task.

    Delete all work for a given task. Delete all revisions for MultipleChoice, Ordering, Matcing works and for DocumentWork we delete only in Work table and don't touch Documents table, that should be done in DocumentRepository

    This is needed when we want to delete the task itself... before that can be done, all that task's work must itself be deleted.

    task
    conn
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  60. def delete(work: Work)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Work]]

    Delete all revisions of a work.

    Delete all revisions of a work.

    work
    conn
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  61. val documentRepository: DocumentRepository

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

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  66. def find(user: User, task: Task, version: Long)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Work]]

    Find a specific revision for a single work for a user.

    Find a specific revision for a single work for a user.

    user
    task
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  67. def find(user: User, task: Task)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Work]]

    Find the latest revision of a single work for a user within a Task.

    Find the latest revision of a single work for a user within a Task.

    user
    task
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  68. def find(workId: UUID, version: Long)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Work]]

    Find a specific revision of a single work.

    Find a specific revision of a single work.

    workId
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  69. def find(workId: UUID)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Work]]

    Find the latest revision of a single work.

    Find the latest revision of a single work.

    workId
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  70. implicit val futureMonad: Monad[Future]

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

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

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

    Definition Classes
    AnyRef → Any
  74. def insert(work: Work)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Work]]

    Insert a new work into the database.

    Insert a new work into the database.

    This explicitly inserts a new, fresh work. To insert a new revision for an existing work, use the update method.

    Since all work types have the same fields (varying only by the type of 'answer')

    work
    conn
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  75. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    Lifting
  79. def list(task: Task)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[Work]]]

    List latest revisions of a specific work for all users within a Task.

    List latest revisions of a specific work for all users within a Task.

    task
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  80. def list(user: User, task: Task)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Either[DocumentWork, IndexedSeq[ListWork[_ >: Int with Match]]]]]

    List all revisions of a specific work for a user within a Task.

    List all revisions of a specific work for a user within a Task.

    user
    task
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  81. def list(user: User, project: Project)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[Work]]]

    List the latest revision of work for each task in a project for a user.

    List the latest revision of work for each task in a project for a user.

    user
    project
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  82. final def ne(arg0: AnyRef): Boolean

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

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

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

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

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

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

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

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

    Definition Classes
    Repository
  92. val revisionRepository: RevisionRepository

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

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

    Definition Classes
    AnyRef
  96. def toString(): String

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

    Definition Classes
    Repository
  98. def update(work: Work, newRevision: Boolean)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Work]]

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  99. def update(work: Work)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, Work]]

    Update a work.

    Update a work.

    By default, updating a work inserts a new revision, but it can optionally update an existing revision (for example, if the domain logic only calls for new revisions after some other condition has been satisfied, like an amount of time passing since the previous revision.

    work
    conn
    returns

    Definition Classes
    WorkRepositoryPostgresWorkRepository
  100. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from PostgresRepository[Work]

Inherited from WorkRepository

Inherited from Repository

Inherited from Lifting[error.RepositoryError.Fail]

Inherited from Serialized

Inherited from FutureMonad

Inherited from AnyRef

Inherited from Any

Ungrouped