io.strongtyped.active.slick

EntityActions

Related Doc: package slick

abstract class EntityActions extends EntityActionsLike with JdbcProfileProvider

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. EntityActions
  2. JdbcProfileProvider
  3. EntityActionsLike
  4. CrudActions
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new EntityActions(jdbcProfile: JdbcProfile)

Type Members

  1. abstract type Entity <: Identifiable

    Definition Classes
    EntityActionsLikeCrudActions
  2. abstract type EntityTable <: slick.driver.JdbcProfile.API.Table[Entity]

  3. type Id = EntityActionsLike.Entity.Id

    Definition Classes
    EntityActionsLike

Abstract Value Members

  1. abstract def $id(table: EntityTable): slick.driver.JdbcProfile.API.Rep[Id]

  2. implicit abstract def baseTypedType: BaseTypedType[Id]

  3. abstract def idLens: Lens[Entity, Option[Id]]

  4. abstract def tableQuery: slick.driver.JdbcProfile.API.TableQuery[EntityTable]

Concrete 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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def beforeInsert(entity: Entity)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.DBIO[Entity]

    Before insert interceptor method.

    Before insert interceptor method. This method is called just before record insertion. The default implementation returns a successful DBIO wrapping the passed entity.

    The returned DBIOAction is combined with the final insert DBIOAction and 'marked' to run on the same transaction.

    Override this method if you need to add extract validation or modify the entity before insert.

    See examples bellow:

    // simple validation example
    override def beforeInsert(foo: Foo)(implicit exc: ExecutionContext): DBIO[Foo] = {
       if (foo.name.trim.isEmpty) {
         DBIO.failed(new RuntimeException("Name can't be empty!!!")
       } else {
         DBIO.successful(foo)
       }
    }
    // simple audit example
    override def beforeInsert(foo: Foo)(implicit exc: ExecutionContext): DBIO[Foo] = {
       // ensure that created and lastUpdate fields are updated just before insert
       val audited = foo.copy(created = DateTime.now, lastUpdate = DateTime.now)
       DBIO.successful(audited)
    }
  6. def beforeUpdate(id: Id, entity: Entity)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.DBIO[Entity]

    Before update interceptor method.

    Before update interceptor method. This method is called just before record update. The default implementation returns a successful DBIO wrapping the passed entity.

    The returned DBIOAction is combined with the final update DBIOAction and 'marked' to run on the same transaction.

    Override this method if you need to add extract validation or modify the entity before update.

    See examples bellow:

    // simple validation example
    override def beforeUpdate(id: Int, foo: Foo)(implicit exc: ExecutionContext): DBIO[Foo] = {
       findById(id).flatMap { oldFoo =>
         if (oldFoo.name != foo.name) {
           DBIO.failed(new RuntimeException("Can't modify name!!!")
         } else {
           DBIO.successful(foo)
         }
       }
    }
    // simple audit example
    override def beforeUpdate(id: Int, foo: Foo)(implicit exc: ExecutionContext): DBIO[Foo] = {
       // ensure that lastUpdate fields are updated just before update
       val audited = foo.copy(lastUpdate = DateTime.now)
       DBIO.successful(audited)
    }
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def count: slick.driver.JdbcProfile.API.DBIO[Int]

    Definition Classes
    EntityActionsCrudActions
  9. def delete(entity: Entity)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.DBIO[Int]

    Definition Classes
    EntityActionsCrudActions
  10. def deleteById(id: Id)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.DBIO[Int]

    Definition Classes
    EntityActionsEntityActionsLike
  11. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  13. def fetchAll(fetchSize: Int = 100)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.StreamingDBIO[Seq[Entity], Entity]

    Definition Classes
    EntityActionsCrudActions
  14. def filterById(id: Id): Query[EntityTable, EntityTable.TableElementType, Seq]

  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def findById(id: Id): slick.driver.JdbcProfile.API.DBIO[Entity]

    Definition Classes
    EntityActionsEntityActionsLike
  17. def findOptionById(id: Id): slick.driver.JdbcProfile.API.DBIO[Option[Entity]]

    Definition Classes
    EntityActionsEntityActionsLike
  18. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  20. def insert(entity: Entity)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.DBIO[Id]

    Definition Classes
    EntityActionsEntityActionsLike
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. val jdbcProfile: JdbcProfile

  23. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  26. def save(entity: Entity)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.DBIO[Entity]

    Definition Classes
    EntityActionsCrudActions
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toString(): String

    Definition Classes
    AnyRef → Any
  29. def update(id: Id, entity: Entity)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.DBIO[Entity]

    Attributes
    protected
  30. def update(entity: Entity)(implicit exc: ExecutionContext): slick.driver.JdbcProfile.API.DBIO[Entity]

    Definition Classes
    EntityActionsCrudActions
  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from JdbcProfileProvider

Inherited from EntityActionsLike

Inherited from CrudActions

Inherited from AnyRef

Inherited from Any

Ungrouped