Class

io.strongtyped.active.slick

EntityActions

Related Doc: package slick

Permalink

abstract class EntityActions extends EntityActionsLike

Self Type
EntityActions with JdbcProfileProvider
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EntityActions
  2. EntityActionsLike
  3. CrudActions
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new EntityActions()

    Permalink

Type Members

  1. abstract type Entity

    Permalink

    The type of the Entity

    The type of the Entity

    Definition Classes
    EntityActionsLike
  2. abstract type EntityTable <: slick.relational.RelationalProfile.Table[(EntityActions.this)#Entity]

    Permalink
  3. abstract type Id

    Permalink

    The Entity's Id type

    The Entity's Id type

    Definition Classes
    EntityActionsLike
  4. type Model = (EntityActions.this)#Entity

    Permalink

    CrudActions.Model is the Entity in this context

    CrudActions.Model is the Entity in this context

    Definition Classes
    EntityActionsLikeCrudActions

Abstract Value Members

  1. abstract def $id(table: (EntityActions.this)#EntityTable): slick.jdbc.JdbcProfile.API.Rep[(EntityActions.this)#Id]

    Permalink
  2. abstract def baseTypedType: BaseTypedType[(EntityActions.this)#Id]

    Permalink
  3. abstract def idLens: Lens[(EntityActions.this)#Entity, Option[(EntityActions.this)#Id]]

    Permalink
  4. abstract val jdbcProfile: JdbcProfile

    Permalink
    Definition Classes
    EntityActionsLikeCrudActions
  5. abstract def tableQuery: slick.jdbc.JdbcProfile.API.TableQuery[(EntityActions.this)#EntityTable]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def beforeInsert(entity: (EntityActions.this)#Entity)(implicit exc: ExecutionContext): slick.jdbc.JdbcProfile.API.DBIO[(EntityActions.this)#Entity]

    Permalink

    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: (EntityActions.this)#Id, entity: (EntityActions.this)#Entity)(implicit exc: ExecutionContext): slick.jdbc.JdbcProfile.API.DBIO[(EntityActions.this)#Entity]

    Permalink

    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. implicit lazy val btt: BaseTypedType[(EntityActions.this)#Id]

    Permalink
    Attributes
    protected
  8. def clone(): AnyRef

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

    Permalink

    Returns total table count

    Returns total table count

    Definition Classes
    EntityActionsCrudActions
  10. def delete(entity: (EntityActions.this)#Entity)(implicit exc: ExecutionContext): slick.jdbc.JdbcProfile.API.DBIO[Int]

    Permalink

    Delete a Model.

    Delete a Model.

    returns

    DBIO[Int] with the number of affected rows

    Definition Classes
    EntityActionsCrudActions
  11. def deleteById(id: (EntityActions.this)#Id)(implicit exc: ExecutionContext): slick.jdbc.JdbcProfile.API.DBIO[Int]

    Permalink

    Delete a Entity by Id

    Delete a Entity by Id

    returns

    DBIO[Int] with the number of affected rows

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def fetchAll(fetchSize: Int = 100)(implicit exc: ExecutionContext): slick.jdbc.JdbcProfile.API.StreamingDBIO[Seq[(EntityActions.this)#Entity], (EntityActions.this)#Entity]

    Permalink

    Fetch all elements from a table.

    Fetch all elements from a table.

    fetchSize

    - the number of row to fetch, defaults to 100

    returns

    StreamingDBIO[Seq[Model], Model]

    Definition Classes
    EntityActionsCrudActions
  15. def filterById(id: (EntityActions.this)#Id): Query[(EntityActions.this)#EntityTable, EntityTable.TableElementType, Seq]

    Permalink
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def findById(id: (EntityActions.this)#Id): slick.jdbc.JdbcProfile.API.DBIO[(EntityActions.this)#Entity]

    Permalink

    Finds Entity referenced by Id.

    Finds Entity referenced by Id. May fail if no Entity is found for passed Id

    returns

    DBIO[Entity] for the Entity

    Definition Classes
    EntityActionsEntityActionsLike
  18. def findOptionById(id: (EntityActions.this)#Id): slick.jdbc.JdbcProfile.API.DBIO[Option[(EntityActions.this)#Entity]]

    Permalink

    Finds Entity referenced by Id optionally.

    Finds Entity referenced by Id optionally.

    returns

    DBIO[Option[Entity]] for the Entity

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  21. def insert(entity: (EntityActions.this)#Entity)(implicit exc: ExecutionContext): slick.jdbc.JdbcProfile.API.DBIO[(EntityActions.this)#Id]

    Permalink

    Insert a new Entity

    Insert a new Entity

    returns

    DBIO[Id] for the generated Id

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

    Permalink
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  26. def save(entity: (EntityActions.this)#Entity)(implicit exc: ExecutionContext): slick.jdbc.JdbcProfile.API.DBIO[(EntityActions.this)#Entity]

    Permalink

    Insert or Update a Model Insert Model if not yet persisted, otherwise update it.

    Insert or Update a Model Insert Model if not yet persisted, otherwise update it.

    returns

    DBIO[Model] for a Model as persisted in the table.

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

    Permalink
    Definition Classes
    AnyRef
  28. def toString(): String

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

    Permalink
    Attributes
    protected
  30. def update(entity: (EntityActions.this)#Entity)(implicit exc: ExecutionContext): slick.jdbc.JdbcProfile.API.DBIO[(EntityActions.this)#Entity]

    Permalink

    Update a Model.

    Update a Model.

    returns

    DBIO[Model] for a Model as persisted in the table.

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from EntityActionsLike

Inherited from CrudActions

Inherited from AnyRef

Inherited from Any

Ungrouped