JPA functionality in 7051: is it there?
Hi there,
Just wanted to ask if this is considered functional in the latest release
build (7051). I was trying to use IDEA for mapping to some oracle database
tables and I found myself completelly lost (although I successfully used
IDEA's JPA stuff half a year ago).
It looks like the functionality has been moved, or something (it it's there
at all), as I can't seem to find how to generate JPA classes after I create
a datasource definition. What are the steps one has to perform these days
in order to end up with nicely mapped java classes?
Thx,
Andrei
Please sign in to leave a comment.
Hello Andrei,
From recent IDEA builds JPA (and Hibernate) facet has "Descriptors" panel
in settings dialog. User can manually add .xml descriptors there. After that
IDEA "sees" persistent units defined in that descriptors. Probably this step
is what you're missing?
Alexander.
Hello Alexander,
AC> From recent IDEA builds JPA (and Hibernate) facet has "Descriptors"
AC> panel in settings dialog. User can manually add .xml descriptors
AC> there. After that IDEA "sees" persistent units defined in that
AC> descriptors. Probably this step is what you're missing?
I tried that, but I'll do it again with a clean setup. When I first tried
to create the datasource I got an exception (reported) and managed to go
through after defining a J2EE application facet (the create datasource worked
ok after that).
But later on I defined the JPA facet and I wonder if my datasource remained
connected with the J2EE one I created initially. When I go to the datasource
dialogs and click import I get a pop-up dialog telling me there's no datasource
(which there is, in fact).
I'll try starting from scratch and see how it goes. Just wanted to know if
I should dig deeper or fall back on an older build (or 6.0.x which I know
how to do this stuff in). Good to know the functionality is there and it
should work, I'll try some more with the EAP build.
Best,
Andrei
Tried with a clean setup, but still didn't work. It still wants a J2EE App facet before it can create a datasource, and when clicking import on the datasource panel it tells me there's no datasource.
As a sidenote, I just opened the same project with M1 and managed to create the mapping from the context menu of the module. It looks like the mapping entry in the pop-up menu has been replaced with the import button on the datasources dialog (as I wasn't able to find the mapping entry on the pop-up menu in the latest build), but the new button does not work properly.
Or do I miss something obvious here?
Best,
Andrei
Attachment(s):
noDatasource.png
Hello Andrei,
"Import" button imports DataSource information from sources like spring
and hibernate configuration files if the appropriate facets can be found
in a project.
"Generate Persistence Mappings/By DataSource" action is available in the
JavaEE structure view on Facet and PersistenceUnit/SessionFactory nodes.
Regards,
Gregory Shrago
Andrei Oprea wrote:
Hello Gregory,
GS> "Generate Persistence Mappings/By DataSource" action is available in
GS> the JavaEE structure view on Facet and
GS> PersistenceUnit/SessionFactory nodes.
GS>
I see, good to know where it moved. I'll try it again, then. :)
Best,
Andrei