I use scala with mybatis:
Space.scala:
case class Space(
val id: Long ,
spaceName:String)
SpaceDao:
val space=Space(0,"space name")
val mapper = session.getMapper(classOf[SpaceMapper])
val result = mapper.insertSpace(space)
println(space.id)
The result space id is the auto increment number of mysql, not 0. but both space and space.id is val, why a val value can be changed?