spring-boot - 如何通过本机反应在单对多关系中获得实体的一侧
问题描述
我使用 jhipster 创建应用程序并启动 cli。应用程序是用户的任务管理器。每个用户都有多个任务。但任务只能有一个用户。当我单击查看任务的详细信息时,它会显示 ID、名称和截止日期,但不会显示应该拥有该任务的用户名。我是 React Native 的新手。我使用 java spring boot 后端。
这是我在 task_detail.js 中的渲染
<ScrollView style={styles.container} testID="taskDetailScrollView">
<Text style={styles.text}>ID: {this.props.task.id}</Text>
<Text testID="task" style={styles.text}>Task: {this.props.task.task}</Text>
<Text testID="deadline" style={styles.text}>Deadline: {String(this.props.task.deadline)}</Text>
<Text style={styles.text}>User: {this.props.task.user_id}</Text>
<RoundedButton text="Edit" onPress={taskEntityEditScreen.bind(this, { entityId: this.props.task.id })} />
<RoundedButton text="Delete" onPress={this.confirmDelete} />
</ScrollView>
这是我的构造函数
constructor(props) {
super(props)
Navigation.events().bindComponent(this)
this.props.getTask(this.props.data.entityId)
}
我在任务表中有 user_id 的外键。我需要从该外键 user_id 获取用户名。
解决方案
推荐阅读
- core-audio - 禁用 AudioUnit AGC 失败
- python - python jupyter 使用 ls 命令列出所有 s3 文件
- java - Flink StreamingFileSink 的问题
& Azure Datalake Gen 2 - python - 寻找一种干净的方法来将额外的零通道添加到具有未知批量大小的 NxNxC 张量?
- python - 热图:从数据框索引中取轴
- sqlite - 使用 Sqlite JavaFx 填充 tableview 疑难解答
- php - 当我尝试向 sql 提交约会请求时,我不断收到同样的错误
- powerbuilder - 如何在不知道 powerbuilder 12.6 扩展名的情况下打开文件
- html - 由 scriptlet 代码填充的表格未显示
- networking - Wireshark 不显示 UDP 数据包