[英]There is problem with relationship about two table in different DB, how works ActiveJDBC?
I have this problem:我有这个问题:
TABLE_1 -> db A TABLE_1 -> 分贝 A
TABLE_2 -> db B TABLE_2 -> 分贝 B
fields TABLE_1:字段表_1:
fields TABLE_2:字段表_2:
Relationship : TABLE_1 belongs to TABLE_2 foreignKeyName id_table_2_FK关系:TABLE_1 属于 TABLE_2 foreignKeyName id_table_2_FK
CASE 1:情况1:
CASE 2:案例二:
step 2: i try query find from TABLE_1 and follow exception:第 2 步:我尝试从 TABLE_1 查询查找并遵循异常:
java.lang.NullPointerException java.lang.NullPointerException
at org.javalite.activejdbc.Registry.processOverridesBelongsTo(Registry.java:393) at org.javalite.activejdbc.Registry.processOverrides(Registry.java:283) at org.javalite.activejdbc.Registry.init(Registry.java:138)... 127 more
and when set LOG properties about activejdbc, follow this,当设置关于activejdbc的LOG属性时,遵循这个,
java.lang.NoClassDefFoundError: Could not initialize class org.javalite.activejdbc.Registry
at org.javalite.activejdbc.ModelDelegate.metaModelOf(ModelDelegate.java:279)
As seen in CASE 2, in step 2, the query don't work, BUT in step 4 all works, what's wrong?如案例 2 所示,在第 2 步中,查询不起作用,但在第 4 步中一切正常,有什么问题?
Thank you for all...感谢你所做的一切...
UPDATE:更新:
I see that org.javalite.activejdbc.我看到了 org.javalite.activejdbc。 Registry , in CASE 2 don't configure correctly the relationship with TABLE_1 (table1Model) and TABLE_2(table2Model);
Registry ,在 CASE 2 中没有正确配置与 TABLE_1 (table1Model) 和 TABLE_2(table2Model) 的关系; but, as you can see in CASE 1, if i call first db A(table1Model) and after db B(table2Model) Registry class configure correctly the relationship with two different model.
但是,正如您在案例 1 中看到的那样,如果我调用第一个 db A(table1Model) 并在 db B(table2Model) Registry class 之后调用两个不同的 model 的关系。
I have configure ApplicationFilter, in my spring boot application, that override init, doFilter and destroy method;我在 spring 启动应用程序中配置了 ApplicationFilter,它覆盖了 init、doFilter 和 destroy 方法; someone know if is possible configure Registry.class, with db A and B relationship, in init method?
有人知道是否可以在初始化方法中配置 Registry.class,具有 db A 和 B 关系?
JavaLite ActiveJDBC is not designed to manage relationships across different schemas. JavaLite ActiveJDBC 并非旨在管理跨不同模式的关系。 If you have anything working in this mode, it is purely coincidental.
如果您有任何东西在这种模式下工作,那纯属巧合。
To fully understand your question, we will need:要完全理解您的问题,我们将需要:
For information on access to multiple databases, please refer to: https://javalite.io/database_connection_management#multiple-database-example有关访问多个数据库的信息,请参阅: https://javalite.io/database_connection_management#multiple-database-example
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.