1 2 Previous Next 23 Replies Latest reply on May 11, 2006 3:36 PM by maxandersen Go to original post
      • 15. Re: Hibernate Tools 1.5beta4 - Session is closed!
        lcoetzee

        Small little steps :-)

        I have added my Entities to the hibernate.cfg.xml e.g. :

         <mapping class="csir.content.par.Content"/>
        


        In addition I have also placed the jboss-seam.jar on the Classpath (with the jdbc driver and path to compiled classes).

        I can now expand the various tabs and see the entities (and by clicking on it I can also see sql generated ) ... e.g. for the Content class:

        DEBUG main org.hibernate.SQL - select content0_.content_id as content1_81_, content0_.grouping_grouping_id as grouping6_81_, content0_.reviewedBy_portaluser_id as reviewedBy7_81_, content0_.submittedBy_portaluser_id as submitte8_81_, content0_.replacing_fk as replacing9_81_, content0_.metacontent_fk as metacon10_81_, content0_.specifiedContentElements_content_element_container_id as specifi11_81_, content0_.reasonForInclusion as reasonFo2_81_, content0_.date as date81_, content0_.version as version81_, content0_.status as status81_ from content content0_



        Now just for the queries and the ability to see the Entity Model

        L

        • 16. Re: Hibernate Tools 1.5beta4 - Session is closed!
          lcoetzee

          Hi Max, I am starting to make quite a bit of progress now !

          I am able to see my entity model and do HQL on some Entities (and also see the results).

          I get the following though:

          org.hibernate.HibernateException: Enum class not found
          


          I use quite a few enums in my Entities ( I have tried mapping them in my hibernate.cfg.xml.... but that did not do the trick). The Enums are on the same classpath as the Entities (I think this might be the reason for some of the odities that still pops up... e.g. when I do an HQL for some Entities the focus immediately jumps to the Error tab, and I can't see the results. )

          Ideas re. the Enums ?

          Oh.. is it possible to save the Entity Model (or print it for that matter) ? Would be fantastic !

          Must say now that I have started to get things working slowly I am massively impressed ! Excellent work !

          Thanks

          L



          • 17. Re: Hibernate Tools 1.5beta4 - Session is closed!
            maxandersen

            hmm hibernate.cfg.xml should contain those mappings if you choose to run the hibernate.cfg.xml exporter.

            The Enum class I don't have a good answer too...is it the jdk enum ? Are you running eclipse with jdk 5 ?

            ...and if you select the entity view you *should* be able to print it (i don't guarantee it will be pretty, but it is printable!)

            • 18. Re: Hibernate Tools 1.5beta4 - Session is closed!
              lcoetzee

              I tried regenarating the hibernate.cfg.xml... still no mappings.

              Jip.. is the JDK enum running eclipse in JDK 5.0

              Will try the printing.

              The current status is that I can perform HQL queries, see the results and also see the Entity Model. One interesting thing is that the focus almost always jumps to the error log panel, making it difficult to view the results (if you retry a number of times (by clicking on the HQL output panel) one sometimes gets the focus to stay there which allows me to view the results.

              But with all of that, I am hugely impressed.

              Thanks

              L

              • 19. Re: Hibernate Tools 1.5beta4 - Session is closed!
                maxandersen

                hibernate.cfg.xml should contain references to mappings iif the console configuration contains mappings AND/OR you are reverse engineering from a db.

                the error log view thingy is a pain yes - can be made less annoyed by deselecting "Activate on new events"

                • 20. Re: Hibernate Tools 1.5beta4 - Session is closed!
                  vladorl

                  Hello, All.
                  I've installed Hibernate tools (ver. 3.1.0.beta5). Then I made an attempt to configure it on existing project with completed hibernate configuration (hibernate.cfg.xml) and entity classes. As the result I've got the list of entity classes under Configuration node in Hibernate Configurations panel. But I can't create session factory - the error is java.lang.NoSuchFieldError: extendsQueue (you can see the full error log below). Attempt to update annotations jar (to ver. 3.1.0.beta10) doesn't help.

                  How I can get it working?

                  java.lang.NoSuchFieldError: extendsQueue
                  at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:143)
                  at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276)
                  at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:213)
                  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
                  at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:265)
                  at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
                  at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
                  at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:260)
                  at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:38)
                  at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:46)
                  at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
                  at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
                  at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
                  at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
                  at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
                  at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
                  at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
                  at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
                  at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
                  at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
                  at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
                  at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
                  at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
                  at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
                  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
                  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
                  at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
                  at org.eclipse.core.launcher.Main.run(Main.java:973)
                  at org.eclipse.core.launcher.Main.main(Main.java:948)

                  • 21. Re: Hibernate Tools 1.5beta4 - Session is closed!
                    maxandersen

                    do not put hibernate related jars into the console configuration path.

                    • 22. Re: Hibernate Tools 1.5beta4 - Session is closed!
                      vladorl

                      Hello, Max.
                      There is no hibernate jars put in console config path, only web application related classes (were entity classes are stored) and jdbc driver jar.

                      • 23. Re: Hibernate Tools 1.5beta4 - Session is closed!
                        maxandersen

                        are you 100% sure you are using the latest release ?

                        1 2 Previous Next