History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-17850
Type: Bug Bug
Status: Open Open
Assignee: Gregory Shrago
Reporter: Scott Mueller
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

bug in hibernate relationships

Created: 22 Apr 08 02:52   Updated: 22 Apr 08 13:24
Component/s: Code Analysis. Inspection, Code Analysis. Dependencies, J2EE.Hibernate

Environment: Windows XP & Vista, latest version of hibernate and IDEA

Build: 7,757
Severity: High


 Description  « Hide
Code inspector is marking getter functions in my hibernate POJOs with errors when they have bi-directional mappings. However, the code is perfectly accurate and works fine in practice. I just get code inspector warnings and, more importantly, can't use HQL console . It seems IntelliJ IDEA has a bug where it gets confused with bi-directional mappings, especially one-to-one mappings. That's when this started, when I needed to introduce one-to-one bi-directional relationships.

According to hibernate documentation I'm supposed to have one side with a <many-to-one unique="true"> element and the other side with a <one-to-one> element. You might think a bi-directional one-to-one mapping needs to have a <one-to-one> element on each entity, but that's not the case with Hibernate. The code inspector says, "'<many-to-one>' attribute has incorrect opposite '<one-to-one>' 'person'". On the opposite side of the one-to-one relationship the error reads, "'<one-to-one>' attribute has incorrect opposite '<many-to-one>' 'user'". Disregarding that code inspection error, the actual code works perfectly. And then the rest of my bi-directional relationships show errors now too.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.