Create service for managing students
This commit is contained in:
parent
bda9a7afd0
commit
786dfb637b
|
@ -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()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue