Author: vyemialyanchyk
Date: 2010-02-10 11:05:54 -0500 (Wed, 10 Feb 2010)
New Revision: 20221
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5825 - fixed
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java 2010-02-10
15:02:06 UTC (rev 20220)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java 2010-02-10
16:05:54 UTC (rev 20221)
@@ -44,6 +44,7 @@
protected boolean sticky = true;
private List<Throwable> exceptions = new ArrayList<Throwable>();
protected String tabName;
+ protected QueryInputModel model;
/**
* @param i
@@ -60,8 +61,9 @@
}
}
- public AbstractQueryPage(ConsoleConfiguration cfg) {
+ public AbstractQueryPage(ConsoleConfiguration cfg, QueryInputModel model) {
this.cfg = cfg;
+ this.model = model;
}
/**
*
@@ -153,4 +155,8 @@
this.tabName = tabName;
pcs.firePropertyChange("tabName", oldValue, tabName); //$NON-NLS-1$
}
+
+ public void setModel(QueryInputModel model) {
+ this.model = model;
+ }
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java 2010-02-10
15:02:06 UTC (rev 20220)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java 2010-02-10
16:05:54 UTC (rev 20221)
@@ -36,7 +36,6 @@
private Query query;
private String queryString;
- private QueryInputModel model;
public List<Object> getList() {
if (query==null) return Collections.emptyList();
@@ -95,10 +94,9 @@
* @param queryParameters
*/
public HQLQueryPage(ConsoleConfiguration cfg, String string, QueryInputModel model) {
- super(cfg);
+ super(cfg, model);
queryString = string;
setTabName(getQueryString().replace('\n', ' ').replace('\r',
' '));
- this.model = model;
}
public void setSession(Session s) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2010-02-10
15:02:06 UTC (rev 20220)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2010-02-10
16:05:54 UTC (rev 20221)
@@ -48,17 +48,14 @@
private Interpreter ip;
- private QueryInputModel model;
-
/**
* @param model
* @param session2
*/
public JavaPage(ConsoleConfiguration cfg, String criteriaCode, QueryInputModel model)
{
- super(cfg);
+ super(cfg, model);
this.criteriaCode = criteriaCode;
setTabName(getQueryString().replace('\n', ' ').replace('\r',
' '));
- this.model = model;
}
@SuppressWarnings("unchecked")
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2010-02-10
15:02:06 UTC (rev 20220)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2010-02-10
16:05:54 UTC (rev 20221)
@@ -92,4 +92,6 @@
/** Return result size if known, -1 if not */
public int getResultSize();
+
+ public void setModel(QueryInputModel model);
}
\ No newline at end of file
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2010-02-10
15:02:06 UTC (rev 20220)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2010-02-10
16:05:54 UTC (rev 20221)
@@ -150,6 +150,7 @@
public Object execute() {
KnownConfigurations.getInstance().getQueryPageModel().remove(queryPage);
Session session = cfg0.getSessionFactory().openSession();
+ queryPage.setModel(getQueryInputModel().getCopyForQuery());
queryPage.setQueryString(getQueryString());
queryPage.setSession(session);
KnownConfigurations.getInstance().getQueryPageModel().add(queryPage);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2010-02-10
15:02:06 UTC (rev 20220)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2010-02-10
16:05:54 UTC (rev 20221)
@@ -420,13 +420,14 @@
// ignore
}
if (queryPage == null || !getPinToOneResTab()) {
- queryPage = cfg.executeHQLQuery(getQueryString(),
getQueryInputModel().getCopyForQuery() );
+ queryPage = cfg.executeHQLQuery(getQueryString(),
getQueryInputModel().getCopyForQuery());
} else {
final ConsoleConfiguration cfg0 = cfg;
cfg.execute(new Command() {
public Object execute() {
KnownConfigurations.getInstance().getQueryPageModel().remove(queryPage);
Session session = cfg0.getSessionFactory().openSession();
+ queryPage.setModel(getQueryInputModel().getCopyForQuery());
queryPage.setQueryString(getQueryString());
queryPage.setSession(session);
KnownConfigurations.getInstance().getQueryPageModel().add(queryPage);