如何从C加载所有相关类C.B.A
1)一个典型的查询(使用两个连接) VS 2)急切加载
class A(Base):
__tablename__ = 'a'
class B(Base):
__tablename__ = 'b'
id = Column(Integer, primary_key=True)
a_id = Column(Integer, ForeignKey('a.id'))
a = relationship(A)
class C(Base):
__tablename__ = 'c'
id = Column(Integer, primary_key=True)
b_id = Column(Integer, ForeignKey('b.id'))
b = relationship(B)