假设我有一个类之间的依赖关系树。没有周期,但它有几个层次。在最底部有一个 hibernate Session。
MyService -> MyDao -> Session
MyService -> MyCollaborator -> AnotherCollaborator
MyCollaborator -> MyDao
AnotherCollaborator -> MyDao
AnotherCollaborator -> AnotherDao -> Session
你明白了。
我想Session在 Guice 外部手动创建,然后使用 Guice 从MyService下生成整个图形,使用 this Session。我该怎么做?。