10 Replies Latest reply on Jun 25, 2006 9:25 AM by Max Rydahl Andersen

    Hibernate Hql Editor not showing

    john smith Newbie

      To Whom It May Concern:

      I download the Hibernate-tools but I could not get the HQL editor to work in myeclipse following the pdf file which contains instructions how to use hibernate tools.

      I am currently using Hibernate 3.05, MyEclipse 4.1.1, HibernateTools-3.1.0.beta4, Microsoft sql 2000, jtds-1.2.jar for Microsoft java type 4 driver.
      Problem with Showing Hibernate Console
      Here are the steps I go in MyEclipse:
      1.)
      I go to File/New/Other..
      2.)
      I clicked on "Hibernate Console Configuration"
      3.)
      I clicked next, and filled out the following
      Name:ch05Test1
      Property file:\ch05\hibernate.propeties
      Configuration file:\ch05\src\java\hibernate.cfg.xml
      Mapping files:
      /ch05/src/java/com/manning/hq/ch05/Attendee.hbm.xml
      /ch05/src/java/com/manning/hq/ch05/Event.hbm.xml
      /ch05/src/java/com/manning/hq/ch05/Location.hbm.xml
      /ch05/src/java/com/manning/hq/ch05/Speaker.hbm.xml

      4.)
      classpath
      /ch05/bin
      c:/Tomcat5/common/lib/jtds-1.2.jar

      I clicked finished, I don't see the Console Configuration.
      I even choose "Window/Open Perspective/Hibernate Console.
      and I don't see a HQL Editor?


      Yours,

      Desperate.

        • 1. Re: Hibernate Hql Editor not showing
          Max Rydahl Andersen Master

          MyEclipse bundle of Hibernate Tools is an old version plus they removed stuff from the distribution, in particular the query editing facilities.

          I suggest you use our distribution in a seperate eclipse instance (since myeclipse is for now not compatible with WTP since they have their own legacy version of it).

          • 2. Re: Hibernate Hql Editor not showing
            john smith Newbie

            Hi:

            I tried with Eclipse 3.1.2 and HibernateTools-3.1.0.beta4, Hibernate 3.05.jar.

            When I am in Eclipse 3.1.2 and chooses "Show View/Other../Hibernate".
            All, I see is the following:
            Hibernate Configurations
            Hibernate Dynamic Query Translator
            Hibernate Entity Model
            Hibernate Query Result
            Hibernate Relational Model
            Query Parameters

            I don't see HQL Editor view.
            Also, I did an Hibernate Configuration. It seems ok until, I right click on it and did a "refresh".
            I get the following error:

            Error while fetching children
            Reason:
            org.hibernate.MappingException:Resource:
            net/rrd/mdts/model/domainobject/FmwkUser.hbm.xml not found.

            My hibernate.cfg.xml is right on the directory that contains the package "net/rrd/mdts/model/domainobject/".

            Even when I take out the package name and place the FmwkUser.hbm.xml in the same directory as the hibernate.cfg.xml file and also I took out the package name for the FmwkUser.hbm.xml in the hibernate.cfg.xml file, I get the error:

            Error while fetching children
            Reason:
            org.hibernate.MappingException:Resource:FmwkUser.hbm.xml not found.

            Yours,

            Albert
            I suggest you use our distribution in a seperate eclipse instance (since myeclipse is for now not compatible with WTP since they have their own legacy version of it).

            • 3. Re: Hibernate Hql Editor not showing
              Max Rydahl Andersen Master

              have you added a path to the classpath of console configuration which contains that resource ?

              • 4. Re: Hibernate Hql Editor not showing
                john smith Newbie

                Hi :

                I added the classpath and when I do a refresh on the Hibernate Configuration. I get the following error:

                Error while fetching
                I am still not seeing "HQL Editor view". So, I tried to create a "Hibernate configuration". I am using Hibernate 3.05. In my hibernate.cfg.xml, I have the following xml:

                <hibernate-configuration>
                <session-factory>
                true



                </session-factory>
                </hibernate-configuration>

                Is there a way to change the hibernate.cfg.xml file so it will know how to find all of the hbm.xml files. I don't want to listed them all in the hibernate.cfg.xml. It's too troublesome.

                Yours,

                Frustrate.

                • 5. Re: Hibernate Hql Editor not showing
                  john smith Newbie

                   

                  "jadeite100" wrote:
                  Hi :

                  I added the classpath and when I do a refresh on the Hibernate Configuration. I get the following error:

                  Error while fetching
                  I am still not seeing "HQL Editor view". So, I tried to create a "Hibernate configuration". I am using Hibernate 3.05. In my hibernate.cfg.xml, I have the following xml:

                  <hibernate-configuration>
                  <session-factory>
                  <property name="show_sql">true</property>
                  <mapping resource="net/rrd/mdts/model/domainobject/FmwkUser.hbm.xml"/>
                  <mapping resource="net/rrd/mdts/model/domainobject/FmwrkSecurityGroupUser.hbm.xml"/>

                  </session-factory>
                  </hibernate-configuration>

                  Is there a way to change the hibernate.cfg.xml file so it will know how to find all of the hbm.xml files. I don't want to listed them all in the hibernate.cfg.xml. It's too troublesome.

                  Yours,

                  Frustrate.


                  • 6. Re: Hibernate Hql Editor not showing
                    Max Rydahl Andersen Master

                    no, hibernate does not support auto scanning out of the box.

                    How do you cope with that in your app anyhow ? programmatically ?

                    i just committed <ejb3configuraiton> support to the ant tasks, but that won't help you in the eclipse ui for now.

                    • 7. Re: Hibernate Hql Editor not showing
                      john smith Newbie

                      I added the following to the hibernate.cfg.xml:

                      <hibernate-configuration>
                      <session-factory>


                      classpath:/net/rrd/mdts/model/domainobject


                      </session-factory>
                      </hibernate-configuration>

                      I am still getting a null pointer exception. Note, the above has a "property" tag and than a "list" tag and than the "value" tag. It's just not showing properly in the forum.

                      Yours,

                      Frustrated.

                      • 8. Re: Hibernate Hql Editor not showing
                        Max Rydahl Andersen Master

                        i cannot see half of the xml but the stuff i do see with "classpath:" I have no idea why you would put that in a hibernate.cfg.xml ?

                        • 9. Re: Hibernate Hql Editor not showing
                          Terence Hill Newbie

                          I am using eclipse 3.2.1 and org.hibernate.eclipse_3.1.0.beta5

                          I have the same problem!

                          After reenginered sucessfully my mysql db shema and generated code with hib eclipse plugin, i am still missing the sql editor, the properties in my hibernate.xml stay empty and the entity and relation view stays empty too -
                          although there are java classes representing the mysql tables, the mapping files (hbm.xml) and doc generated in source dir.

                          Please help, tx in advance.

                          • 10. Re: Hibernate Hql Editor not showing
                            Max Rydahl Andersen Master

                            have you read the docs and/or tried to open the Hibernate Console Perspective where clicking on the configuration enables all this stuff.