DevelopmentException: DataManager cannot execute query for single attributes

Hello,

I am getting DevelopmentException: DataManager cannot execute query for single attributes

Here is my code:

lc.setQueryString(“select u.id from sec$GroupHierarchy u where u.group.name =:grpName”)
.setParameter(“grpName”, GROUP_NAME);
Group USER_GROUP_ID = dataManager.load(lc);

Hi Priyanka,

You’ve faced the problem that DataManager query cannot return aggregates or single attributes - it can only return entities.

This is because of security considerations - there can be restrictions on entity attributes, and the platform generic mechanisms now can check them only inside entities.

So when you need to load aggregates or any other scalar values to the client, create your own service and use EntityManager with JPQL or native queries.

Please give some references or some sample code

Hi,

It would be great if you open a new topic and ask about your problem.