How fields decorated with transient in grails entity classes are displayed in as JSON

this is a very strange problem, which is to use the keyword transient in the entity class to modify the attribute, which is not displayed when as JSON.

clipboard.png

clipboard.png

as JSON

clipboard.png

doesn"t output these attributes. What"s going on?

Mar.03,2021

as json serializes entity objects. Adding transient means that this property does not allow serialization. There should be no


you didn't assign a value, did you? Also, you don't need a field like transients at all, you can use:

domain.list().collect {
    [
        id: it?.id,
        name: it?.xxx
    ]
}

whatever you want to encapsulate in this

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37e9f-3449b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37e9f-3449b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?