我在服务层我想插入事务的盟友,如果插入比所有三排插入数据库!
服务层是
def service(userRow, addressDao, contactDao) = DB.withTransaction { implicit session =>
userDao.insert(userRow)
addressDao.insert(addressRow)
contactDao.insert(contactRow)
}
吾道层
def insert(userRow: UsersRow) = DB.withTransaction { implicit session =>
user += userRow
}