Packages

  • package root
    Definition Classes
    root
  • package play

    Play framework.

    Play framework.

    Play

    http://www.playframework.com

    Definition Classes
    root
  • package api

    Contains the public API for Scala developers.

    Contains the public API for Scala developers.

    Access the current Play application
    import play.api.Play.current
    Read configuration
    val poolSize = configuration.getInt("engine.pool.size")
    Use the logger
    Logger.info("Hello!")
    Define a Plugin
    class MyPlugin(app: Application) extends Plugin
    Create adhoc applications (for testing)
    val application = Application(new File("."), this.getClass.getClassloader, None, Play.Mode.DEV)
    Definition Classes
    play
  • package cache

    Contains the Cache access API.

    Contains the Cache access API.

    Definition Classes
    api
  • package controllers
    Definition Classes
    api
  • package data

    Contains data manipulation helpers (typically HTTP form handling)

    Contains data manipulation helpers (typically HTTP form handling)

    import play.api.data._
    import play.api.data.Forms._
    
    val taskForm = Form(
      tuple(
        "name" -> text(minLength = 3),
        "dueDate" -> date("yyyy-MM-dd"),
        "done" -> boolean
      )
    )
    Definition Classes
    api
  • package db

    Contains the JDBC database access API.

    Contains the JDBC database access API.

    Example, retrieving a connection from the 'customers' datasource:

    val conn = db.getConnection("customers")
    Definition Classes
    api
  • package evolutions
  • package slick
  • ConnectionPool
  • DBApi
  • DBApiProvider
  • DBComponents
  • DBModule
  • Database
  • DatabaseConfig
  • Databases
  • DefaultDBApi
  • DefaultDatabase
  • HikariCPComponents
  • HikariCPConnectionPool
  • HikariCPModule
  • NamedDatabaseProvider
  • PooledDatabase
  • TransactionIsolationLevel
  • package http

    Contains standard HTTP constants.

    Contains standard HTTP constants. For example:

    val text = ContentTypes.TEXT
    val ok = Status.OK
    val accept = HeaderNames.ACCEPT
    Definition Classes
    api
  • package i18n

    Contains the internationalisation API.

    Contains the internationalisation API.

    For example, translating a message:

    val msgString = Messages("items.found", items.size)
    Definition Classes
    api
  • package inject

    Play's runtime dependency injection abstraction.

    Play's runtime dependency injection abstraction.

    Play's runtime dependency injection support is built on JSR-330, which provides a specification for declaring how dependencies get wired to components. JSR-330 however does not address how components are provided to or located by a DI container. Play's API seeks to address this in a DI container agnostic way.

    The reason for providing this abstraction is so that Play, the modules it provides, and third party modules can all express their bindings in a way that is not specific to any one DI container.

    Components are bound in the DI container. Each binding is identified by a BindingKey, which is typically an interface that the component implements, and may be optionally qualified by a JSR-330 qualifier annotation. A binding key is bound to a BindingTarget, which describes how the implementation of the interface that the binding key represents is constructed or provided. Bindings may also be scoped using JSR-330 scope annotations.

    Bindings are provided by instances of Module.

    Out of the box, Play provides an implementation of this abstraction using Guice.

    Definition Classes
    api
    See also

    The Module class for information on how to provide bindings.

  • package internal
    Definition Classes
    api
  • package libs

    Contains various APIs that are useful while developing web applications.

    Contains various APIs that are useful while developing web applications.

    Definition Classes
    api
  • package mvc

    Contains the Controller/Action/Result API to handle HTTP requests.

    Contains the Controller/Action/Result API to handle HTTP requests.

    For example, a typical controller:

    class HomeController @Inject() (val controllerComponents: ControllerComponents) extends BaseController {
    
      def index = Action {
        Ok("It works!")
      }
    
    }
    Definition Classes
    api
  • package routing
    Definition Classes
    api
  • package templates
    Definition Classes
    api
  • package test

    Contains test helpers.

    Contains test helpers.

    Definition Classes
    api

package db

Contains the JDBC database access API.

Example, retrieving a connection from the 'customers' datasource:

val conn = db.getConnection("customers")
Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. db
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait ConnectionPool extends AnyRef

    Connection pool API for managing data sources.

  2. trait DBApi extends AnyRef

    DB API for managing application databases.

  3. class DBApiProvider extends Provider[DBApi]

    Inject provider for DB implementation of DB API.

    Inject provider for DB implementation of DB API.

    Annotations
    @Singleton()
  4. trait DBComponents extends AnyRef

    DB components (for compile-time injection).

  5. final class DBModule extends SimpleModule

    DB runtime inject module.

  6. trait Database extends AnyRef

    Database API.

  7. case class DatabaseConfig(driver: Option[String], url: Option[String], username: Option[String], password: Option[String], jndiName: Option[String]) extends Product with Serializable

    The generic database configuration.

    The generic database configuration.

    driver

    The driver

    url

    The jdbc URL

    username

    The username

    password

    The password

    jndiName

    The JNDI name

  8. class DefaultDBApi extends DBApi

    Default implementation of the DB API.

  9. abstract class DefaultDatabase extends Database

    Default implementation of the database API.

    Default implementation of the database API. Provides driver registration and connection methods.

  10. trait HikariCPComponents extends AnyRef

    HikariCP components (for compile-time injection).

  11. class HikariCPConnectionPool extends ConnectionPool
    Annotations
    @Singleton()
  12. class HikariCPModule extends SimpleModule

    HikariCP runtime inject module.

  13. type NamedDatabase = db.NamedDatabase
  14. class NamedDatabaseProvider extends Provider[Database]

    Inject provider for named databases.

  15. class PooledDatabase extends DefaultDatabase

    Default implementation of the database API using a connection pool.

  16. sealed abstract class TransactionIsolationLevel extends AnyRef

    Defines isolation levels that determines the degree to which one transaction must be isolated from resource or data modifications made by other operations.

    Defines isolation levels that determines the degree to which one transaction must be isolated from resource or data modifications made by other operations.

    See also

    Connection.

Value Members

  1. object ConnectionPool
  2. object DatabaseConfig extends Serializable
  3. object Databases

    Creation helpers for manually instantiating databases.

  4. object DefaultDBApi
  5. object HikariCPConnectionPool
  6. object TransactionIsolationLevel

Inherited from AnyRef

Inherited from Any

Ungrouped