Issue Type: Improvement Improvement
Affects Versions: 4.1.4
Assignee: Unassigned
Components: envers
Created: 28/Aug/12 7:46 AM
Description:

In file: org.hibernate.envers.query.impl.RevisionsOfEntityQuery

we have the following line:
Object entity = entityInstantiator.createInstanceFromVersionsEntity(entityName, versionsEntity, revision);

Is there any possibility to search for RevisionsOfEntity query without fetching actual entities? (by fetching only RevisionsData object - which are available in revisionData = arrayResultRow[1]).

I'm using custom Revision object with all required info. Currently when envers fetches entities it generates a lot of queries which results are not used.

Maybe you could introduce another parameter to return List<Object> queryResult = buildAndExecuteQuery();

Right now we check following condition:
List<Object> queryResult = buildAndExecuteQuery();
if (hasProjection) { return queryResult; } else { ....}

Maybe we can change it to :

List<Object> queryResult = buildAndExecuteQuery();
if (hasProjection || returnRawResponse) { return queryResult; } }

and introduce returnRawResponse parameter, should be sufficient. Since REvisionData is present in queryResult at position nr 1.

Environment: 4.1.4, Oracle
Project: Hibernate ORM
Priority: Major Major
Reporter: Marcin Lewandowski
Original Estimate: 1h
Remaining Estimate: 1h
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira