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

Key: IDEADEV-31414
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Gregory Shrago
Reporter: Per Olesen
Votes: 3
Watchers: 2
Operations

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

I keep getting 'More than one attribute configured for method xxx'

Created: 18 Jun 08 16:35   Updated: 04 Nov 08 18:28
Component/s: Code Analysis. Inspection, J2EE.EJB3
Fix Version/s: Diana 8940

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. File idea-files.bz2 (14 kb)

Environment: linux
Issue Links:
Duplicate
This issue duplicates:
IDEADEV-31412 Two JPA EJB persistence units in one ... Normal Resolved
 

Build: 8,471
Fixed in build: 8,916


 Description  « Hide
When viewing my JPA annotation mapped classes in IDEA, it keep telling me this JEE inspection as an error:

More than one attribute configured for method xxx

but I don't think it is multiply mapped. The application runs fine (on hibernate as the provider).

(this is also a problem in v7 final versions)



 All   Comments   Work Log   Change History      Sort Order:
Arik Kfir - 07 Jul 08 00:00
Yes, I get that too, when you use a column that has both @Version and @Column, which is a legal use-case (it even appears in the @Version's javadoc as an example).

The same happens when you have @Id and @Column (which is also a valid use-case).


Erik Pragt - 12 Aug 08 16:19
I've got the same issue. I have some fields which have an @Id OR and @Column (not both of them), and I also get this error. I'm using 8M1 btw.

Gregory Shrago - 12 Aug 08 18:58
Most likely, the problem is project-configuration-related.

I need to know the structure of your projects.

Modules/Dependencies/Facets/Descriptors


Arik Kfir - 12 Aug 08 22:54
Hi,

Well, I have about twenty modules so I can't lay them all here, but I can send the entire *.iml and *.ipr files - would that help?


Gregory Shrago - 13 Aug 08 17:13
It would. Plus I need to know how many XMLs refer to the class with "more than one.." directly (mapping XML) or indirectly (hibernate or spring config with annotatedPackages attribute etc.).

Arik Kfir - 16 Aug 08 22:38
Hi,

I've attached my project files as requested. We have no mapping XMLs except 'persistence.xml' which specifies all our entities. All our entities use @Entity annotations, and are listed in our persistence.xml file.

In addition, all our entities extend a common base class ("AbstractEntity" or "AbstractVersionedEntity" which extends the former) which provide the @Id and @Version attributes. These properties have both a @Id/@Version and @Column annotations.

Here is a snippet:

    @Version
    @Column( name = "VERSION", nullable = false )
    public Integer getVersion() {
        return version;
    }

Gregory Shrago - 19 Aug 08 22:22
I've tried to reproduce the situation in a small project with no luck.
There are 2 JPA facets in 2 independent modules and this seems to be perfectly Ok.

Are there any duplications in your persistence.xml's?


Arik Kfir - 20 Aug 08 12:02
No. But the 'AbstractEntity' class (which is a @MappedSuperclass) is extended in both modules.

peter royal - 30 Aug 08 03:52
I am seeing this as well... IDEA-18993 ... Could the next EAP release be instrumented to provide more debugging information?

I am using Hibernate with Spring. My entities are defined in my hibernate configuration ONLY. If I comment an entity from the hibernate configuration, it looses all of the JPA markup in the right gutter (aka, what it looks like when there is no Hibernate facet active).


peter royal - 12 Sep 08 23:35
I am still seeing this in 8792.

Anything that can be done to help diagnose?


Gregory Shrago - 15 Sep 08 16:35
It will really help if you attach a small self-contained project just to reproduce the problem.

Arik Kfir - 04 Nov 08 18:28
Build #8995 fixed this for me (might be the one before, been a while since I tested this).
Thanks!