MyGen

com.typesafe.slick.testkit.util.TestCodeGenerator.Config.MyGen
class MyGen(model: Model) extends SourceCodeGenerator

Attributes

Source
TestCodeGenerator.scala
Graph
Supertypes
class SourceCodeGenerator
trait OutputHelpers
class AbstractSourceCodeGenerator
trait StringGeneratorHelpers
class AbstractGenerator[String, String, String]
trait GeneratorHelpers[String, String, String]
class Object
trait Matchable
class Any
Show all

Members list

Grouped members

Basic customization overrides

abstract case class AbstractTableDef(model: Table)

Code generator for table related code

Code generator for table related code

Value parameters

model

corresponding Slick meta model component

Attributes

Inherited from:
AbstractGenerator
Source
AbstractGenerator.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
def Table: Table => Table

Table generator factory. Override for customization.

Table generator factory. Override for customization.

Attributes

Inherited from:
SourceCodeGenerator
Source
SourceCodeGenerator.scala
override def code: String

Generates code for the complete model (not wrapped in a package yet)

Generates code for the complete model (not wrapped in a package yet)

Attributes

Definition Classes
OutputHelpers -> AbstractSourceCodeGenerator
Source
TestCodeGenerator.scala
def codeForContainer: String

Generates code for the container class (not wrapped in a package yet)

Generates code for the container class (not wrapped in a package yet)

Attributes

Inherited from:
AbstractSourceCodeGenerator
Source
AbstractSourceCodeGenerator.scala
def codeForDDL: String

Generates code for the DDL statement.

Generates code for the DDL statement.

Attributes

Inherited from:
AbstractSourceCodeGenerator
Source
AbstractSourceCodeGenerator.scala
def codePerTable: Map[String, String]

Generates a map that associates the table name with its generated code (not wrapped in a package yet).

Generates a map that associates the table name with its generated code (not wrapped in a package yet).

Attributes

Inherited from:
AbstractSourceCodeGenerator
Source
AbstractSourceCodeGenerator.scala
override def entityName: String => String

Maps database table name to entity case class name

Maps database table name to entity case class name

Attributes

Definition Classes
AbstractGenerator
Source
TestCodeGenerator.scala
def packageCode(profile: String, pkg: String, container: String, parentType: Option[String]): String

Generates code providing the data model as trait and object in a Scala package

Generates code providing the data model as trait and object in a Scala package

Value parameters

container

The name of a trait and an object the generated code will be placed in within the specified package.

pkg

Scala package the generated code is placed in

profile

Slick profile that is imported in the generated package (e.g. slick.jdbc.H2Profile)

Attributes

Inherited from:
OutputHelpers
Source
OutputHelpers.scala
def packageContainerCode(profile: String, pkg: String, container: String): String

Generates code providing the stand-alone slick data model for immediate use.

Generates code providing the stand-alone slick data model for immediate use.

Value parameters

container

The name of a trait and an object the generated code will be placed in within the specified package.

pkg

Scala package the generated code is placed in

profile

Slick profile that is imported in the generated package (e.g. scala.slick.driver.H2Driver)

Attributes

Inherited from:
OutputHelpers
Source
OutputHelpers.scala
def packageTableCode(tableName: String, tableCode: String, pkg: String, container: String): String

Generates code for the given table. The tableName and tableCode parameters should come from the #codePerTable map.

Generates code for the given table. The tableName and tableCode parameters should come from the #codePerTable map.

Value parameters

container

The name of the container

pkg

Scala package the generated code is placed in

tableCode

: the generated code for the table.

tableName

: the name of the table

Attributes

Inherited from:
OutputHelpers
Source
OutputHelpers.scala
def tableName: String => String

Maps database table name to Table class and value name

Maps database table name to Table class and value name

Attributes

Inherited from:
AbstractGenerator
Source
AbstractGenerator.scala

Output

def writeStringToFile(content: String, folder: String, pkg: String, fileName: String): Unit

Writes given content to a file. Ensures the file ends with a newline character.

Writes given content to a file. Ensures the file ends with a newline character.

Attributes

Inherited from:
OutputHelpers
Source
OutputHelpers.scala
def writeToFile(profile: String, folder: String, pkg: String, container: String, fileName: String): Unit

Generates code and writes it to a file. Creates a folder structure for the given package inside the given srcFolder and places the new file inside or overrides the existing one.

Generates code and writes it to a file. Creates a folder structure for the given package inside the given srcFolder and places the new file inside or overrides the existing one.

Value parameters

container

The name of a trait and an object the generated code will be placed in within the specified package.

fileName

Name of the output file, to which the code will be written

folder

target folder, in which the package structure folders are placed

pkg

Scala package the generated code is placed in (a subfolder structure will be created within srcFolder)

profile

Slick profile that is imported in the generated package (e.g. slick.jdbc.H2Profile)

Attributes

Inherited from:
OutputHelpers
Source
OutputHelpers.scala
def writeToMultipleFiles(profile: String, folder: String, pkg: String, container: String): Unit

Generates code and writes it to multiple files. Creates a folder structure for the given package inside the given srcFolder and places the new files inside or overrides the existing one.

Generates code and writes it to multiple files. Creates a folder structure for the given package inside the given srcFolder and places the new files inside or overrides the existing one.

Value parameters

container

The name of a trait and an object the generated code will be placed in within the specified package.

folder

target folder, in which the output files are placed

pkg

Scala package the generated code is placed in (a subfolder structure will be created within srcFolder)

profile

Slick profile that is imported in the generated package (e.g. scala.slick.driver.H2Driver)

Attributes

Inherited from:
OutputHelpers
Source
OutputHelpers.scala

Type members

Inherited classlikes

abstract class AbstractSourceCodeTableDef(model: Table) extends AbstractTableDef

Attributes

Inherited from:
AbstractSourceCodeGenerator
Source
AbstractSourceCodeGenerator.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class SourceCodeTableDef(model: Table) extends AbstractSourceCodeTableDef

Attributes

Inherited from:
SourceCodeGenerator
Source
SourceCodeGenerator.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
implicit class StringExtensions(val str: String)

Slick code generator string extension methods. (Warning: Not unicode-safe, uses String#apply)

Slick code generator string extension methods. (Warning: Not unicode-safe, uses String#apply)

Attributes

Inherited from:
GeneratorHelpers
Source
AbstractGenerator.scala
Supertypes
class Object
trait Matchable
class Any

Inherited types

Table generator virtual class

Table generator virtual class

Attributes

Inherited from:
SourceCodeGenerator
Source
SourceCodeGenerator.scala

Value members

Concrete methods

override def parentType: Some[String]

The parent type of the generated main trait. This can be overridden in subclasses.

The parent type of the generated main trait. This can be overridden in subclasses.

Attributes

Definition Classes
OutputHelpers
Source
TestCodeGenerator.scala

Inherited methods

def docWithCode(doc: String, code: String): String

Assemble doc comment with scala code

Assemble doc comment with scala code

Attributes

Inherited from:
StringGeneratorHelpers
Source
AbstractSourceCodeGenerator.scala
def foreignKeysPerTable: Map[String, List[String]]

Attributes

Inherited from:
AbstractSourceCodeGenerator
Source
AbstractSourceCodeGenerator.scala
def indent(code: String): String

Attributes

Inherited from:
GeneratorHelpers
Source
AbstractGenerator.scala
final def optionType(t: String): String

Wrap the given type into an Option type

Wrap the given type into an Option type

Attributes

Inherited from:
StringGeneratorHelpers
Source
AbstractSourceCodeGenerator.scala
def parseType(tpe: String): String

Generates code for a qualified Scala type

Generates code for a qualified Scala type

Attributes

Inherited from:
StringGeneratorHelpers
Source
AbstractSourceCodeGenerator.scala
def rootTraitCode(profile: String, pkg: String, container: String): String

Attributes

Inherited from:
OutputHelpers
Source
OutputHelpers.scala
def shouldQuoteIdentifier(s: String): Boolean

Attributes

Inherited from:
StringGeneratorHelpers
Source
AbstractSourceCodeGenerator.scala
def termName(name: String): String

Marks a String as a TermName (e.g. for escaping scala keywords)

Marks a String as a TermName (e.g. for escaping scala keywords)

Attributes

Inherited from:
StringGeneratorHelpers
Source
AbstractSourceCodeGenerator.scala
protected def tuple(i: Int): String

Attributes

Inherited from:
AbstractSourceCodeGenerator
Source
AbstractSourceCodeGenerator.scala
def typeName(name: String): String

Marks a String as a TypeName (e.g. for escaping scala keywords)

Marks a String as a TypeName (e.g. for escaping scala keywords)

Attributes

Inherited from:
StringGeneratorHelpers
Source
AbstractSourceCodeGenerator.scala

Inherited fields

val ddlEnabled: Boolean

Enables DDL Generation.

Enables DDL Generation.

Attributes

Inherited from:
AbstractGenerator
Source
AbstractGenerator.scala
val scalaKeywords: Seq[String]

Words that are reserved keywords in Scala

Words that are reserved keywords in Scala

Attributes

Inherited from:
GeneratorHelpers
Source
AbstractGenerator.scala
val slickTableTermMembersNoArgs: Seq[String]

Existing term member names in Table[_] that do not take parameters

Existing term member names in Table[_] that do not take parameters

Attributes

Inherited from:
GeneratorHelpers
Source
AbstractGenerator.scala
final lazy val tables: Seq[Table]

Table code generators.

Table code generators.

Attributes

Inherited from:
AbstractGenerator
Source
AbstractGenerator.scala
final lazy val tablesByName: Map[QualifiedName, Table]

Table code generators indexed by db table name.

Table code generators indexed by db table name.

Attributes

Inherited from:
AbstractGenerator
Source
AbstractGenerator.scala

Implicits

Inherited implicits

final implicit def StringExtensions(str: String): StringExtensions

Slick code generator string extension methods. (Warning: Not unicode-safe, uses String#apply)

Slick code generator string extension methods. (Warning: Not unicode-safe, uses String#apply)

Attributes

Inherited from:
GeneratorHelpers
Source
AbstractGenerator.scala