Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support relationships between views #428

Open
spassignat opened this issue Mar 24, 2022 · 1 comment
Open

Support relationships between views #428

spassignat opened this issue Mar 24, 2022 · 1 comment

Comments

@spassignat
Copy link

spassignat commented Mar 24, 2022

Hello,
If we have a model like User -->* Role mapped on views RoleView, UserView, read operation works very well, but schemaTool (or auto-create) does not know how to deal with that situation.

I tested it on version 5.2 and the latest 6.0 available and didn't find in groups.io information. Please find the attached testcase.

Here is the Exception:
java.lang.ClassCastException: class org.datanucleus.store.rdbms.mapping.java.BigIntegerMapping cannot be cast to class org.datanucleus.store.rdbms.mapping.java.MultiMapping (org.datanucleus.store.rdbms.mapping.java.BigIntegerMapping and org.datanucleus.store.rdbms.mapping.java.MultiMapping are in unnamed module of loader 'app')
at org.datanucleus.store.rdbms.mapping.CorrespondentColumnsMapper.(CorrespondentColumnsMapper.java:254)
at org.datanucleus.store.rdbms.mapping.java.PersistableMapping.prepareColumnMapping(PersistableMapping.java:242)
at org.datanucleus.store.rdbms.mapping.java.PersistableMapping.initialize(PersistableMapping.java:130)
at org.datanucleus.store.rdbms.mapping.MappingManagerImpl.getMapping(MappingManagerImpl.java:663)
at org.datanucleus.store.rdbms.table.ClassView.initialize(ClassView.java:135)

The limitation seems to be the ClassView which consider a view does not have an id, which is not always the case. I think having id in view could help with caching, at least to have it optional
dn-view.zip
.

@spassignat spassignat changed the title Support relationships between view in the SchemaTool Support relationships between views in the SchemaTool Mar 24, 2022
@andyjefferson
Copy link
Member

An RDBMS "VIEW" doesn't have a primary key in most treatments of VIEW.

@andyjefferson andyjefferson changed the title Support relationships between views in the SchemaTool Support relationships between views Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants