io.strongtyped.active.slick

EntityActions

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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. 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)
    }
  8. 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)
    }
  9. def clone(): AnyRef

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

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

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

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

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

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

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

  17. def finalize(): Unit

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

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

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

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

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

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

    Definition Classes
    Any
  24. val jdbcProfile: JdbcProfile

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

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

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

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

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

    Definition Classes
    AnyRef
  30. def toString(): String

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

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. 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