override def saveOrUpdateAll(entities: Collection[T]){
import scala.collection.JavaConverters._
val session: Session = getSession()
for (entity <- entities.asScala) {
session.saveOrUpdate(entity)
}
}
There is no for each loop in scala. You should wrap your collection using JavaConverters
and use for-comprehension here.
JavaConverters
wraps Collection
using Wrappers.JCollectionWrapper
without memory overhead.