-->
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.  [ 9 posts ] 
Author Message
 Post subject: alpha5: HQL Editor not showing
PostPosted: Tue Aug 23, 2005 1:16 am 
Newbie

Joined: Thu Oct 09, 2003 5:00 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

3.0.5

Mapping documents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>

<property name="hibernate.connection.username">
postgres
</property>
<property name="hibernate.connection.password">
pg-admin
</property>
<property name="hibernate.dialect">
org.hibernate.dialect.PostgreSQLDialect
</property>
<property name="hibernate.connection.url">
jdbc:postgresql:testdb
</property>
<!-- <property name="hibernate.connection.url">jdbc:postgresql:cvrdb</property> -->
<property name="hibernate.connection.driver_class">
org.postgresql.Driver
</property>


<!-- mapping files -->
<mapping
resource="test/domain/DataBank.hbm.xml" />

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


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class name="test.domain.DataBank" table="databank"
schema="public">
<id name="id" type="long">
<column name="id" />
<generator class="sequence">
<param name="sequence">databank_id_seq</param>
</generator>
</id>
<property name="mti" type="string">
<column name="mti" length="5" />
</property>
<property name="field2" type="string">
<column name="field2" length="19" />
</property>
<property name="status" type="short">
<column name="status" />
</property>
</class>
</hibernate-mapping>



Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Using eclipse 3.1 fresh install on winXP machine, jdk-1.5.0_03, hibernate tools plug in from : http://download.jboss.org/jbosside/hibe ... velopment/

The plug-in runs OK for most part save that HQL Editor View is not shown anywhere in Hibernate Console Perspective.

Both Hibernate Dynamic Query Translator aand Hibernate Entity Model also do not work. Hibernate Configuration and Hibernate Query Result seems to be OK, though, working as expected.

hibernate.reveng.xml wizard is not seen anywhere.

Hibernate: Artifact Generation , Configuration File, Console Configuration and Reverse engineering work fine.

While in Hibernate Console perspective, clicking on Session Factory and its child node produced the following exception:
------------------------------------------------------
Error 2005-08-23 12:53:38.635 unexpected end of subtree []
org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree []
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:221)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:154)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:101)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:470)
at org.hibernate.impl.SessionFactoryImpl.getRepresentativeQuery(SessionFactoryImpl.java:755)
at org.hibernate.impl.SessionFactoryImpl.getReturnTypes(SessionFactoryImpl.java:745)
at org.hibernate.impl.AbstractQueryImpl.getReturnTypes(AbstractQueryImpl.java:501)
at org.hibernate.console.HQLQueryPage.getPathNames(HQLQueryPage.java:74)
at org.hibernate.eclipse.console.views.QueryPageViewer.addColumnsToTable(QueryPageViewer.java:215)
at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:170)
at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153)
at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111)
at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:87)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:57)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:61)
at javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:130)
at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
at org.hibernate.console.KnownConfigurations$4.queryPageCreated(KnownConfigurations.java:71)
at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:255)
at org.hibernate.console.ConsoleConfiguration.access$300(ConsoleConfiguration.java:33)
at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:235)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:227)
at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:175)
at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:116)
at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718)
at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057)
at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275)
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:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
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)
Caused by: <AST>:0:0: unexpected end of subtree
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2913)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:676)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:532)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:269)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:217)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:214)
... 55 more

--------------------------------------------

Is there anything else I need to do to get it work propertly? I like to get the HQL Editor View working. The doc says : " This update contains all the plugins necessary to run the latest version of Hibernate Tools eclipse plugins."

Thanks,
/bernard


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 3:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
as mentioned in the new and noteworthy HQL View is dead, long live the HQL Editor.

The HQL editor is opened by clicking the HQL Editor icon (upper right corner in Configurations view) when you have a configuration selected.

Yes - we need to have it more easily available...

the exception you get is just because we have a "feature" that sends an empty string query to be executed when you double click session factory - so the parser complains.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 4:39 am 
Newbie

Joined: Thu Oct 09, 2003 5:00 am
Posts: 4
max wrote:
as mentioned in the new and noteworthy HQL View is dead, long live the HQL Editor.

The HQL editor is opened by clicking the HQL Editor icon (upper right corner in Configurations view) when you have a configuration selected.

Yes - we need to have it more easily available...


Yes, HQL Editor (view) is what I meant. I thought of it being a 'view' so I was looking at Windows -> Show View - Others ... -> Hibernate ...

max wrote:
the exception you get is just because we have a "feature" that sends an empty string query to be executed when you double click session factory - so the parser complains.


While entering text into HQL Scratchpad (or is it HQL Editor?), hibernate dynamic query translator shows plentiful of exceptions while the text being entered not completed. My first expectation was for it to wait until I finish typing before it start parsing. I suppose this is the intended behavious to show the dynamic nature?

I also noticed that the Hibernate Entity Model only shown when Configuration node in Hibernate Console is clicked, it does not show on any other node. My first try was on Session Factory node, which then was showing exception which I thought mine wasn't working properly ...

BTW, the automatic layout is pretty ugly :) having all entities lined up vertically. Understand it is an alpha code, though.

Thanks Max, it helps lots!

/bernard


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 5:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
The Dynamic Query Translator actually does wait until you finished typing (it waits about a second I think). In any case I also think the exceptions are a bit too noisy, so I was thinking of splitting the view up in to parts - one big one for the last SQL that has been generated successfully and a side or bottom view showing the exception text if there is an exception... thoughs ?

Yes, the Entity model is only activated/updated on the configuration node - a concious choice for this release to avoid it being updated too often as it still is an experimental feature (did it in half a day ,)

The automatic layout is also explained by the "half a day" to do it - I couldnt get my head around the GEF layout to behave :( If anyone is into this kind of stuff please step up and I'll show you the exact spot on how to make it look nicer...

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: HQL Scratchpad Behavior Questiosn
PostPosted: Tue Aug 23, 2005 9:57 am 
Newbie

Joined: Mon Jun 13, 2005 6:31 pm
Posts: 9
The HQL Scratchpad acts like any other Eclipse editor window, except that it cannot be saved, and once you type in it, it's always 'dirty'. So any other Eclipse usage often blocks on 'Do you want to save your changes first'? Is this the designed behavior or just an alpha issue?

The editor doesn't seem to support any property introspection - I can get an auto-complete (ctrl-space) on an entity, but not on its properties. Is this planned, or am I not using it correctly?

I believe that the old HQL editor allowed you to execute the current statement with ctrl-enter? Might that be added instead of having to take your hands off the keyboard, grab the mouse, find the 'Run' arrow, possibly stopping to activate the HQL scratchpad window if it's not active in which case the Run button will be disabled, and then click it?

I understand it's alpha software and is already quite amazing for what it does - I'm just trying to understand what's planned, where recommendations can still be made, and where I might be seeing issues to report rather then the intended behavior.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 12:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you save the editor it will be opened again when you start eclipse.

Ctrl-enter is a work in progress ;) (too much xml wiring needed)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 12:35 pm 
Newbie

Joined: Mon Jun 13, 2005 6:31 pm
Posts: 9
Not sure I was clear -

If you open a scratchpad window, it's non-dirty.
Enter anything into it, it's now dirty, as shown by the asterisk in front of the name on its tab.
Try to save it, it doesn't save, and its dirty state does not change.
Many Eclipse tasks will now ask you to save it before proceeding
Try to close it, it prompts you to save. Say no and it closes. Say yes and it closes, also without saving.

Is this a bug I should report, or somehow the intended behavior?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 1:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ah - the asterisk thingy (dirty editor) is ok to report

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 1:39 pm 
Newbie

Joined: Mon Jun 13, 2005 6:31 pm
Posts: 9
Done: http://opensource2.atlassian.com/projec ... se/HBX-377


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.