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

Incorrect entity alias for query with row level policy #3920

Open
dtaimanov opened this issue Nov 22, 2024 · 0 comments
Open

Incorrect entity alias for query with row level policy #3920

dtaimanov opened this issue Nov 22, 2024 · 0 comments
Labels
in: data triage Issue is waiting for triage type: bug Something isn't working

Comments

@dtaimanov
Copy link
Collaborator

Environment

Jmix version: 2.4.0

Steps

  1. Run the project: rowLevelAliasProblem.zip
  2. Login as admin and open the Blank view
  3. Press the button
    ER: No exception
    AR:
java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager: 
Exception Description: Problem compiling [select tempEntityAlias from TestEntity tempEntityAlias, User e where (e.name = '123') and (tempEntityAlias.id = e.test.id)]. 
[70, 76] The state field path 'e.name' cannot be resolved to a valid type.
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1732) ~[org.eclipse.persistence.jpa-4.0.2-3-jmix.jar:na]
	at io.jmix.eclipselink.impl.JmixEclipseLinkQuery.buildJPAQuery(JmixEclipseLinkQuery.java:558) ~[jmix-eclipselink-2.4.0.jar:na]
	at io.jmix.eclipselink.impl.JmixEclipseLinkQuery.getQuery(JmixEclipseLinkQuery.java:468) ~[jmix-eclipselink-2.4.0.jar:na]
	at io.jmix.eclipselink.impl.JmixEclipseLinkQuery.getResultList(JmixEclipseLinkQuery.java:135) ~[jmix-eclipselink-2.4.0.jar:na]
	at io.jmix.eclipselink.impl.JpaDataStore.executeQuery(JpaDataStore.java:601) ~[jmix-eclipselink-2.4.0.jar:na]
	at io.jmix.eclipselink.impl.JpaDataStore.loadAll(JpaDataStore.java:169) ~[jmix-eclipselink-2.4.0.jar:na]
	at io.jmix.core.datastore.AbstractDataStore.loadList(AbstractDataStore.java:129) ~[jmix-core-2.4.0.jar:na]
	at io.jmix.core.impl.UnconstrainedDataManagerImpl.loadList(UnconstrainedDataManagerImpl.java:112) ~[jmix-core-2.4.0.jar:na]
	at io.jmix.core.FluentLoader$ByQuery.list(FluentLoader.java:573) ~[jmix-core-2.4.0.jar:na]
	at com.company.untitled4.view.blank.BlankView.onTestButtonClick(BlankView.kt:29) ~[main/:na]
        // ...
@dtaimanov dtaimanov added type: bug Something isn't working in: data triage Issue is waiting for triage labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data triage Issue is waiting for triage type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant