Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def howToDoItInScala(task: Task) = {
- int retVal = 0;
- //object not stored yet in db
- if(task.id() == 0){
- //store it now
- task.save()
- // retrieve the new database id
- retVal = task.id()
- }
- else{
- // dont change the retVal if object did exist already in db
- task.save()
- }
- return newFunction(retVal)
- }
Advertisement
Add Comment
Please, Sign In to add comment