-->
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.  [ 4 posts ] 
Author Message
 Post subject: Which is current configuration? (eclipse plugin question)
PostPosted: Fri Oct 10, 2008 9:21 am 
Newbie

Joined: Wed Jun 16, 2004 5:53 am
Posts: 4
Hi,

I've hacked the eclipse plugin to show @NamedQuery values in the Configuration/Entity view thus :

Image


It's very dirty (I've never worked on an eclipse plugin, and only had half a day).

Does anyone know how to obtain the current ConsoleConfiguration that is being opened in the panel? From for example
Code:
org.hibernate.eclipse.console.workbench.PersistentClassWorkbenchAdapter


Code:
KnownConfigurations.getInstance().getConfigurations()
gives me them all, but I can't find out how to tell which is the one being worked on.

Any hints would be appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2008 1:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Each node in the tree is created with the proper info; so the parent of the node injects the Console configuration into the child nodes.

I assume you do something similar to get that query node shown up in there ?

The code for this is in the *WorkBenchAdapters which create the children.

p.s. sorry for the late reply - but I had to get married before I could answer ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2008 10:09 am 
Newbie

Joined: Wed Jun 16, 2004 5:53 am
Posts: 4
Hi, thanks for the reply, and Congratulations!

in PersistentClassWorkbenchAdapter.getChildren(...) i'm doing :

Code:
         ConsoleConfiguration[] cs = KnownConfigurations.getInstance().getConfigurations();
         ConsoleConfiguration consoleConfiguration = cs[0];
         Configuration config = consoleConfiguration.getConfiguration();

         Map namedQueryMap = config.getNamedQueries();


and then looking for the right queries based on the PersistentClass instance passed to getChildren

It's horrid I know and will not work with more than one configuration, but there is no priority on this and I just found it useful to have the list of named queries in the configuration view.

I'm sure there is a way to get the current config from the Adapter, but I can't find it.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 19, 2008 8:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
None of the other PersistentClass children ever needed the Configuration hence it does not know it.

so no easy solution...needs updating the api

_________________
Max
Don't forget to rate


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