Getting the ID of a one-to-many loaded object without another trip to the DB with GORM

后端 未结 1 511
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 04:56

I have to GORM domains, A & B, that relate to database tables. A has a one-to-many relationship with B. Because of this, the classes look similar to:

cla         


        
相关标签:
1条回答
  • 2021-01-12 05:49

    Instead of:

    Long bid = a.b.id

    use:

    Long bid = a.bId

    0 讨论(0)
提交回复
热议问题