[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5753) SessionImpl does not know whether CriteriaImpl is an Entity or Class

Pepelner Johann (JIRA) noreply at atlassian.com
Tue Nov 23 10:07:13 EST 2010


SessionImpl does not know whether CriteriaImpl is an Entity or Class
--------------------------------------------------------------------

                 Key: HHH-5753
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5753
             Project: Hibernate Core
          Issue Type: Improvement
    Affects Versions: 3.6.0
            Reporter: Pepelner Johann
            Priority: Critical
         Attachments: CriteriaImpl.java, SessionImpl.java

Method 'public List list(CriteriaImpl criteria)' of class SessionImpl always calls 'factory.getImplementors( criteria.getEntityOrClassName() );', even if the 'criteria' is an Entity.
In case of 'criteria' is an Entity the 'ReflectHelper.classForName' throws a 'ClassNotFoundException' which is catched from 'SessionFactoryImpl.getImplementors'.
The class 'SessionImpl' should have the possibility to check whether the criteria is a Class or an Entity.
In case of a Class it should handle it as today. In case of an Entity it could simple set the Entity name as implementor (new String[] { criteria.getEntityOrClassName() };), like it is done within 'SessionFactoryImpl.getImplementors'.

For this the CriterisImp class needs an additional attribute 'private boolean isClass=true;' which is to be set from within the 'constructor' of this class.
An additional ' public boolean isClass()' method will allow the 'SessionImpl' to distinguish between Classes and Entities.

I have attached these two modified classes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list