Hibernate Annotations not working in IntelliJ 4.5.4

Hi all,

A couple of months ago, I had annotations working with Hibernate 3 in a project... had to return to Hibernate 2 for that project. Unfortunately, I don't recall if that was the same version of IntelliJ and I don't remember when I upgraded to 4.5.4

Now, new project... went to use Hibernate 3 with Annotations and the @Id and other annotations are not recognized by IntelliJ. @Entity was recognized but out of the hibernate.annotations package whereas I think it should be suggesting javax.persistence as the package.

I have the Language Level set to 1.5 and I have the 1.5 update 4 JDK as the project JDK.

I of course have what I believe are all of the hibernate and other jars in the project.

Is there something I'm missing or should look at besides what I have listed above?


Thanks,
Steve

3 comments
Comment actions Permalink

What's the error message you get?
If IDEA cannot resolve those annotations, then I guess you have problems
with those annotations being in respective jar.
Also you could try to find them in Ctrl-N popup.

Eugene.

"Steve Forsyth" <no_mail@jetbrains.com> wrote in message
news:33417903.1121983390934.JavaMail.javamailuser@localhost...

Hi all,

>

A couple of months ago, I had annotations working with Hibernate 3 in a
project... had to return to Hibernate 2 for that project. Unfortunately, I
don't recall if that was the same version of IntelliJ and I don't remember
when I upgraded to 4.5.4

>

Now, new project... went to use Hibernate 3 with Annotations and the @Id
and other annotations are not recognized by IntelliJ. @Entity was
recognized but out of the hibernate.annotations package whereas I think it
should be suggesting javax.persistence as the package.

>

I have the Language Level set to 1.5 and I have the 1.5 update 4 JDK as
the project JDK.

>

I of course have what I believe are all of the hibernate and other jars in
the project.

>

Is there something I'm missing or should look at besides what I have
listed above?

>
>

Thanks,
Steve



0
Comment actions Permalink

The Error message is just that it cannot resolve the class... so it can't find it. But then my question would be... where in the hell is the javax.persistence package?

From googling... it seems that the items I'm looking for exist in the above package... but googling does not help me find what jar that package is in.

I thought that IntelliJ had built-in support for annotations with JDK 1.5

The odd thing is that I've had it working in the past and I don't remember having to do anything special other than add the Hibernate jars to my project.

Steve

0
Comment actions Permalink

Ok... found the stupid mistake.

I must have skipped over this... you need to have the /lib/ejb3-persistence.jar added from the annotations dl which houses the javax.persistence package with the appropriate items.

0

Please sign in to leave a comment.