I never get any results for an entity with a “no_tenant” value It seems the generated query is incorrect.
in org/eclipse/persistence/internal/databaseaccess/DatabaseCall.java:832
List parameters = getParameters();
int size = parameters.size();
for (int index = 0; index < size; index++) {
session.getPlatform().setParameterValueInDatabaseCall(parameters.get(index), (PreparedStatement)statement, index+1, session);
}
the sql →
SQLCall(SELECT t1.ID AS a1, t1.DATE_ AS a2, t1.DELETE_TS AS a3, t1.DELETED_BY AS a4, t1.LOGO_URL AS a5, t1.MANUFACTURER AS a6, t1.TENANT_ID AS a7, t1.VERSION AS a8, t1.MANUFACTURER_URL_ID AS a9, t0.ID AS a10, t0.DELETE_TS AS a11, t0.DELETED_BY AS a12, t0.DUTCH AS a13, t0.ENGLISH AS a14, t0.FRENCH AS a15, t0.GERMAN AS a16, t0.ITALIAN AS a17, t0.RUSSIAN AS a18, t0.TENANT_ID AS a19, t0.VERSION AS a20 FROM PMC_CATALOG t1 LEFT OUTER JOIN PMC_LOCALIZED_STRING t0 ON (t0.ID = t1.MANUFACTURER_URL_ID) WHERE ((t1.DELETE_TS IS NULL) AND ((? = ?) OR (t1.TENANT_ID = ?))) LIMIT ?, ?)
the vital part here is (? = ?)
this is applied because the column names for normal tenant entities have a TENANT_ID column where Cuba system entities have a SYS_TENANT_ID column.
the parameters:
it seems that first parameter should be the column name instead of the value
Hi, NO_TENANT is associated with users without a tenant. Users without tenant are global users and have access to all data in a system.
But tenant users should only see the data belonging to their tenant. It’s by design.
Ok, now I understand why the query is like that.
It seems the meaning of the NO_TENANT is different from what I expected. I actually came this conclusion because of another topic I opened with a replay from @belyaev