
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Windows XP & Vista, latest version of hibernate and IDEA
|
|
| Build: |
7,757
|
| Severity: |
High
|
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.
|
|
Description
|
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. |
Show » |
| There are no comments yet on this issue.
|
|