Create service for managing students

This commit is contained in:
Mariusz Kuligowski 2018-03-15 23:53:33 +01:00
parent bda9a7afd0
commit 786dfb637b
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package com.baeldung.grails
import grails.gorm.transactions.Transactional
@Transactional
class StudentService {
def get(id){
Student.get(id)
}
def list() {
Student.list()
}
def save(student){
student.save()
}
def delete(id){
Student.get(id).delete()
}
}