Skip to content

MaxMoto1702/grails-AbstractPersistenceEventListener

Repository files navigation

Grails GORM Listener Problem

  • GORM Version: 6.1.10.RELEASE
  • Grails Version: 3.3.8

Run

./grailsw run-app

or

./gradlew bootRun

Requests

Update GORM Entity

PUT http://localhost:8080/document/1
Accept: */*
Cache-Control: no-cache
Content-Type: application/json

{
  "id": 1,
  "number": "0001 updated",
  "date": "2019-04-02T13:04:42Z",
}

###

Expected result

{
  "id": 1,
  "number": "0001 updated",
  "date": "2019-04-02T13:04:42Z",
  "comment": "UPDATED..."           // timestamp
}

Actual result - PASS

{
  "id": 1,
  "number": "0001 updated",
  "date": "2019-04-02T13:04:42Z",
  "comment": "UPDATED..."           // timestamp
  // no problem
}

Get updated GORM Entity

GET http://localhost:8080/document/1
Accept: */*
Cache-Control: no-cache
Content-Type: application/json

###

Expected result

{
  "id": 1,
  "number": "0001 updated",
  "date": "2019-04-02T13:04:42Z",
  "comment": "UPDATED..."           // timestamp
}

Actual result - FAIL

{
  "id": 1,
  "number": "0001 updated",
  "date": "2019-04-02T13:04:42Z",
  // missing comment value !!!
}

About

Show problem change field value in listener

Resources

Stars

Watchers

Forks

Packages

No packages published