-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: Editor to execute HQL
PostPosted: Tue Mar 28, 2006 4:01 pm 
Beginner
Beginner

Joined: Mon Feb 27, 2006 11:16 am
Posts: 25
To Whom It May Concern:

I am currently using Hibernate 3.05, Eclipse 3.1, MyEclipse 4.1, and Tomcat 5.

I want to test my hql before using it.
Does anybody know how to execute the hibernate editor that allows you to execute hql.


I read it somewhere that Hibernate 3 provides some kind of java interface to execute hql.

Yours,

Desperate.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 5:05 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
hibernate tools

http://www.hibernate.org/255.html

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject: Re: Editor to execute HQL
PostPosted: Tue Mar 28, 2006 5:19 pm 
Beginner
Beginner

Joined: Mon Feb 27, 2006 11:16 am
Posts: 25
[quote="jadeite100"]To Whom It May Concern:

Hi Chris:

I saw this "Hibernate Tools" link but it is only helpfull if you use jboss ide.
I read in one of the Hibernate books that you can start an hibernate interface that comes with hibernate 2 and higher that allows you to execute hql.

I am currently using MyEclipse 4.1.1, do you know if myeclipse has such a feature.

Yours,

Desperate.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 5:24 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
it works in eclipse

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject: How to do it not in eclipse
PostPosted: Tue Mar 28, 2006 11:24 pm 
Beginner
Beginner

Joined: Mon Feb 27, 2006 11:16 am
Posts: 25
Hi Chris:

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.

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.

Yours,

Desperate.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 10:08 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
the console configuration is an eclipse view, did you go to window/show view/other

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject: Not seeing Hql Editor view
PostPosted: Wed Mar 29, 2006 11:32 am 
Beginner
Beginner

Joined: Mon Feb 27, 2006 11:16 am
Posts: 25
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,

Frustrated


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 12:40 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
when you edit the hibernate configuration, you have to add those mapping files to it and it has to be able to access them.

once you get that working, you right click on the configuration and click 'create session factory'

then a little button in the top right corner of the hibernate configuration window becomes active and you can click it. it is the hql editor button.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject: HQL Editor Not Showing
PostPosted: Wed Mar 29, 2006 12:54 pm 
Beginner
Beginner

Joined: Mon Feb 27, 2006 11:16 am
Posts: 25
Hi Chris:

I did what you said, Window/Show View/Other../Hibernate and I get the following:

Hibernate:
Hibernate Configuration
Hibernate dynamic Query Translator
Hibernate Entity Model
Hibernate Query Result
Hibernate Relational Model
Query Parameters

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.
</session-factory>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 4:22 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
you want the Hibernate Configuration view. then you make a new console configuration (not the cfg.xml file), add all your mapping files/drivers to it. the console configuration is a GUI window that pops up for you to edit.

once you get the console configuration set up, you right click it, create a new session factory. then, from that window you open the HQL Editor view which is in the upper right of the 'hibernate configuration' window

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.