Packages

  • package root
    Definition Classes
    root
  • package slick
    Definition Classes
    root
  • package codegen

    Code generator / type providers

    Code generator / type providers

    Definition Classes
    slick
  • abstract class AbstractGenerator[Code, TermName, TypeName] extends GeneratorHelpers[Code, TermName, TypeName]

    Slick code generator providing the base structure and facilities.

    Slick code generator providing the base structure and facilities. It contains a subclass as a generator for Tables, which again contains subclasses for Column, etc. The implementation follows the virtual class pattern, which allows flexible customization by overriding the inner classes (following the pattern).

    Definition Classes
    codegen
    See also

    http://lampwww.epfl.ch/~odersky/papers/ScalableComponent.html

  • StringExtensions
  • Table
  • TableDef

abstract case class TableDef(model: model.Table) extends Product with Serializable

Code generator for table related code

model

corresponding Slick meta model component

Self Type
TableDef
Source
AbstractGenerator.scala
Linear Supertypes
Serializable, Product, Equals, AnyRef, Any
Known Subclasses
Type Hierarchy
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. TableDef
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Basic customization now overrides

  1. def hlistEnabled: Boolean

    If HList should be used as a compound type instead of tuples.

    If HList should be used as a compound type instead of tuples. Only if hugeClassEnabled is false.

  2. def hugeClassEnabled: Boolean

    Default is true, i.e.

    Default is true, i.e. a case class will be generated even if column.size > 22. Override to false to get the code as before Slick 3.3, i.e. a HList based type will be generated instead.

Basic customization overrides

  1. abstract case class ColumnDef(model: model.Column) extends TermDef with Product with Serializable

    Column related generator definition

    Column related generator definition

    model

    corresponding Slick meta model component

  2. trait EntityTypeDef extends TypeDef

    Entity case class or type alias generator definition (Mapped case class holding a complete row of data of this table).

  3. abstract case class ForeignKeyDef(model: model.ForeignKey) extends TermDef with Product with Serializable

    ForeignKey related generator definition

    ForeignKey related generator definition

    model

    corresponding Slick meta model component

  4. abstract case class IndexDef(model: model.Index) extends TermDef with Product with Serializable

    Index related generator definition

    Index related generator definition

    model

    corresponding Slick meta model component

  5. trait PlainSqlMapperDef extends TermDef

    Plain SQL GetResult mapper generator definition

  6. abstract case class PrimaryKeyDef(model: model.PrimaryKey) extends TermDef with Product with Serializable

    PrimaryKey related generator definition (Currently only used for composite primary keys.)

    PrimaryKey related generator definition (Currently only used for composite primary keys.)

    model

    corresponding Slick meta model component

  7. trait TableClassDef extends TypeDef

    Table class generator definition

  8. trait TableValueDef extends TermDef

    Table value generator definition (generates a collection-like value representing this database table).

  1. abstract def Column: (model.Column) => Column

    Column generator factory.

    Column generator factory. Override for customization.

  2. abstract def EntityType: EntityType

    Entity case class or type alias generator factory.

    Entity case class or type alias generator factory. Override for customization.

  3. abstract def ForeignKey: (model.ForeignKey) => ForeignKey

    ForeignKey generator factory.

    ForeignKey generator factory. Override for customization.

  4. abstract def Index: (model.Index) => Index

    Index generator factory.

    Index generator factory. Override for customization.

  5. abstract def PlainSqlMapper: PlainSqlMapper

    Plain SQL GetResult mapper generator factory.

    Plain SQL GetResult mapper generator factory. Override for customization.

  6. abstract def PrimaryKey: (model.PrimaryKey) => PrimaryKey

    PrimaryKey generator factory.

    PrimaryKey generator factory. Override for customization.

  7. abstract def TableClass: TableClass

    Table class generator factory.

    Table class generator factory. Override for customization.

  8. abstract def TableValue: TableValue

    Table value generator factory.

    Table value generator factory. Override for customization.

  9. abstract def extractor: Code

    Function that extracts the unmapped values from an entity object

  10. abstract def factory: Code

    Function that constructs an entity object from the unmapped values

  11. def autoIncLast: Boolean

    Indicates whether auto increment columns should be put last.

    Indicates whether auto increment columns should be put last. Please set to !hlistEnabled for switching this on.

  12. def code: Seq[Code]

    Generates the complete code for this table and its subordinate generators.

  13. def definitions: Seq[Def]

    Definitions to be generated for this table

  14. def mappingEnabled: Boolean

    Indicates if this table should be mapped using factory and extractor or not, in which case tuples are used.

    Indicates if this table should be mapped using factory and extractor or not, in which case tuples are used. (Consider overriding EntityType.enabled instead, which affects this, too.) Disabled by default when using hlists.

  15. def autoIncLastAsOption: Boolean

    Indicates whether auto increment columns should be put last and made an Option with a None default.

    Indicates whether auto increment columns should be put last and made an Option with a None default. Please set to !hlistEnabled for switching this on.

    Annotations
    @deprecated
    Deprecated

    (Since version 3.2.0) Use autoIncLast = true and ColumnDef.asOption = autoInc instead.

Ungrouped

  1. abstract type Column <: ColumnDef

    Column generator virtual class

  2. trait Def extends AnyRef

    Common interface for any kind of definition within the generated code

  3. abstract type EntityType <: EntityTypeDef

    Entity case class or type alias generator virtual class

  4. abstract type ForeignKey <: ForeignKeyDef

    Foreign key generator virtual class

  5. abstract type Index <: IndexDef

    Index generator virtual class

  6. abstract type PlainSqlMapper <: PlainSqlMapperDef

    Plain SQL GetResult mapper generator virtual class

  7. abstract type PrimaryKey <: PrimaryKeyDef

    Primary key generator virtual class

  8. abstract type TableClass <: TableClassDef

    Table class generator virtual class

  9. abstract type TableValue <: TableValueDef

    Table value generator virtual class

  10. trait TermDef extends Def

    Common interface for definitions that define a term (val, def, ...) within the generated code

  11. trait TypeDef extends Def

    Common interface for definitions that define a type (class, case class, ...) within the generated code

  1. abstract def compoundType(types: Seq[Code]): Code

    Creates a compound type from a given sequence of types.

    Creates a compound type from a given sequence of types. Uses HList if hlistEnabled else tuple.

  2. abstract def compoundValue(values: Seq[Code]): Code

    Creates a compound value from a given sequence of values.

    Creates a compound value from a given sequence of values. Uses HList if hlistEnabled else tuple.

  3. final lazy val columns: Seq[Column]

    Column code generators in the desired user-facing order.

  4. final lazy val columnsByName: Map[String, Column]

    Column code generators indexed by db column name

  5. final lazy val columnsPositional: IndexedSeq[Column]

    Column code generators in the order they appear in the model.

  6. lazy val desiredColumnOrder: Seq[Int]

    Database column positions in the desired user-facing order.

    Database column positions in the desired user-facing order. Currently just moves the positions of AutoInc columns to the end if autoIncLastAsOption is enabled.

  7. final lazy val foreignKeys: Seq[ForeignKey]

    Foreign key code generators

  8. final lazy val indices: Seq[Index]

    Index code generators

  9. final def isMappedToHugeClass: Boolean

    Indicates if table has more than 22 columns but still has to be mapped to a case class.

  10. val model: model.Table
  11. final lazy val primaryKey: Option[PrimaryKey]

    Primary key code generator, if this table has one

  12. def productElementNames: Iterator[String]
    Definition Classes
    Product