enumeratum.values
Members list
Type members
Classlikes
When mixed in, allows creation of Slick mapped column types for enumeratum.values.ValueEnum instances
When mixed in, allows creation of Slick mapped column types for enumeratum.values.ValueEnum instances
scala> import enumeratum.values._
scala> sealed abstract class TrafficLightByInt(val value: Int) extends IntEnumEntry
scala> object TrafficLightByInt extends IntEnum[TrafficLightByInt] {
| case object Red extends TrafficLightByInt(0)
| case object Yellow extends TrafficLightByInt(1)
| case object Green extends TrafficLightByInt(2)
| val values = findValues
| }
scala> trait TrafficLightMappers extends SlickValueEnumColumnSupport {
| import profile.api._
| implicit val trafficLightColumnType = mappedColumnTypeForValueEnum(TrafficLightByInt)
| }
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait SlickValueEnumSupport
Allows for easy creation of GetResult[_] and SetParameter[_] instances for use with Slick's plain sql functionality. Does not require a profile to be in scope; only works with JDBC GetResult instances are used when mapping query results back to Scala types. SetParameter instances are used when inserting Scala types into interpolated sql queries.
Allows for easy creation of GetResult[_] and SetParameter[_] instances for use with Slick's plain sql functionality. Does not require a profile to be in scope; only works with JDBC GetResult instances are used when mapping query results back to Scala types. SetParameter instances are used when inserting Scala types into interpolated sql queries.
scala> import enumeratum.values._
scala> sealed abstract class TrafficLightByInt(val value: Int) extends IntEnumEntry
scala> object TrafficLightByInt extends IntEnum[TrafficLightByInt] {
| case object Red extends TrafficLightByInt(0)
| case object Yellow extends TrafficLightByInt(1)
| case object Green extends TrafficLightByInt(2)
| val values = findValues
| }
scala> import SlickValueEnumPlainSqlSupport._
scala> implicit val trafficLightSetParameter = setParameterForIntEnum(TrafficLightByInt)
scala> implicit val trafficLightOptionalSetParameter = optionalSetParameterForIntEnum(TrafficLightByInt)
scala> implicit val trafficLightGetResult = getResultForIntEnum(TrafficLightByInt)
scala> implicit val trafficLightOptionalGetResult = optionalGetResultForIntEnum(TrafficLightByInt)
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object SlickValueEnumPlainSqlSupport.typetrait SlickValueEnumSupport
Attributes
- Companion
- trait
- Supertypes
- Self type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any