[color=red]//调用后,数据库会更新[/color]
def show(Long id) {
def c = Company.[b]get[/b](id)
c.name = 'testtest'
[company: c]
}
def show(Long id) {
def c = Company.[b]findById[/b](id)
c.name = 'test2'
[company: c]
}
def show(Long id) {
def c = Company.[b]read[/b](id)
c.name = 'testtest'
c.[b]save[/b]()
[company: c]
}
[color=blue]//调用后,数据库不会更新[/color]
def show(Long id) {
def c = Company.[b]read[/b](id)
c.name = 'testtest'
[company: c]
}
def show(Long id) {
def c = Company.[b]get[/b](id)
c.name = 'testtest'
[company: c]
}
def show(Long id) {
def c = Company.[b]findById[/b](id)
c.name = 'test2'
[company: c]
}
def show(Long id) {
def c = Company.[b]read[/b](id)
c.name = 'testtest'
c.[b]save[/b]()
[company: c]
}
[color=blue]//调用后,数据库不会更新[/color]
def show(Long id) {
def c = Company.[b]read[/b](id)
c.name = 'testtest'
[company: c]
}