"Scala" language specificities

Telosys version : 4.3.0



To define Scala as the target language call  #set( $env.language = 'Scala' )  in the templates files.

The information below shows the behavior of the generator when 'Scala' is the current target language.



Type conversion ( model type to language type )

The language type conversion has an impact on :
Model type     Default        @UnsignedType @NotNull       @PrimitiveType @ObjectType   
string String String String String String
byte Byte Byte Byte Byte Byte
short Short Short Short Short Short
int Int Int Int Int Int
long Long Long Long Long Long
decimal BigDecimal BigDecimal BigDecimal BigDecimal BigDecimal
float Float Float Float Float Float
double Double Double Double Double Double
boolean Boolean Boolean Boolean Boolean Boolean
date LocalDate LocalDate LocalDate LocalDate LocalDate
time LocalTime LocalTime LocalTime LocalTime LocalTime
timetz OffsetTime OffsetTime OffsetTime OffsetTime OffsetTime
datetime LocalDateTime LocalDateTime LocalDateTime LocalDateTime LocalDateTime
datetimetz OffsetDateTime OffsetDateTime OffsetDateTime OffsetDateTime OffsetDateTime
timestamp LocalDateTime LocalDateTime LocalDateTime LocalDateTime LocalDateTime
uuid UUID UUID UUID UUID UUID
binary Array[Byte] Array[Byte] Array[Byte] Array[Byte] Array[Byte]

Remarks

'@UnsignedType' has no effect
'@NotNull' has no effect
'@PrimitiveType' has no effect
'@ObjectType' has no effect



Literals for TRUE, FALSE and NULL

TRUE true
FALSE false
NULL null


Literal values

Model type Language type Language full type Language literal value example
string String java.lang.String "AAA"
byte Byte Byte 1
short Short Short 1
int Int Int 100
long Long Long 1000
decimal BigDecimal scala.math.BigDecimal java.math.BigDecimal.valueOf(10000.77)
float Float Float 1000.5f
double Double Double 1000.66
boolean Boolean Boolean true
date LocalDate java.time.LocalDate java.time.LocalDate.parse("2001-06-22")
time LocalTime java.time.LocalTime java.time.LocalTime.parse("01:46:52")
timetz OffsetTime java.time.OffsetTime java.time.OffsetTime.parse("01:46:52+01:00")
datetime LocalDateTime java.time.LocalDateTime java.time.LocalDateTime.parse("2001-05-21T01:47:53")
datetimetz OffsetDateTime java.time.OffsetDateTime java.time.OffsetDateTime.parse("2001-05-21T01:47:53+01:00")
timestamp LocalDateTime java.time.LocalDateTime java.time.LocalDateTime.parse("2001-05-21T01:47:53")
uuid UUID java.util.UUID java.util.UUID.fromString("18b79d89-08f1-4ecf-a3e7-6923aaa3152c")
binary Array[Byte] Array[Byte] null