如何访问用户的名字和姓氏,具体取决于显示的 statusItem 是用户的孩子。
class UserAccount implements Serializable {
static transients = ['pass','passConfirm','familyPicTmp', 'familyPicTmpFilename', 'photoTmp', 'photoTmpFilename']
static hasMany = [authorities: Authorisation, memberships:FamilyMembership, progenitorIwi:Family, politicItems:PoliticItem,
relationships:Relationship, , agents:UserAccount, media:UserMedia, status:Status]
static mappedBy = [ progenitorIwi:"progenitor",relationships:'relationTo', relationships:'userAccount']
static fetchMode = [memberships:FetchMode.JOIN, agents:FetchMode.JOIN]
static mapping = {
memberships(lazy:false)
agents(lazy:false)
}
static belongsTo = [Authorisation]
状态域
class Status {
static belongsTo = [userAccount:UserAccount]
def String statusMessage
Date dateCreated
Date lastUpdated
def String statusType
政治领域
class PoliticItem {
SystemEntity politicItemName
UserAccount userAccount
def String politicItemValue
def boolean shared = false
Date dateCreated
Date lastUpdated
我们如何将属于所有状态的所有用户加载到政治视图中?