JPA 2.0 tools without persistence.xml

Hi,

I'm setting up a persistence.xml-free JPA/Hibernate 4/Spring 3.1 project using IntelliJ 11, but it looks like I must have a persistence.xml file in order to use the JPA/Hibernate QL.

Am I missing something? Is it possible to use those tools without persistence.xml ?

Thanks in advance,
Nadav

4 comments
Comment actions Permalink

Persistence.xml-free configuration is possible.
You just need JPA and Spring facets and a Spring Annotation or XML (config file set) configuration.

See these demos how to setup an annotation configuration:
http://blogs.jetbrains.com/idea/2012/02/annotationconfigapplicationcontext-support-in-intellij-idea-111/

Once completed all persistence units should automatically appear in Persistence toolwindow.

1
Comment actions Permalink

Hello Gregory Shrago,

Once completed all persistence units should automatically appear in Persistence toolwindow.


Thank you for the tip. I managed to do that with my persistence.xml-free & Java-based spring configuration projects.
Indeed the Persistence tool window is populated with data, and I even can see the ORM diagram.
All seems ok except the fact I didn't managed to run JPAQL queries against this configuration.
Did you managed to run JPAQL against such as configurations?

Thank you in advance.

Note: I created a persistence.xml file (which replicate the persistence.xml free configuration) in order to run all JPA queries.

0
Comment actions Permalink

I've checked this and QL console really doesn't work so I've created ticket for you, sorry for delay.

http://youtrack.jetbrains.com/issue/IDEA-87167

The fix will be available in the next 11.1.3 EAP.

0
Comment actions Permalink
http://youtrack.jetbrains.com/issue/IDEA-87167



The fix will be available in the next 11.1.3 EAP.


Thank you Gregory. That's great.

0

Please sign in to leave a comment.