ca.shiftfocus.krispii.core.repositories

ComponentScratchpadRepositoryPostgres

Related Doc: package repositories

class ComponentScratchpadRepositoryPostgres extends ComponentScratchpadRepository with PostgresRepository[ComponentScratchpad]

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ComponentScratchpadRepositoryPostgres
  2. PostgresRepository
  3. ComponentScratchpadRepository
  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 ComponentScratchpadRepositoryPostgres(userRepository: UserRepository, componentRepository: ComponentRepository)

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

  7. val QMarks: String

  8. val SelectAllForComponent: String

  9. val SelectAllForUser: String

  10. val SelectAllForUserAndProject: String

  11. val SelectOne: String

  12. val Table: String

  13. val Update: String

  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. 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
  16. 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
  17. def cacheComponentKey(compId: UUID): String

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    Repository
  43. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. val componentRepository: ComponentRepository

  45. def constructor(row: RowData): ComponentScratchpad

  46. def delete(componentScratchpad: ComponentScratchpad)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, ComponentScratchpad]]

    Delete a component scratchpad.

    Delete a component scratchpad.

    componentScratchpad
    returns

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

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  51. def find(user: User, component: Component)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, ComponentScratchpad]]

    Find a single entry by ID.

    Find a single entry by ID.

    returns

    an optional RowData object containing the results

    Definition Classes
    ComponentScratchpadRepositoryPostgresComponentScratchpadRepository
  52. implicit val futureMonad: Monad[Future]

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

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

    Definition Classes
    AnyRef → Any
  55. def insert(componentScratchpad: ComponentScratchpad)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, ComponentScratchpad]]

    Insert a new ComponentScratchpad.

    Insert a new ComponentScratchpad. Used to create new scratchpads, and to insert new revisions to existing pads. Note that the primary key comprises the user's ID, the task's ID, and the revision number, so each revision is a separate entry in the database.

    componentScratchpad

    the ComponentScratchpad object to be inserted.

    returns

    the newly created ComponentScratchpad

    Definition Classes
    ComponentScratchpadRepositoryPostgresComponentScratchpadRepository
  56. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    Lifting
  60. def list(component: Component)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[ComponentScratchpad]]]

    Select rows by their task ID.

    Select rows by their task ID.

    component

    the 128-bit UUID, as a byte array, to search for.

    returns

    an optional RowData object containing the results

    Definition Classes
    ComponentScratchpadRepositoryPostgresComponentScratchpadRepository
  61. def list(user: User)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, IndexedSeq[ComponentScratchpad]]]

    Select rows by their user ID.

    Select rows by their user ID.

    user

    the 128-bit UUID, as a byte array, to search for.

    returns

    an optional RowData object containing the results

    Definition Classes
    ComponentScratchpadRepositoryPostgresComponentScratchpadRepository
  62. final def ne(arg0: AnyRef): Boolean

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

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

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

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

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

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

    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
  70. def serialized[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[R])(implicit ec: ExecutionContext): Future[IndexedSeq[R]]

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

    Definition Classes
    AnyRef
  73. def toString(): String

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

    Definition Classes
    Repository
  75. def update(componentScratchpad: ComponentScratchpad)(implicit conn: Connection): Future[\/[error.RepositoryError.Fail, ComponentScratchpad]]

    Update an existing ComponentScratchpad revision.

    Update an existing ComponentScratchpad revision. This always updates a specific revision, since the primary key comprises user ID, task ID, and revision number. Each revision has its own versioning w.r.t. optimistic offline lock.

    componentScratchpad

    the ComponentScratchpad object to be inserted.

    returns

    the newly created ComponentScratchpad

    Definition Classes
    ComponentScratchpadRepositoryPostgresComponentScratchpadRepository
  76. val userRepository: UserRepository

  77. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Repository

Inherited from Lifting[error.RepositoryError.Fail]

Inherited from Serialized

Inherited from FutureMonad

Inherited from AnyRef

Inherited from Any

Ungrouped