Author: dgeraskov
Date: 2009-10-05 06:58:26 -0400 (Mon, 05 Oct 2009)
New Revision: 17886
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4872
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-10-05
10:05:59 UTC (rev 17885)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-10-05
10:58:26 UTC (rev 17886)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Copyright (c) 2008-2009 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -39,6 +39,7 @@
import org.hibernate.FetchMode;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Mappings;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.jdt.ui.internal.jpa.collect.AllEntitiesInfoCollector;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.EntityInfo;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefEntityInfo;
@@ -181,8 +182,7 @@
entry.setValue(subclass);
}
} catch (JavaModelException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ HibernateConsolePlugin.getDefault().log(e);
}
}
return pcCopy.values();
@@ -248,8 +248,8 @@
Table table = new Table(className.toUpperCase());
RootClass rootClass = new RootClass();
rootClass.setEntityName( className );
- rootClass.setClassName( entryInfo.getFullyQualifiedName() );
- rootClass.setProxyInterfaceName( className );
+ rootClass.setClassName( entryInfo.getFullyQualifiedName() );
+ rootClass.setProxyInterfaceName( entryInfo.getFullyQualifiedName() );
rootClass.setLazy(true);
rootClass.setTable(table);
rootClass.setAbstract(entryInfo.isAbstractFlag());//abstract or interface
@@ -406,7 +406,7 @@
key.addColumn(new Column(entityInfo.getPrimaryIdName().toUpperCase()));
}
array.setKey(key);
- array.setFetchMode(FetchMode.SELECT);
+ array.setFetchMode(FetchMode.JOIN);
SimpleValue index = new SimpleValue();
//add default index
@@ -511,7 +511,7 @@
Column column = new Column(varName.toUpperCase());
sValue.addColumn(column);
sValue.setTypeName(tb.getBinaryName());
- sValue.setFetchMode(FetchMode.SELECT);
+ sValue.setFetchMode(FetchMode.JOIN);
sValue.setReferencedEntityName(ref.fullyQualifiedName);
buildProperty(sValue);
prop.setCascade("none");//$NON-NLS-1$
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java 2009-10-05
10:05:59 UTC (rev 17885)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java 2009-10-05
10:58:26 UTC (rev 17886)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.hibernate.eclipse.jdt.ui.wizards;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -22,7 +32,13 @@
import org.eclipse.swt.widgets.Composite;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
+@SuppressWarnings("restriction")
public class NewHibernateMappingElementsSelectionPage extends WizardPage {
+
+ // sizing constants
+ private static final int SIZING_SELECTION_PANE_WIDTH = 320;
+
+ private static final int SIZING_SELECTION_PANE_HEIGHT = 300;
// the current selection
private IStructuredSelection fCurrentSelection;
@@ -37,8 +53,13 @@
}
public void createControl(Composite parent) {
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.widthHint = SIZING_SELECTION_PANE_WIDTH;
+ gd.heightHint = SIZING_SELECTION_PANE_HEIGHT;
+ parent.setLayoutData(gd);
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
+
createTreeViewer(composite);
fViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
setControl(composite);
@@ -54,7 +75,7 @@
}
protected TreeViewer createTreeViewer(Composite composite) {
- int style = SWT.BORDER | (fAllowMultiple ? SWT.MULTI : SWT.SINGLE);
+ int style = SWT.BORDER | SWT.V_SCROLL | (fAllowMultiple ? SWT.MULTI : SWT.SINGLE);
fViewer = new TreeViewer(composite, style);
fViewer.setContentProvider(new StandardJavaElementContentProvider());
fViewer.setLabelProvider(new JavaElementLabelProvider());