[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-109) Lazy loaded entity could not be indexed

Alexander Chebanenko (JIRA) noreply at atlassian.com
Wed Aug 8 15:49:13 EDT 2007


Lazy loaded entity could not be indexed
---------------------------------------

                 Key: HSEARCH-109
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-109
             Project: Hibernate Search
          Issue Type: Bug
          Components: engine
    Affects Versions: 3.0.0.beta4
         Environment: Hibernate 3.2.4
J2SE5, J2SE6
MySQL 4, MySQL 5
            Reporter: Alexander Chebanenko


When lazy-loading an entity it could not be indexed. Example:

Query query = ftSession.createQuery("from Entity");
for(Iterator it=query.iterate(); it.hasNext(); ) {
  Entity entity = (Entity) it.next();
  ftSession.index(entity);
}

When query is lazy and entityes are proxied, documents will be created with "_hibernate_class" field set to proxy class, not entity class. It happens because of the bug in DocumentBuilder.getDocument method. This method takes entity.getClass() for indexing, not Hinernate.getClass(entity) as it might be expected. 

-- 
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