CaseClassShape

slick.lifted.CaseClassShape
class CaseClassShape[P <: Product, LiftedTuple, LiftedCaseClass <: P, PlainTuple, PlainCaseClass <: P](mapLifted: LiftedTuple => LiftedCaseClass, mapPlain: PlainTuple => PlainCaseClass)(implicit columnShapes: Shape[FlatShapeLevel, LiftedTuple, PlainTuple, LiftedTuple], classTag: ClassTag[PlainCaseClass]) extends MappedScalaProductShape[FlatShapeLevel, P, LiftedCaseClass, PlainCaseClass, LiftedCaseClass]

A generic case class shape that can be used to lift a case class of plain Scala types to a case class of lifted types. This allows the type to be used as a record type (like tuples and HLists) in the Lifted Embedding.

Example:

 case class C(a: Int, b: Option[String])
 case class LiftedC(a: Column[Int], b: Column[Option[String]])
 implicit object cShape extends CaseClassShape(LiftedC.tupled, C.tupled)

Attributes

Source:
Shape.scala
Graph
Supertypes
class MappedScalaProductShape[FlatShapeLevel, P, LiftedCaseClass, PlainCaseClass, LiftedCaseClass]
class MappedProductShape[FlatShapeLevel, P, LiftedCaseClass, PlainCaseClass, LiftedCaseClass]
class ProductNodeShape[FlatShapeLevel, P, LiftedCaseClass, PlainCaseClass, LiftedCaseClass]
class Shape[FlatShapeLevel, LiftedCaseClass, PlainCaseClass, LiftedCaseClass]
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Inherited types

type Mixed = Mixed_

Attributes

Inherited from:
Shape
Source:
Shape.scala
type Packed = Packed_

Attributes

Inherited from:
Shape
Source:
Shape.scala
type Unpacked = Unpacked_

Attributes

Inherited from:
Shape
Source:
Shape.scala

Value members

Concrete methods

override def buildValue(elems: IndexedSeq[Any]): LiftedCaseClass

Build a record value represented by this Shape from its element values.

Build a record value represented by this Shape from its element values.

Attributes

Definition Classes
Source:
Shape.scala
override def copy(s: Seq[Shape[_ <: ShapeLevel, _, _, _]]): Shape[FlatShapeLevel, _, _, _]

Create a copy of this Shape with new element Shapes. This is used for packing Shapes recursively.

Create a copy of this Shape with new element Shapes. This is used for packing Shapes recursively.

Attributes

Definition Classes
Source:
Shape.scala
override def toMapped(v: Any): PlainCaseClass

Attributes

Definition Classes
Source:
Shape.scala

Inherited methods

def buildParams(extract: Any => Unpacked): Packed

Build a packed representation containing QueryParameters that can extract data from the unpacked representation later. This method is not available for shapes where Mixed and Unpacked are different types.

Build a packed representation containing QueryParameters that can extract data from the unpacked representation later. This method is not available for shapes where Mixed and Unpacked are different types.

Attributes

Inherited from:
ProductNodeShape
Source:
Shape.scala
def encodeRef(value: Any, path: Node): Any

Encode a reference into a value of this Shape. This method may not be available for shapes where Mixed and Packed are different types.

Encode a reference into a value of this Shape. This method may not be available for shapes where Mixed and Packed are different types.

Attributes

Inherited from:
ProductNodeShape
Source:
Shape.scala
def getElement(value: P, idx: Int): Any

Get the element value from a record value at the specified index.

Get the element value from a record value at the specified index.

Attributes

Inherited from:
MappedScalaProductShape
Source:
Shape.scala
override def getIterator(value: P): Iterator[Any]

Get an Iterator of a record value's element values. The default implementation repeatedly calls getElement.

Get an Iterator of a record value's element values. The default implementation repeatedly calls getElement.

Attributes

Definition Classes
Inherited from:
MappedScalaProductShape
Source:
Shape.scala
def pack(value: Any): Packed

Convert a value of this Shape's (mixed) type to the fully packed type

Convert a value of this Shape's (mixed) type to the fully packed type

Attributes

Inherited from:
ProductNodeShape
Source:
Shape.scala

Return the fully packed Shape

Return the fully packed Shape

Attributes

Inherited from:
ProductNodeShape
Source:
Shape.scala
def toBase(v: Any): ProductWrapper

Attributes

Inherited from:
MappedProductShape
Source:
Shape.scala
override def toNode(value: Any): TypeMapping

Return an AST Node representing a mixed value.

Return an AST Node representing a mixed value.

Attributes

Definition Classes
Inherited from:
MappedProductShape
Source:
Shape.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Inherited from:
ProductNodeShape
Source:
Shape.scala

Concrete fields

val shapes: Seq[Shape[_ <: ShapeLevel, _, _, _]]

The Shapes for the product elements.

The Shapes for the product elements.

Attributes

Source:
Shape.scala