I have this problem:
TABLE_1 -> db A
TABLE_2 -> db B
fields TABLE_1:
- id_PK,
- id_table_2_FK,
- description
fields TABLE_2:
- id_PK
- description
Relationship: TABLE_1 belongs to TABLE_2 foreignKeyName id_table_2_FK
CASE 1:
- step 1: start application
- step 2: i try query find from TABLE_2 and it works
- step 3: i try query find from TABLE_1 and it works
CASE 2:
- step 1: start application
step 2: i try query find from TABLE_1 and follow exception:
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,
java.lang.NoClassDefFoundError: Could not initialize class org.javalite.activejdbc.Registry
at org.javalite.activejdbc.ModelDelegate.metaModelOf(ModelDelegate.java:279)
- step 3: i try query find from TABLE_2 and it works
- step 4: i try query find from TABLE_1 and it works
As seen in CASE 2, in step 2, the query don't work, BUT in step 4 all works, what's wrong?
Thank you for all...
UPDATE:
I see that org.javalite.activejdbc.Registry, in CASE 2 don't configure correctly the relationship with TABLE_1 (table1Model) and 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.
I have configure ApplicationFilter, in my spring boot application, that override init, doFilter and destroy method; someone know if is possible configure Registry.class, with db A and B relationship, in init method?
JavaLite ActiveJDBC is not designed to manage relationships across different schemas. 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