[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-383) Hibernate Search does not respect the @AccessType annotation in respect to @Id fields.

Emmanuel Bernard (JIRA) noreply at atlassian.com
Thu Apr 8 10:59:42 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36290#action_36290 ] 

Emmanuel Bernard commented on HSEARCH-383:
------------------------------------------

Hibernate Search was never meant to honor JPA or Hibernate's access types. What happens if you move @DocumentId to the right host?

> Hibernate Search does not respect the @AccessType annotation in respect to @Id fields.
> --------------------------------------------------------------------------------------
>
>                 Key: HSEARCH-383
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-383
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 3.1.0.GA, 3.1.1.GA
>         Environment: Hibernate 3.3.1.GA
>            Reporter: Steven Knock
>            Priority: Minor
>         Attachments: TestAccessTypeProblem.java
>
>
> This occurs when indexing an Entity annotated as @IndexedEmbedded if the object that it is @ContainedIn is a proxy object that has not yet been loaded and if the @AccessType of the @Id of the proxy object has been overriden from field to property.
> This is because Hibernate Search does not respect the @AccessType annotation, and so attempts to read the id of the parent object directly from the member variable, which is not initialised in the proxy and so returns 0 in the attached test case.
> The problem is in:
>   org.hibernate.search.engine.DocumentBuilderIndexedEntity.checkDocumentId().
> This results in a record in the Lucene index that has no reference to the containing instance. So, while the number of results is returned correctly, any attempt to actually retrieve the results and convert them into Hibernate objects fails.

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