gpt4 book ai didi

grails - 如何在获取 child 的信息时获取 parent 的身份证-Grails?

转载 作者:行者123 更新时间:2023-12-02 15:32:38 25 4
gpt4 key购买 nike

如何根据显示的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

政治 Realm
class PoliticItem {

SystemEntity politicItemName
UserAccount userAccount

def String politicItemValue
def boolean shared = false
Date dateCreated
Date lastUpdated

我们如何才能将属于所有状态的所有用户加载到政治 View 中?

最佳答案

我仍然不确定您不知道哪一部分。假设userAccount具有firstName和lastName字段以从状态访问它们,请尝试以下操作:
statusStatus类的实例。您需要从中删除userAccount的那个。

status.userAccount.firstName

要么
status.userAccount.lastName

关于grails - 如何在获取 child 的信息时获取 parent 的身份证-Grails?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17078856/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com