Persistence Unit

Can someone tell me how to use New -> Persistence Unit. I have a bunch of annotated Entity classes and tried to use this feature. I got the exception shown at the end of this post.
I'm not sure whether it's a bug in IDEA or whether I'm using this feature wrongly. I thought it would somehow help me to create a persistence.xml.
BTW: There is no application server here (no JBoss etc.). It's a standalone Swing application with Spring 2.0 and Java Persistence API using Hibernate as the implementation.


No implementation for method public abstract java.util.List com.intellij.javaee.model.xml.persistence.Persistence.getPersistenceUnits() in class interface com.intellij.javaee.model.xml.persistence.Persistence
java.lang.UnsupportedOperationException: No implementation for method public abstract java.util.List com.intellij.javaee.model.xml.persistence.Persistence.getPersistenceUnits() in class interface com.intellij.javaee.model.xml.persistence.Persistence
at com.intellij.util.xml.impl.GenericInfoImpl.createInvocation(GenericInfoImpl.java:17)
at com.intellij.util.xml.impl.DomInvocationHandler.createInvocation(DomInvocationHandler.java:103)
at com.intellij.util.xml.impl.DomInvocationHandler.doInvoke(DomInvocationHandler.java:295)
at com.intellij.util.xml.impl.DomInvocationHandler.invoke(DomInvocationHandler.java:21)
at com.intellij.javaee.model.xml.impl.BaseImpl$$EnhancerByCGLIB$$aef9278.getPersistenceUnits(]]>)
at com.intellij.javaee.persistence.view.CreatePersistenceUnitAction.a(CreatePersistenceUnitAction.java:32)
at com.intellij.javaee.persistence.view.CreatePersistenceUnitAction.createElementsInternal(CreatePersistenceUnitAction.java:15)
at com.intellij.javaee.persistence.view.AbstractCreateElementsAction$1$1.run(AbstractCreateElementsAction.java:3)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:295)
at com.intellij.javaee.persistence.view.AbstractCreateElementsAction$1.run(AbstractCreateElementsAction.java:3)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:25)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:28)
at com.intellij.javaee.persistence.view.AbstractCreateElementsAction.createElements(AbstractCreateElementsAction.java:4)
at com.intellij.javaee.persistence.view.CreatePersistenceUnitAction$1.canClose(CreatePersistenceUnitAction.java:3)
at com.intellij.openapi.ui.Messages$InputDialog$1.actionPerformed(Messages.java:504)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(BasicRootPaneUI.java:190)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1571)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2763)
at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:255)
at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:204)
at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2840)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2832)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2726)
at java.awt.Component.processEvent(Component.java:5265)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
at java.awt.Component.dispatchEventImpl(Component.java:3841)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:11)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:192)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:167)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
at java.awt.Dialog$1.run(Dialog.java:515)
at java.awt.Dialog.show(Dialog.java:536)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:45)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:77)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:730)
at com.intellij.openapi.ui.Messages.showInputDialog(Messages.java:268)
at com.intellij.javaee.persistence.view.CreatePersistenceUnitAction.invokeDialog(CreatePersistenceUnitAction.java:20)
at com.intellij.javaee.persistence.view.AbstractCreateElementsAction.actionPerformed(AbstractCreateElementsAction.java:8)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:9)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:16)
at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:265)
at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:201)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:1)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:11)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:14)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:167)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

2 comments

Hello Robert!

Fixed and will be available in the next EAP build.
Thanks for your report.

Gregory

Robert F. Beeger wrote:

Can someone tell me how to use New -> Persistence Unit. I have a bunch of annotated Entity classes and tried to use this feature. I got the exception shown at the end of this post.
I'm not sure whether it's a bug in IDEA or whether I'm using this feature wrongly. I thought it would somehow help me to create a persistence.xml.
BTW: There is no application server here (no JBoss etc.). It's a standalone Swing application with Spring 2.0 and Java Persistence API using Hibernate as the implementation.


No implementation for method public abstract java.util.List com.intellij.javaee.model.xml.persistence.Persistence.getPersistenceUnits() in class interface com.intellij.javaee.model.xml.persistence.Persistence
java.lang.UnsupportedOperationException: No implementation for method public abstract java.util.List com.intellij.javaee.model.xml.persistence.Persistence.getPersistenceUnits() in class interface com.intellij.javaee.model.xml.persistence.Persistence
at com.intellij.util.xml.impl.GenericInfoImpl.createInvocation(GenericInfoImpl.java:17)

0

Please sign in to leave a comment.