Greetings!
I have 2 SessionFactories which references on 2 different databases. In the first database stores tables with application data. In the second database stores reference data: all available cities, streets, etc. I had created Entities for two databases, 2 SessionFactories. All works, but separately. Can I make @ManyToOne reference from Entity1 (UserAdressInfo table in the 1st database) on Entity2 (StreetReference table in the 2nd database) by annotations or xml?
If I use @JoinColumn and @ManyToOne(fetch=FetchType.EAGER) annotation on Street getter, then on schema validation hibernate throw exception: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on Entity1 references an unknown entity: Entity2
And its right, because SessionFactory1 does not include Entity2... Does any way to do @ManyToOne reference from Entity1 to Entity2 with FetchType.EAGER?
|