JBoss Tools SVN: r21125 - in branches/hibernatetools-multiversion/hibernatetools/plugins: org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-29 13:44:48 -0400 (Mon, 29 Mar 2010)
New Revision: 21125
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ShapeHideAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ShapeShowAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeVisibleStateAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/command/ToggleShapeVisibleStateCommand.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ComponentShape.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmShape.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/SpecialOrmShape.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/SpecialRootClass.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/ConnectionEditPart.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/OrmShapeEditPart.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/ShapeEditPart.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/DiagramEditorInput.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/HibernateUtils.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OpenDiagramActionDelegate.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmImageMap.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelMap.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/META-INF/MANIFEST.MF 2010-03-29 17:44:48 UTC (rev 21125)
@@ -5,6 +5,7 @@
Bundle-Version: 3.3.0.qualifier
Bundle-Activator: org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin
Require-Bundle:
+ org.hibernate.mediator,
org.hibernate.eclipse.console,
org.hibernate.eclipse,
org.eclipse.debug.core,
@@ -20,7 +21,8 @@
org.eclipse.jpt.ui,
org.eclipse.jpt.utility,
org.eclipse.jpt.db;bundle-version="1.2.100",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.0"
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.0",
+ org.hibernate.mediator;bundle-version="3.3.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor.0
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -18,7 +18,7 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.hibernate.console.stubs.util.StringHelper;
+import org.hibernate.mediator.stubs.util.StringHelper;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -41,16 +41,15 @@
import org.eclipse.swt.widgets.Group;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.console.utils.DriverClassHelpers;
import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.launch.PathHelper;
-import org.hibernate.tool.hbm2x.StringUtils;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
+import org.hibernate.mediator.stubs.util.StringHelper;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
@@ -197,7 +196,7 @@
connectionProfileName.setItems(dtpConnectionProfileNames());
String connectionName = getProjectConnectionProfileName();
- if (!StringUtils.isEmpty(connectionName)) {
+ if (!StringHelper.isEmpty(connectionName)) {
connectionProfileName.selectItem(connectionName);
}
connectionProfileName.doFillIntoGrid(dbGroup, numColumns);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/META-INF/MANIFEST.MF 2010-03-29 17:44:48 UTC (rev 21125)
@@ -13,6 +13,7 @@
org.eclipse.core.runtime,
org.eclipse.gef,
org.eclipse.core.resources,
+ org.hibernate.mediator,
org.hibernate.eclipse,
org.eclipse.jdt.core,
org.eclipse.jdt.ui,
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenMappingAction.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -20,9 +20,9 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.PropertyStub;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.UiPlugin;
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/OpenSourceAction.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -20,11 +20,11 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.UiPlugin;
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ShapeHideAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ShapeHideAction.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ShapeHideAction.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -20,8 +20,8 @@
import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IWorkbenchPart;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
import org.jboss.tools.hibernate.ui.diagram.editors.command.ToggleShapeVisibleStateCommand;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ShapeShowAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ShapeShowAction.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ShapeShowAction.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -20,8 +20,8 @@
import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IWorkbenchPart;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
import org.jboss.tools.hibernate.ui.diagram.editors.command.ToggleShapeVisibleStateCommand;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeVisibleStateAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeVisibleStateAction.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/ToggleShapeVisibleStateAction.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -21,8 +21,8 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchPart;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.editors.DiagramViewer;
import org.jboss.tools.hibernate.ui.diagram.editors.command.ToggleShapeVisibleStateCommand;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/command/ToggleShapeVisibleStateCommand.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/command/ToggleShapeVisibleStateCommand.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/command/ToggleShapeVisibleStateCommand.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -14,8 +14,8 @@
import java.util.List;
import org.eclipse.gef.commands.Command;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.editors.model.OrmShape;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ComponentShape.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ComponentShape.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ComponentShape.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -12,8 +12,8 @@
import java.util.Properties;
-import org.hibernate.console.stubs.CollectionStub;
-import org.hibernate.console.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.CollectionStub;
+import org.hibernate.mediator.stubs.PropertyStub;
/**
* @author some modifications from Vitali
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Connection.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -12,13 +12,13 @@
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ManyToOneStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.OneToOneStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ManyToOneStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.OneToOneStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.TableStub;
/**
* Directed connection between 2 shapes, from source to target.
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -16,23 +16,23 @@
import java.util.Iterator;
import java.util.Set;
-import org.hibernate.console.stubs.CollectionStub;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.DependantValueStub;
-import org.hibernate.console.stubs.EntityTypeStub;
-import org.hibernate.console.stubs.ForeignKeyStub;
-import org.hibernate.console.stubs.JoinStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.SubclassStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.TypeStub;
-import org.hibernate.console.stubs.ValueStub;
+import org.hibernate.mediator.stubs.CollectionStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.DependantValueStub;
+import org.hibernate.mediator.stubs.EntityTypeStub;
+import org.hibernate.mediator.stubs.ForeignKeyStub;
+import org.hibernate.mediator.stubs.JoinStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.SubclassStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.TypeStub;
+import org.hibernate.mediator.stubs.ValueStub;
/**
* Responsible to create diagram elements for given
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -48,11 +48,11 @@
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.RootClassStub;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.UiPlugin;
import org.jboss.tools.hibernate.ui.diagram.editors.model.Connection.ConnectionType;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmShape.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmShape.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmShape.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -17,15 +17,15 @@
import org.eclipse.ui.IMemento;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.hibernate.console.stubs.CollectionStub;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.KeyValueStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.SubclassStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.CollectionStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.KeyValueStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.SubclassStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.rulers.DiagramGuide;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -17,10 +17,10 @@
import org.eclipse.ui.IMemento;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.ValueStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.ValueStub;
import org.jboss.tools.hibernate.ui.diagram.editors.model.Connection.ConnectionType;
import org.jboss.tools.hibernate.ui.view.HibernateUtils;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/SpecialOrmShape.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/SpecialOrmShape.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/SpecialOrmShape.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -13,10 +13,10 @@
import java.util.Iterator;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.execution.ExecutionContext.Command;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
-import org.hibernate.console.stubs.TypeStub;
+import org.hibernate.mediator.execution.ExecutionContext.Command;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.TypeStub;
/**
*
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/SpecialRootClass.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/SpecialRootClass.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/SpecialRootClass.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -12,11 +12,11 @@
import java.util.Iterator;
-import org.hibernate.console.stubs.CollectionStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.CollectionStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
// TODO: What is this ? And why is it extending mapping classes ?!
// vitali: it seems this is class to "wrap" properties set to RootClass
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -14,10 +14,10 @@
import java.util.Properties;
import org.eclipse.ui.IMemento;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.TableStub;
/**
* Some common model utils.
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/ConnectionEditPart.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/ConnectionEditPart.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/ConnectionEditPart.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -23,12 +23,12 @@
import org.eclipse.gef.editpolicies.SelectionEditPolicy;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
-import org.hibernate.console.stubs.SubclassStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.SubclassStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.editors.figures.RoundPolylineConnection;
import org.jboss.tools.hibernate.ui.diagram.editors.model.Connection;
import org.jboss.tools.hibernate.ui.diagram.editors.model.BaseElement;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/OrmShapeEditPart.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/OrmShapeEditPart.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/OrmShapeEditPart.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -20,10 +20,10 @@
import org.eclipse.gef.RequestConstants;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.editors.figures.TitleFigure;
import org.jboss.tools.hibernate.ui.diagram.editors.model.BaseElement;
import org.jboss.tools.hibernate.ui.diagram.editors.model.ExpandableShape;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/ShapeEditPart.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/ShapeEditPart.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/parts/ShapeEditPart.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -33,14 +33,14 @@
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.DependantValueStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.DependantValueStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.editors.figures.TitleFigure;
import org.jboss.tools.hibernate.ui.diagram.editors.figures.TopLineBorder;
import org.jboss.tools.hibernate.ui.diagram.editors.model.Connection;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -27,10 +27,10 @@
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.actions.ActionFactory;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.AutoLayoutAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.ExportImageAction;
import org.jboss.tools.hibernate.ui.diagram.editors.actions.OpenMappingAction;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/DiagramEditorInput.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/DiagramEditorInput.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/DiagramEditorInput.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -20,7 +20,7 @@
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.part.FileEditorInput;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.RootClassStub;
import org.jboss.tools.hibernate.ui.diagram.editors.model.OrmDiagram;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/HibernateUtils.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/HibernateUtils.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/HibernateUtils.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -12,9 +12,9 @@
import java.util.Iterator;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ForeignKeyStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ForeignKeyStub;
+import org.hibernate.mediator.stubs.TableStub;
/**
* @author some modifications from Vitali
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OpenDiagramActionDelegate.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OpenDiagramActionDelegate.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OpenDiagramActionDelegate.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -27,10 +27,10 @@
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.ObjectPluginAction;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.RootClassStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.RootClassStub;
import org.jboss.tools.hibernate.ui.diagram.DiagramViewerMessages;
import org.jboss.tools.hibernate.ui.diagram.UiPlugin;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmImageMap.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmImageMap.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmImageMap.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -11,26 +11,26 @@
package org.jboss.tools.hibernate.ui.view;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.hibernate.console.stubs.AnyStub;
-import org.hibernate.console.stubs.ArrayStub;
-import org.hibernate.console.stubs.BagStub;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.DependantValueStub;
-import org.hibernate.console.stubs.IdentifierBagStub;
-import org.hibernate.console.stubs.ListStub;
-import org.hibernate.console.stubs.ManyToOneStub;
-import org.hibernate.console.stubs.MapStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.OneToOneStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PrimitiveArrayStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.SetStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.TypeStub;
-import org.hibernate.console.stubs.ValueStub;
+import org.hibernate.mediator.stubs.AnyStub;
+import org.hibernate.mediator.stubs.ArrayStub;
+import org.hibernate.mediator.stubs.BagStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.DependantValueStub;
+import org.hibernate.mediator.stubs.IdentifierBagStub;
+import org.hibernate.mediator.stubs.ListStub;
+import org.hibernate.mediator.stubs.ManyToOneStub;
+import org.hibernate.mediator.stubs.MapStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.OneToOneStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PrimitiveArrayStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.SetStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.TypeStub;
+import org.hibernate.mediator.stubs.ValueStub;
import org.jboss.tools.hibernate.ui.diagram.UiPlugin;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelMap.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelMap.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelMap.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -10,17 +10,17 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.view;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.DependantValueStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.TypeStub;
-import org.hibernate.console.stubs.ValueStub;
import org.hibernate.eclipse.console.workbench.TypeNameValueVisitor;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.DependantValueStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.TypeStub;
+import org.hibernate.mediator.stubs.ValueStub;
import org.jboss.tools.hibernate.ui.diagram.editors.model.Utils;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java 2010-03-29 17:43:11 UTC (rev 21124)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java 2010-03-29 17:44:48 UTC (rev 21125)
@@ -25,14 +25,14 @@
import org.eclipse.swt.widgets.Display;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.DialectStub;
-import org.hibernate.console.stubs.EnvironmentStub;
-import org.hibernate.console.stubs.MappingStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.DialectStub;
+import org.hibernate.mediator.stubs.EnvironmentStub;
+import org.hibernate.mediator.stubs.MappingStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
/**
*
14 years, 11 months
JBoss Tools SVN: r21124 - in branches/hibernatetools-multiversion/hibernatetools/plugins: org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-29 13:43:11 -0400 (Mon, 29 Mar 2010)
New Revision: 21124
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/ColumnNameHandler.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/JavaTypeHandler.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PackageHandler.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/TableNameHandler.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMModelUtil.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaColumnImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaDiscriminatorColumnImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinTableImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaSecondaryTableImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTableImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmBasicMapping.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmColumnImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmIdMappingImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinColumnImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinTableImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmTableImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/META-INF/MANIFEST.MF 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/META-INF/MANIFEST.MF 2010-03-29 17:43:11 UTC (rev 21124)
@@ -31,6 +31,7 @@
org.eclipse.wst.xml.ui,
org.eclipse.wst.sse.ui,
org.eclipse.ui.views,
+ org.hibernate.mediator,
org.hibernate.eclipse,
org.eclipse.ui.forms,
org.eclipse.ui.workbench.texteditor,
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ReverseEngineeringEditor.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -36,13 +36,8 @@
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.xml.core.internal.provisional.IXMLPreferenceNames;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
-import org.hibernate.cfg.reveng.OverrideRepository;
-import org.hibernate.cfg.reveng.TableFilter;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.SettingsStub;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.model.ITableFilter;
@@ -57,6 +52,11 @@
import org.hibernate.eclipse.mapper.editors.xpl.XMLFormEditorPart;
import org.hibernate.eclipse.mapper.model.DOMReverseEngineeringDefinition;
import org.hibernate.eclipse.nature.HibernateNature;
+import org.hibernate.mediator.stubs.DefaultReverseEngineeringStrategyStub;
+import org.hibernate.mediator.stubs.OverrideRepositoryStub;
+import org.hibernate.mediator.stubs.SettingsStub;
+import org.hibernate.mediator.stubs.TableFilterStub;
+import org.hibernate.mediator.stubs.util.StringHelper;
import org.w3c.dom.Document;
public class ReverseEngineeringEditor extends XMLFormEditorPart {
@@ -198,11 +198,11 @@
ITableFilter[] tableFilters = getReverseEngineeringDefinition().getTableFilters();
SettingsStub settings = configuration.getSettings2();
- OverrideRepository repository = new OverrideRepository();///*settings.getDefaultCatalogName(),settings.getDefaultSchemaName()*/);
+ OverrideRepositoryStub repository = new OverrideRepositoryStub();///*settings.getDefaultCatalogName(),settings.getDefaultSchemaName()*/);
boolean hasIncludes = false;
for (int i = 0; i < tableFilters.length; i++) {
ITableFilter filter = tableFilters[i];
- TableFilter tf = new TableFilter();
+ TableFilterStub tf = new TableFilterStub();
tf.setExclude(filter.getExclude());
if(filter.getExclude()!=null && !filter.getExclude().booleanValue()) {
hasIncludes = true;
@@ -212,7 +212,7 @@
tf.setMatchSchema(filter.getMatchSchema());
repository.addTableFilter(tf);
}
- TableFilter tf = new TableFilter();
+ TableFilterStub tf = new TableFilterStub();
tf.setExclude(Boolean.FALSE);
tf.setMatchCatalog(".*"); //$NON-NLS-1$
tf.setMatchSchema(".*"); //$NON-NLS-1$
@@ -231,7 +231,7 @@
//}
//}
- LazyDatabaseSchema lazyDatabaseSchema = new LazyDatabaseSchema(configuration, repository.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()));
+ LazyDatabaseSchema lazyDatabaseSchema = new LazyDatabaseSchema(configuration, repository.getReverseEngineeringStrategy(DefaultReverseEngineeringStrategyStub.newInstance()));
return lazyDatabaseSchema;
} catch(RuntimeException he) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -30,12 +30,12 @@
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.MapperPlugin;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
+import org.hibernate.mediator.stubs.util.StringHelper;
public class ConsoleConfigNamePart extends RevEngSectionPart {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TablePropertiesBlock.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -56,10 +56,6 @@
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.PrimaryKeyStub;
-import org.hibernate.console.stubs.TableIdentifierStub;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.console.model.IRevEngColumn;
import org.hibernate.eclipse.console.model.IRevEngTable;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
@@ -73,6 +69,10 @@
import org.hibernate.eclipse.mapper.model.RevEngParamAdapter;
import org.hibernate.eclipse.mapper.model.RevEngPrimaryKeyAdapter;
import org.hibernate.eclipse.mapper.model.RevEngTableAdapter;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.PrimaryKeyStub;
+import org.hibernate.mediator.stubs.TableIdentifierStub;
+import org.hibernate.mediator.stubs.TableStub;
public class TablePropertiesBlock extends MasterDetailsBlock {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/TypeMappingView.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -34,11 +34,8 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
-import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.PrimaryKeyStub;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.model.ITypeMapping;
import org.hibernate.eclipse.console.wizards.TreeToTableComposite;
@@ -49,6 +46,9 @@
import org.hibernate.eclipse.console.workbench.LazyDatabaseSchema;
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
import org.hibernate.eclipse.mapper.MapperMessages;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.JDBCToHibernateTypeHelperStub;
+import org.hibernate.mediator.stubs.PrimaryKeyStub;
public abstract class TypeMappingView extends TreeToTableComposite {
@@ -148,18 +148,18 @@
if(sqlTypeCode!=null) {
ITypeMapping typeMapping = revEngDef.createTypeMapping();
- typeMapping.setJDBCType(JDBCToHibernateTypeHelper.getJDBCTypeName(sqlTypeCode.intValue()));
+ typeMapping.setJDBCType(JDBCToHibernateTypeHelperStub.getJDBCTypeName(sqlTypeCode.intValue()));
int length = col.getLength();
int precision = col.getPrecision();
int scale = col.getScale();
boolean nullability = col.isNullable();
- typeMapping.setHibernateType(JDBCToHibernateTypeHelper.getPreferredHibernateType(sqlTypeCode.intValue(), length, precision, scale, nullability, false));
- if(JDBCToHibernateTypeHelper.typeHasLength(sqlTypeCode.intValue())) {
+ typeMapping.setHibernateType(JDBCToHibernateTypeHelperStub.getPreferredHibernateType(sqlTypeCode.intValue(), length, precision, scale, nullability, false));
+ if(JDBCToHibernateTypeHelperStub.typeHasLength(sqlTypeCode.intValue())) {
if(length!=0 && ColumnStub.DEFAULT_LENGTH!=length) {
typeMapping.setLength(new Integer(length));
}
}
- if(JDBCToHibernateTypeHelper.typeHasScaleAndPrecision(sqlTypeCode.intValue())) {
+ if(JDBCToHibernateTypeHelperStub.typeHasScaleAndPrecision(sqlTypeCode.intValue())) {
if(precision!=0 && ColumnStub.DEFAULT_PRECISION!=precision) {
typeMapping.setPrecision(new Integer(precision));
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/ColumnNameHandler.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/ColumnNameHandler.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/ColumnNameHandler.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -29,10 +29,10 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.TableIdentifierStub;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.nature.HibernateNature;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.TableIdentifierStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -37,10 +37,10 @@
import org.eclipse.jdt.core.Signature;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.hibernate.console.stubs.EnvironmentStub;
-import org.hibernate.console.stubs.TableIdentifierStub;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.mapper.MapperMessages;
+import org.hibernate.mediator.stubs.EnvironmentStub;
+import org.hibernate.mediator.stubs.TableIdentifierStub;
+import org.hibernate.mediator.stubs.util.StringHelper;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/JavaTypeHandler.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/JavaTypeHandler.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/JavaTypeHandler.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -26,9 +26,9 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.hqleditor.CompletionHelper;
import org.hibernate.eclipse.hqleditor.HibernateResultCollector.Settings;
+import org.hibernate.mediator.stubs.util.StringHelper;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PackageHandler.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PackageHandler.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PackageHandler.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -23,9 +23,9 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.hqleditor.CompletionHelper;
import org.hibernate.eclipse.hqleditor.HibernateResultCollector.Settings;
+import org.hibernate.mediator.stubs.util.StringHelper;
import org.w3c.dom.Node;
public class PackageHandler extends JavaTypeHandler {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/TableNameHandler.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/TableNameHandler.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/TableNameHandler.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -29,8 +29,8 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.nature.HibernateNature;
+import org.hibernate.mediator.stubs.TableStub;
import org.w3c.dom.Attr;
import org.w3c.dom.Node;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMModelUtil.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMModelUtil.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/model/DOMModelUtil.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -27,7 +27,6 @@
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
import org.eclipse.wst.xml.core.internal.provisional.format.ElementNodeFormatter;
-import org.jboss.deployment.DeploymentException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -127,7 +126,6 @@
* @return either the named child or the supplied default
*/
public static Element getOptionalChild(Element element, String tagName)
- throws DeploymentException
{
List goodChildren = getChildrenByTagName(element, tagName);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2010-03-29 17:43:11 UTC (rev 21124)
@@ -6,6 +6,7 @@
Require-Bundle:
org.eclipse.core.runtime,
org.eclipse.wst.validation,
+ org.hibernate.mediator,
org.hibernate.eclipse.console,
org.hibernate.eclipse,
org.eclipse.jdt.launching,
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaProject.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -18,9 +18,9 @@
import org.eclipse.jpt.core.internal.AbstractJpaProject;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.NamingStrategyStub;
import org.hibernate.eclipse.console.properties.HibernatePropertiesConstants;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.osgi.service.prefs.Preferences;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -31,10 +31,10 @@
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent.Type;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
/**
* @author Dmitry Geraskov
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -21,7 +21,7 @@
import org.eclipse.jpt.db.Table;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit.LocalMessage;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaColumnImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaColumnImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaColumnImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -18,7 +18,7 @@
import org.eclipse.jpt.db.Table;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaDiscriminatorColumnImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaDiscriminatorColumnImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaDiscriminatorColumnImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -24,7 +24,7 @@
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinColumnImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -27,7 +27,7 @@
import org.eclipse.jpt.db.Table;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinTableImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinTableImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaJoinTableImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -21,7 +21,7 @@
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaSecondaryTableImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaSecondaryTableImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaSecondaryTableImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -21,7 +21,7 @@
import org.eclipse.jpt.db.Table;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTableImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTableImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaTableImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -21,7 +21,7 @@
import org.eclipse.jpt.db.Schema;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmBasicMapping.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmBasicMapping.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmBasicMapping.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -16,7 +16,7 @@
import org.eclipse.jpt.core.resource.orm.XmlBasic;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmColumnImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmColumnImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmColumnImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -18,7 +18,7 @@
import org.eclipse.jpt.db.Table;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -27,7 +27,7 @@
import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.GenericGenerator;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmIdMappingImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmIdMappingImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmIdMappingImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -20,7 +20,7 @@
import org.eclipse.jpt.core.resource.orm.XmlId;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinColumnImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinColumnImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinColumnImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -24,7 +24,7 @@
import org.eclipse.jpt.db.Table;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinTableImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinTableImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmJoinTableImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -23,7 +23,7 @@
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.Messages;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmTableImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmTableImpl.java 2010-03-29 17:42:03 UTC (rev 21123)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmTableImpl.java 2010-03-29 17:43:11 UTC (rev 21124)
@@ -24,7 +24,7 @@
import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.hibernate.console.stubs.NamingStrategyStub;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateTable;
14 years, 11 months
JBoss Tools SVN: r21123 - in branches/hibernatetools-multiversion/hibernatetools: plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-29 13:42:03 -0400 (Mon, 29 Mar 2010)
New Revision: 21123
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/ELTransformerTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/META-INF/MANIFEST.MF 2010-03-29 17:42:03 UTC (rev 21123)
@@ -16,6 +16,7 @@
org.eclipse.ui.ide,
org.eclipse.ui.workbench.texteditor,
org.eclipse.gef,
+ org.hibernate.mediator,
org.hibernate.eclipse,
org.hibernate.eclipse.console,
org.eclipse.ui.editors,
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java 2010-03-29 17:42:03 UTC (rev 21123)
@@ -35,11 +35,11 @@
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.IHQLCodeAssistStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.hqleditor.EclipseHQLCompletionRequestor;
import org.hibernate.eclipse.hqleditor.HQLCompletionProcessor;
import org.hibernate.eclipse.nature.HibernateNature;
+import org.hibernate.mediator.stubs.IHQLCodeAssistStub;
public class HQLJavaCompletionProposalComputer implements IJavaCompletionProposalComputer {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2010-03-29 17:42:03 UTC (rev 21123)
@@ -39,40 +39,41 @@
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
import org.eclipse.jdt.core.dom.WildcardType;
-import org.hibernate.console.stubs.ConfigurationStubFactory;
-import org.hibernate.console.stubs.ConfigurationStub;
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;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.RefType;
import org.hibernate.eclipse.jdt.ui.internal.jpa.common.Utils;
-import org.hibernate.console.stubs.ArrayStub;
-import org.hibernate.console.stubs.BagStub;
-import org.hibernate.console.stubs.CollectionStub;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.FetchModeStub;
-import org.hibernate.console.stubs.IndexedCollectionStub;
-import org.hibernate.console.stubs.JoinedSubclassStub;
-import org.hibernate.console.stubs.KeyValueStub;
-import org.hibernate.console.stubs.ListStub;
-import org.hibernate.console.stubs.ManyToOneStub;
-import org.hibernate.console.stubs.MapStub;
-import org.hibernate.console.stubs.MappingsStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.OneToOneStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PersistentClassStubFactory;
-import org.hibernate.console.stubs.PrimitiveArrayStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
-import org.hibernate.console.stubs.SetStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.SubclassStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.ToOneStub;
-import org.hibernate.console.stubs.ValueStub;
-import org.hibernate.console.stubs.util.StringHelper;
+import org.hibernate.mediator.stubs.ArrayStub;
+import org.hibernate.mediator.stubs.BagStub;
+import org.hibernate.mediator.stubs.CollectionStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.ConfigurationStubFactory;
+import org.hibernate.mediator.stubs.EnumTypeStub;
+import org.hibernate.mediator.stubs.FetchModeStub;
+import org.hibernate.mediator.stubs.IndexedCollectionStub;
+import org.hibernate.mediator.stubs.JoinedSubclassStub;
+import org.hibernate.mediator.stubs.KeyValueStub;
+import org.hibernate.mediator.stubs.ListStub;
+import org.hibernate.mediator.stubs.ManyToOneStub;
+import org.hibernate.mediator.stubs.MapStub;
+import org.hibernate.mediator.stubs.MappingsStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.OneToOneStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PersistentClassStubFactory;
+import org.hibernate.mediator.stubs.PrimitiveArrayStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.SetStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.SubclassStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.ToOneStub;
+import org.hibernate.mediator.stubs.ValueStub;
+import org.hibernate.mediator.stubs.util.StringHelper;
/**
* @author Dmitry Geraskov
@@ -576,10 +577,10 @@
}
prop.setCascade("none");//$NON-NLS-1$
} else if (tb.isEnum()){
- value = buildSimpleValue(org.hibernate.type.EnumType.class.getName());
+ value = buildSimpleValue(EnumTypeStub.getClassName());
Properties typeParameters = new Properties();
- typeParameters.put(org.hibernate.type.EnumType.ENUM, tb.getBinaryName());
- typeParameters.put(org.hibernate.type.EnumType.TYPE, java.sql.Types.VARCHAR);
+ typeParameters.put(EnumTypeStub.ENUM, tb.getBinaryName());
+ typeParameters.put(EnumTypeStub.TYPE, java.sql.Types.VARCHAR);
((SimpleValueStub)value).setTypeParameters(typeParameters);
buildProperty(value);
} else if (ref != null){
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2010-03-29 17:42:03 UTC (rev 21123)
@@ -62,7 +62,6 @@
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.eclipse.ui.ide.IDE;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -71,9 +70,10 @@
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.Utils;
-import org.hibernate.tool.hbm2x.HibernateMappingExporter;
-import org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings;
-import org.hibernate.tool.hbm2x.pojo.POJOClass;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.HibernateMappingExporterStub;
+import org.hibernate.mediator.stubs.HibernateMappingGlobalSettingsStub;
+import org.hibernate.mediator.stubs.POJOClassStub;
/**
* @author Dmitry Geraskov
@@ -246,7 +246,7 @@
Map<IJavaProject, IPath> places2Gen = new HashMap<IJavaProject, IPath>();
for (Entry<IJavaProject, ConfigurationStub> entry : configs.entrySet()) {
ConfigurationStub config = entry.getValue();
- HibernateMappingGlobalSettings hmgs = new HibernateMappingGlobalSettings();
+ HibernateMappingGlobalSettingsStub hmgs = HibernateMappingGlobalSettingsStub.newInstance();
hmgs.setDefaultAccess("field"); //$NON-NLS-1$
//final IPath projPath = entry.getKey().getProject().getLocation();
@@ -265,7 +265,7 @@
* redefine base exportPOJO to setup right output dir in case
* of several source folders
*/
- public File getNewOutputDir(POJOClass element, File outputdir4FileNew) {
+ public File getNewOutputDir(POJOClassStub element, File outputdir4FileNew) {
String fullyQualifiedName = element.getQualifiedDeclarationName();
ICompilationUnit icu = Utils.findCompilationUnit(proj, fullyQualifiedName);
@@ -298,7 +298,7 @@
return outputdir4FileNew;
}
};
- HibernateMappingExporter hce = config.createHibernateMappingExporter(folder2Gen, nod);
+ HibernateMappingExporterStub hce = config.createHibernateMappingExporter(folder2Gen, nod);
hce.setGlobalSettings(hmgs);
//hce.setForEach("entity");
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/META-INF/MANIFEST.MF 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/META-INF/MANIFEST.MF 2010-03-29 17:42:03 UTC (rev 21123)
@@ -8,6 +8,7 @@
org.hibernate.eclipse.console.test,
org.hibernate.eclipse.console,
org.hibernate.eclipse,
+ org.hibernate.mediator,
org.junit,
org.eclipse.core.resources,
org.eclipse.jdt.core,
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/ELTransformerTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/ELTransformerTest.java 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/ELTransformerTest.java 2010-03-29 17:42:03 UTC (rev 21123)
@@ -1,6 +1,6 @@
package org.hibernate.eclipse.jdt.ui.test;
-import org.hibernate.console.util.ELTransformer;
+import org.hibernate.mediator.util.ELTransformer;
import junit.framework.TestCase;
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HQLQueryValidatorTest.java 2010-03-29 17:42:03 UTC (rev 21123)
@@ -23,7 +23,6 @@
import org.eclipse.ui.PlatformUI;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.EclipseConsoleConfiguration;
import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.test.HibernateConsoleTest;
@@ -32,6 +31,7 @@
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.jdt.ui.internal.HQLDetector;
import org.hibernate.eclipse.jdt.ui.internal.HQLProblem;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
public class HQLQueryValidatorTest extends HibernateConsoleTest {
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/HibernateErrorsTest2.java 2010-03-29 17:42:03 UTC (rev 21123)
@@ -23,7 +23,6 @@
import org.eclipse.ui.PlatformUI;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.EclipseConsoleConfiguration;
import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.test.HibernateConsoleTest;
@@ -31,6 +30,7 @@
import org.hibernate.eclipse.console.test.project.xpl.JavaProjectHelper;
import org.hibernate.eclipse.console.test.utils.FilesTransfer;
import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
public class HibernateErrorsTest2 extends HibernateConsoleTest {
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java 2010-03-29 17:26:42 UTC (rev 21122)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/src/org/hibernate/eclipse/jdt/ui/test/hbmexporter/HbmExporterTest.java 2010-03-29 17:42:03 UTC (rev 21123)
@@ -20,18 +20,6 @@
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.osgi.util.NLS;
-import org.hibernate.console.stubs.ArrayStub;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.IntegerTypeStub;
-import org.hibernate.console.stubs.ListStub;
-import org.hibernate.console.stubs.ManyToOneStub;
-import org.hibernate.console.stubs.MapStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PrimitiveArrayStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.SetStub;
-import org.hibernate.console.stubs.ValueStub;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.test.project.TestProject;
import org.hibernate.eclipse.console.test.utils.FilesTransfer;
@@ -41,6 +29,18 @@
import org.hibernate.eclipse.jdt.ui.internal.jpa.process.AllEntitiesProcessor;
import org.hibernate.eclipse.jdt.ui.test.HibernateJDTuiTestPlugin;
import org.hibernate.eclipse.jdt.ui.wizards.ConfigurationActor;
+import org.hibernate.mediator.stubs.ArrayStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.IntegerTypeStub;
+import org.hibernate.mediator.stubs.ListStub;
+import org.hibernate.mediator.stubs.ManyToOneStub;
+import org.hibernate.mediator.stubs.MapStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PrimitiveArrayStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.SetStub;
+import org.hibernate.mediator.stubs.ValueStub;
public class HbmExporterTest extends TestCase {
14 years, 11 months
JBoss Tools SVN: r21122 - in branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test: src/org/hibernate/eclipse/console/test and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-29 13:26:42 -0400 (Mon, 29 Mar 2010)
New Revision: 21122
Modified:
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/Utils.java
branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2010-03-29 17:26:42 UTC (rev 21122)
@@ -45,6 +45,7 @@
org.eclipse.jdt.ui,
org.eclipse.core.runtime,
org.eclipse.ui.ide,
+ org.hibernate.mediator,
org.hibernate.eclipse,
org.hibernate.eclipse.mapper,
org.eclipse.jface.text,
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -12,8 +12,8 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.QueryPage;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
import org.osgi.framework.Bundle;
import org.w3c.dom.Element;
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -11,7 +11,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.KnownConfigurationsAdapter;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
import org.w3c.dom.Element;
public class KnownConfigurationsTest extends TestCase {
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -6,10 +6,10 @@
import junit.framework.TestCase;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.ConsoleQueryParameter;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.QueryInputModel;
import org.hibernate.eclipse.console.test.ConsoleConfigurationTest.TestConsoleConfigurationPreferences;
+import org.hibernate.mediator.ConsoleQueryParameter;
+import org.hibernate.mediator.QueryInputModel;
public class QueryParametersTest extends TestCase {
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -27,15 +27,14 @@
import org.eclipse.osgi.util.NLS;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.test.project.ConfigurableTestProject;
import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
-import org.hibernate.tool.hbm2x.ArtifactCollector;
-import org.hibernate.tool.hbm2x.ExporterException;
-import org.hibernate.tool.hbm2x.HibernateMappingExporter;
-import org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings;
-import org.hibernate.tool.hbm2x.pojo.POJOClass;
+import org.hibernate.mediator.stubs.ArtifactCollectorStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.HibernateMappingExporterStub;
+import org.hibernate.mediator.stubs.HibernateMappingGlobalSettingsStub;
+import org.hibernate.mediator.stubs.POJOClassStub;
/**
* @author Dmitry Geraskov
@@ -91,19 +90,19 @@
}
}
- HibernateMappingGlobalSettings hmgs = new HibernateMappingGlobalSettings();
+ HibernateMappingGlobalSettingsStub hmgs = HibernateMappingGlobalSettingsStub.newInstance();
ConfigurationStub.IExporterNewOutputDir nod = new ConfigurationStub.IExporterNewOutputDir() {
- public File getNewOutputDir(POJOClass element, File outputdir4FileNew) {
+ public File getNewOutputDir(POJOClassStub element, File outputdir4FileNew) {
return outputdir4FileNew;
}
};
- HibernateMappingExporter hce = config.createHibernateMappingExporter(getSrcFolder(), nod);
+ HibernateMappingExporterStub hce = config.createHibernateMappingExporter(getSrcFolder(), nod);
hce.setGlobalSettings(hmgs);
try {
hce.start();
- ArtifactCollector collector = hce.getArtifactCollector();
+ ArtifactCollectorStub collector = hce.getArtifactCollector();
collector.formatFiles();
try {//build generated configuration
@@ -122,8 +121,13 @@
new Object[] { ConsoleConfigUtils.CFG_FILE_NAME, testPackage.getPath(), e.getMessage() } );
fail(out);
}
- } catch (ExporterException e){
- throw (Exception)e.getCause();
+ } catch (RuntimeException e) {
+ // TODO: RuntimeException ? - find correct solution
+ if (e.getClass().getName().contains("ExporterException")) { //$NON-NLS-1$
+ throw (Exception)e.getCause();
+ } else {
+ throw e;
+ }
}
} catch (Exception e){
String newMessage = "\nPackage " + testPackage.getElementName() + ":"; //$NON-NLS-1$ //$NON-NLS-2$
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -22,12 +22,12 @@
import org.eclipse.ui.PlatformUI;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.PersistentClassStub;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.test.utils.Utils;
import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
import org.jboss.tools.hibernate.ui.view.OpenDiagramActionDelegate;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -25,9 +25,6 @@
import org.eclipse.ui.PlatformUI;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.actions.OpenMappingAction;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.test.utils.Utils;
@@ -35,6 +32,9 @@
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.PersistentClassWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.PropertyWorkbenchAdapter;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
/**
* @author Dmitry Geraskov
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -25,10 +25,6 @@
import org.eclipse.ui.PlatformUI;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.actions.OpenSourceAction;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.test.utils.Utils;
@@ -36,6 +32,10 @@
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.PersistentClassWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.PropertyWorkbenchAdapter;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
/**
* @author Dmitry Geraskov
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/Utils.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/Utils.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/Utils.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -19,9 +19,9 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.internal.ErrorEditorPart;
import org.eclipse.ui.texteditor.ITextEditor;
-import org.hibernate.console.stubs.PersistentClassStub;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.utils.OpenMappingUtils;
+import org.hibernate.mediator.stubs.PersistentClassStub;
/**
* @author Dmitry Geraskov
Modified: branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2010-03-29 17:23:44 UTC (rev 21121)
+++ branches/hibernatetools-multiversion/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2010-03-29 17:26:42 UTC (rev 21122)
@@ -35,12 +35,12 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.apt.core.internal.JarClassLoader;
-import org.hibernate.console.ConsoleConfigClassLoader;
-import org.hibernate.console.execution.DefaultExecutionContext;
-import org.hibernate.console.execution.ExecutionContext;
-import org.hibernate.console.stubs.util.ReflectHelper;
import org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin;
import org.hibernate.eclipse.console.test.utils.GarbageCollectionUtil;
+import org.hibernate.mediator.ConsoleConfigClassLoader;
+import org.hibernate.mediator.execution.DefaultExecutionContext;
+import org.hibernate.mediator.execution.ExecutionContext;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
import junit.framework.TestCase;
14 years, 11 months
JBoss Tools SVN: r21121 - in branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console: META-INF and 15 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-29 13:23:44 -0400 (Mon, 29 Mar 2010)
New Revision: 21121
Added:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/.settings/org.eclipse.pde.core.prefs
Removed:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtilsEjb3.java
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfiguration.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfigurationPreferences.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/JTidyFormatAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/TableFilterImpl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtils.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/HibernatePropertySourceProvider.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizard.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ColumnWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/HibernateWorkbenchHelper.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/IconNameValueVisitor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchema.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PersistentClassWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PrimaryKeyWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ProgressListenerMonitor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PropertyWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainer.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableWorkbenchAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/ColumnEditPart.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/EntityGraphView.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalGraphView.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/ColumnViewAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/ConfigurationViewAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PersistentClassViewAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyAssociationViewAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyViewAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/TableViewAdapter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PersistentClassEditPart.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/EclipseHQLCompletionRequestor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLFormattingStrategy.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLLexerRule.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConnectionProfileCtrl.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationOptionsTab.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTab.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/nature/HibernateNature.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/.settings/org.eclipse.pde.core.prefs
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/.settings/org.eclipse.pde.core.prefs 2010-03-29 17:23:44 UTC (rev 21121)
@@ -0,0 +1,3 @@
+#Mon Mar 29 16:19:44 EEST 2010
+eclipse.preferences.version=1
+resolve.requirebundle=false
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/META-INF/MANIFEST.MF 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/META-INF/MANIFEST.MF 2010-03-29 17:23:44 UTC (rev 21121)
@@ -42,6 +42,7 @@
org.hibernate.eclipse.nature,
org.hibernate.eclipse.util.xpl
Require-Bundle: org.hibernate.eclipse,
+ org.hibernate.mediator,
org.eclipse.jdt.ui,
org.eclipse.jdt.core,
org.eclipse.core.runtime,
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -61,10 +61,10 @@
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.QueryInputModel;
import org.hibernate.eclipse.console.actions.ClearAction;
import org.hibernate.eclipse.console.actions.ExecuteQueryAction;
import org.hibernate.eclipse.console.actions.StickResTabAction;
+import org.hibernate.mediator.QueryInputModel;
public abstract class AbstractQueryEditor extends TextEditor implements
QueryEditor, IShowEditorInput {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfiguration.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfiguration.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfiguration.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -22,7 +22,7 @@
package org.hibernate.eclipse.console;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
/**
* @author max
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfigurationPreferences.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfigurationPreferences.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfigurationPreferences.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -39,9 +39,9 @@
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.osgi.util.NLS;
import org.hibernate.console.preferences.AbstractConsoleConfigurationPreferences;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.utils.ClassLoaderHelper;
import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -22,11 +22,11 @@
import org.eclipse.jpt.core.JpaDataSource;
import org.eclipse.jpt.core.JpaProject;
import org.eclipse.osgi.util.NLS;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.utils.ClassLoaderHelper;
import org.hibernate.eclipse.console.utils.DriverClassHelpers;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
import org.w3c.dom.Element;
public class EclipseLaunchConsoleConfigurationPreferences implements ConsoleConfigurationPreferences {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -57,8 +57,6 @@
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.KnownConfigurationsAdapter;
import org.hibernate.console.KnownConfigurationsListener;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.actions.AddConfigurationAction;
import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.console.workbench.ConfigurationAdapterFactory;
@@ -69,6 +67,8 @@
import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.logging.PluginLogger;
import org.hibernate.eclipse.logging.xpl.EclipseLogger;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
import org.osgi.framework.BundleContext;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -22,7 +22,7 @@
package org.hibernate.eclipse.console;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.QueryInputModel;
+import org.hibernate.mediator.QueryInputModel;
public interface QueryEditor {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -25,9 +25,9 @@
import org.eclipse.jface.viewers.StructuredViewer;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
/**
* @author max
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -30,11 +30,11 @@
import org.hibernate.console.node.BaseNode;
import org.hibernate.console.node.PersistentCollectionNode;
import org.hibernate.console.node.TypeNode;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
public class CriteriaEditorAction extends OpenQueryEditorAction {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -25,11 +25,11 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.node.BaseNode;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
public class HQLScratchpadAction extends OpenQueryEditorAction {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/JTidyFormatAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/JTidyFormatAction.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/JTidyFormatAction.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -40,7 +40,7 @@
import org.eclipse.ui.internal.PluginAction;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.tool.hbm2x.XMLPrettyPrinter;
+import org.hibernate.mediator.stubs.XMLPrettyPrinterStub;
public class JTidyFormatAction implements IObjectActionDelegate {
@@ -82,7 +82,7 @@
try {
contents = file.getContents();
bos = new ByteArrayOutputStream();
- XMLPrettyPrinter.prettyPrint(contents, bos);
+ XMLPrettyPrinterStub.prettyPrint(contents, bos);
stream = new ByteArrayInputStream(bos.toByteArray() );
file.setContents(stream, true, true, null);
} finally {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -30,14 +30,14 @@
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.OpenMappingUtils;
import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
/**
* Open Mapping File action
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -27,12 +27,12 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
/**
* @author Dmitry Geraskov
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -48,11 +48,11 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
-import org.hibernate.console.stubs.util.ReflectHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.tool.hbm2x.Exporter;
+import org.hibernate.mediator.stubs.ExporterStub;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
/**
* Represents what is specified in plugin.xml about possible exporters.
@@ -116,11 +116,11 @@
}
- public Exporter createExporterInstance() {
- Exporter exporter = null;
+ public ExporterStub createExporterInstance() {
+ ExporterStub exporter = null;
try {
- exporter = (Exporter) ReflectHelper.classForName( classname ).newInstance();
+ exporter = (ExporterStub) ReflectHelper.classForName( classname ).newInstance();
}
catch (InstantiationException e) {
throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class + classname);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -15,15 +15,15 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.osgi.util.NLS;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.hibernate.eclipse.launch.PathHelper;
-import org.hibernate.tool.hbm2x.ArtifactCollector;
-import org.hibernate.tool.hbm2x.Exporter;
-import org.hibernate.tool.hbm2x.GenericExporter;
+import org.hibernate.mediator.stubs.ArtifactCollectorStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.ExporterStub;
+import org.hibernate.mediator.stubs.GenericExporterStub;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.stubs.util.StringHelper;
/**
* ExporterFactory is used in UI to hold additional configuration for Exporter definitions
@@ -166,10 +166,10 @@
* @param collector
* @throws CoreException in case of resolve variables issues.
*/
- public Exporter createConfiguredExporter(ConfigurationStub cfg, String defaultOutputDirectory,
- String customTemplatePath, Properties globalProperties, Set<String> outputDirectories, ArtifactCollector collector) throws CoreException {
+ public ExporterStub createConfiguredExporter(ConfigurationStub cfg, String defaultOutputDirectory,
+ String customTemplatePath, Properties globalProperties, Set<String> outputDirectories, ArtifactCollectorStub collector) throws CoreException {
- Exporter exporter = getExporterDefinition().createExporterInstance();
+ ExporterStub exporter = getExporterDefinition().createExporterInstance();
Properties props = new Properties();
@@ -245,7 +245,7 @@
// special handling for GenericExporter (TODO: be delegated via plugin.xml)
if(getExporterDefinition().getId().equals("org.hibernate.tools.hbmtemplate")) { //$NON-NLS-1$
- GenericExporter ge = (GenericExporter) exporter;
+ GenericExporterStub ge = (GenericExporterStub) exporter;
ge.setFilePattern(props.getProperty("file_pattern", null)); //$NON-NLS-1$
props.remove("file_pattern"); //$NON-NLS-1$
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/TableFilterImpl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/TableFilterImpl.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/TableFilterImpl.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -21,12 +21,12 @@
*/
package org.hibernate.eclipse.console.model.impl;
-import org.hibernate.cfg.reveng.TableFilter;
import org.hibernate.eclipse.console.model.ITableFilter;
+import org.hibernate.mediator.stubs.TableFilterStub;
public class TableFilterImpl implements ITableFilter {
- TableFilter tf = new TableFilter();
+ TableFilterStub tf = new TableFilterStub();
private final ReverseEngineeringDefinitionImpl revModel;
protected TableFilterImpl(
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -41,8 +41,8 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
/**
* @author max
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtils.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtils.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtils.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -46,27 +46,27 @@
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.execution.ExecutionContext;
-import org.hibernate.console.stubs.Cfg2HbmToolStub;
-import org.hibernate.console.stubs.CollectionStub;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.ManyToOneStub;
-import org.hibernate.console.stubs.MapStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.OneToOneStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.RootClassStub;
-import org.hibernate.console.stubs.SubclassStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.ToOneStub;
-import org.hibernate.console.stubs.ValueStub;
-import org.hibernate.console.stubs.util.StringHelper;
-import org.hibernate.console.stubs.util.XMLHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.tool.hbm2x.Cfg2HbmTool;
+import org.hibernate.mediator.execution.ExecutionContext;
+import org.hibernate.mediator.stubs.Cfg2HbmToolStub;
+import org.hibernate.mediator.stubs.CollectionStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.ManyToOneStub;
+import org.hibernate.mediator.stubs.MapStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.OneToOneStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.RootClassStub;
+import org.hibernate.mediator.stubs.SubclassStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.ToOneStub;
+import org.hibernate.mediator.stubs.ValueStub;
+import org.hibernate.mediator.stubs.util.OpenMappingUtilsEjb3;
+import org.hibernate.mediator.stubs.util.StringHelper;
+import org.hibernate.mediator.stubs.util.XMLHelper;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
@@ -538,7 +538,9 @@
final ConsoleConfiguration cc2 = consoleConfig;
List<String> documentPaths = (List<String>)consoleConfig.execute(new ExecutionContext.Command() {
public Object execute() {
- return OpenMappingUtilsEjb3.enumDocuments(cc2);
+ return OpenMappingUtilsEjb3.enumDocuments(
+ cc2.getPreferences().getPersistenceUnitName(),
+ cc2.getEntityResolver());
}
});
if (documentPaths == null) {
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtilsEjb3.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtilsEjb3.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/OpenMappingUtilsEjb3.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -1,284 +0,0 @@
-package org.hibernate.eclipse.console.utils;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import javax.persistence.Embeddable;
-import javax.persistence.Entity;
-import javax.persistence.MappedSuperclass;
-import javax.persistence.spi.PersistenceUnitTransactionType;
-
-import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.util.CollectionHelper;
-import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.ejb.Ejb3Configuration;
-import org.hibernate.ejb.HibernatePersistence;
-import org.hibernate.ejb.packaging.ClassFilter;
-import org.hibernate.ejb.packaging.Entry;
-import org.hibernate.ejb.packaging.FileFilter;
-import org.hibernate.ejb.packaging.Filter;
-import org.hibernate.ejb.packaging.JarVisitor;
-import org.hibernate.ejb.packaging.JarVisitorFactory;
-import org.hibernate.ejb.packaging.NamedInputStream;
-import org.hibernate.ejb.packaging.PackageFilter;
-import org.hibernate.ejb.packaging.PersistenceMetadata;
-import org.hibernate.ejb.packaging.PersistenceXmlLoader;
-
-/**
- * Most functions in this utility class are copy of
- * org.hibernate.ejb.Ejb3Configuration private functions.
- * These functions are responsible for bypass all ejb3 configuration files.
- *
- * @author Vitali Yemialyanchyk
- */
-public class OpenMappingUtilsEjb3 {
-
- public static final String META_INF_PERS_XML = "META-INF/persistence.xml"; //$NON-NLS-1$
- public static final String META_INF_ORM_XML = "META-INF/orm.xml"; //$NON-NLS-1$
-
- private OpenMappingUtilsEjb3() {}
-
- /**
- * Collect list of paths to ejb3 resource configuration files.
- * This function code based on code from Ejb3Configuration.
- * @see Ejb3Configuration configure(String persistenceUnitName, Map integration)
- *
- * @param consoleConfiguration
- * @return
- */
- public static List<String> enumDocuments(ConsoleConfiguration consoleConfiguration) {
- String persistenceUnitName = consoleConfiguration.getPreferences().getPersistenceUnitName();
- Enumeration<URL> xmls = null;
- try {
- xmls = Thread.currentThread().getContextClassLoader().getResources(META_INF_PERS_XML);
- } catch (IOException e) {
- //ignore
- }
- if (xmls == null || !xmls.hasMoreElements()) {
- return null;
- }
- final String IMPLEMENTATION_NAME = HibernatePersistence.class.getName();
- List<String> res = null;
- while (xmls.hasMoreElements() && res == null) {
- URL url = xmls.nextElement();
- List<PersistenceMetadata> metadataFiles = null;
- try {
- metadataFiles = PersistenceXmlLoader.deploy(
- url, CollectionHelper.EMPTY_MAP,
- consoleConfiguration.getEntityResolver(),
- PersistenceUnitTransactionType.RESOURCE_LOCAL);
- } catch (Exception e1) {
- //ignore
- }
- if (metadataFiles == null) {
- continue;
- }
- boolean stopErrorFlag = false;
- for (PersistenceMetadata metadata : metadataFiles) {
- boolean tmp = metadata.getProvider() == null;
- tmp = tmp || IMPLEMENTATION_NAME.equalsIgnoreCase(metadata.getProvider());
- if (!tmp) {
- continue;
- }
- //correct provider
- //lazy compute the visitor if possible to avoid useless exceptions if an unexpected state happens
- JarVisitor visitor = null;
- URL visitorJarURL = null;
- if (metadata.getName() == null) {
- visitor = getMainJarVisitor(url, metadata, CollectionHelper.EMPTY_MAP);
- visitorJarURL = JarVisitorFactory.getJarURLFromURLEntry(url, "/" + META_INF_PERS_XML); //$NON-NLS-1$
- metadata.setName(visitor.getUnqualifiedJarName());
- }
- if (persistenceUnitName == null && xmls.hasMoreElements()) {
- //throw new PersistenceException("No name provided and several persistence units found");
- stopErrorFlag = true;
- break;
- } else if (persistenceUnitName == null || metadata.getName().equals(persistenceUnitName)) {
- if (visitor == null) {
- visitor = getMainJarVisitor(url, metadata, CollectionHelper.EMPTY_MAP);
- visitorJarURL = JarVisitorFactory.getJarURLFromURLEntry(url, "/" + META_INF_PERS_XML); //$NON-NLS-1$
- }
- try {
- addMetadataFromVisitor(visitor, visitorJarURL.getPath(), metadata);
- /** /
- JarVisitor.Filter[] otherXmlFilter = getFilters(metadata, CollectionHelper.EMPTY_MAP, false);
- for (String jarFile : metadata.getJarFiles()) {
- // TODO: test this code
- //vit//visitor = JarVisitor.getVisitor(jarFile, otherXmlFilter);
- //vit//addMetadataFromVisitor(visitor, metadata);
- }
- /**/
- } catch (IOException e) {
- //ignore
- }
- res = new ArrayList<String>();
- Iterator<NamedInputStream> it = metadata.getHbmfiles().iterator();
- while (it.hasNext()) {
- NamedInputStream nis = it.next();
- res.add(nis.getName());
- try {
- nis.getStream().close();
- }
- catch (IOException ioe) {
- HibernateConsolePlugin.getDefault().logErrorMessage("could not close input stream for", ioe); //$NON-NLS-1$
- }
- }
- break;
- }
- }
- if (stopErrorFlag) {
- break;
- }
- }
- return res;
- }
-
- /**
- * This function code based on code from Ejb3Configuration.
- * @see JarVisitor Ejb3Configuration.getMainJarVisitor(URL url, PersistenceMetadata metadata, Map integration)
- *
- * @param url
- * @param metadata
- * @param integration
- * @return
- */
- @SuppressWarnings("unchecked")
- private static JarVisitor getMainJarVisitor(URL url, PersistenceMetadata metadata, Map integration) {
- URL jarURL = JarVisitorFactory.getJarURLFromURLEntry(url, "/" + META_INF_PERS_XML); //$NON-NLS-1$
- Filter[] persistenceXmlFilter = getFilters(metadata, integration, metadata.getExcludeUnlistedClasses());
- JarVisitor visitor = JarVisitorFactory.getVisitor(jarURL, persistenceXmlFilter);
- return visitor;
- }
-
- /**
- * This function code based on code from Ejb3Configuration.
- * @see JarVisitor Ejb3Configuration.addMetadataFromVisitor(JarVisitor visitor, PersistenceMetadata metadata) throws IOException
- *
- * @param visitor
- * @param metadata
- * @throws IOException
- */
- @SuppressWarnings("unchecked")
- private static void addMetadataFromVisitor(JarVisitor visitor, String addPath, PersistenceMetadata metadata) throws IOException {
- Set[] entries = visitor.getMatchingEntries();
- Filter[] filters = visitor.getFilters();
- int size = filters.length;
- List<String> classes = metadata.getClasses();
- List<String> packages = metadata.getPackages();
- List<NamedInputStream> hbmFiles = metadata.getHbmfiles();
- List<String> mappingFiles = metadata.getMappingFiles();
- for (int index = 0; index < size; index++) {
- for (Object o : entries[index]) {
- Entry entry = (Entry) o;
- if (filters[index] instanceof ClassFilter) {
- classes.add(entry.getName());
- } else if (filters[index] instanceof PackageFilter) {
- packages.add(entry.getName());
- } else if (filters[index] instanceof FileFilter) {
- hbmFiles.add(new NamedInputStream(addPath + "/" + entry.getName(), //$NON-NLS-1$
- entry.getInputStream()));
- if (mappingFiles != null) {
- mappingFiles.remove(entry.getName());
- }
- }
- }
- }
- }
-
- /**
- * This function code based on code from Ejb3Configuration.
- * @see boolean[] Ejb3Configuration.getDetectedArtifacts(Properties properties, Map overridenProperties, boolean excludeIfNotOverriden)
- *
- * @param properties
- * @param overridenProperties
- * @param excludeIfNotOverriden
- * @return
- */
- @SuppressWarnings("unchecked")
- private static boolean[] getDetectedArtifacts(Properties properties, Map overridenProperties, boolean excludeIfNotOverriden) {
- //result[0] - detect classes
- //result[1] - detect hbm
- boolean[] result = { false, false };
- String detect = overridenProperties != null ?
- (String) overridenProperties.get(HibernatePersistence.AUTODETECTION) : null;
- detect = detect == null ?
- properties.getProperty( HibernatePersistence.AUTODETECTION) : detect;
- if (detect == null && excludeIfNotOverriden) {
- //not overridden through HibernatePersistence.AUTODETECTION so we comply with the spec excludeUnlistedClasses
- return result;
- }
- else if (detect == null){
- detect = "class,hbm"; //$NON-NLS-1$
- }
- StringTokenizer st = new StringTokenizer(detect, ", ", false); //$NON-NLS-1$
- while (st.hasMoreElements()) {
- String element = (String)st.nextElement();
- if ("class".equalsIgnoreCase(element)) { //$NON-NLS-1$
- result[0] = true;
- }
- if ("hbm".equalsIgnoreCase(element)) { //$NON-NLS-1$
- result[1] = true;
- }
- }
- return result;
- }
-
- /**
- * This function code based on code from Ejb3Configuration.
- * @see JarVisitor.Filter[] Ejb3Configuration.getFilters(PersistenceMetadata metadata, Map overridenProperties, boolean excludeIfNotOverriden)
- *
- * @param metadata
- * @param overridenProperties
- * @param excludeIfNotOverriden
- * @return
- */
- @SuppressWarnings("unchecked")
- private static Filter[] getFilters(PersistenceMetadata metadata, Map overridenProperties, boolean excludeIfNotOverriden) {
- Properties properties = metadata.getProps();
- final List<String> mappingFiles = metadata.getMappingFiles();
- boolean[] detectedArtifacts = getDetectedArtifacts(properties, overridenProperties, excludeIfNotOverriden);
- return getFilters(detectedArtifacts, true, mappingFiles);
- }
-
- private static Filter[] getFilters(final boolean[] detectedArtifacts, final boolean searchORM, final List<String> mappingFiles) {
- final int mappingFilesSize = mappingFiles != null ? mappingFiles.size() : 0;
- int size = (detectedArtifacts[0] ? 2 : 0) + ((searchORM || detectedArtifacts[1] || mappingFilesSize > 0) ? 1 : 0);
- Filter[] filters = new Filter[size];
- if (detectedArtifacts[0]) {
- filters[0] = new PackageFilter(false, null) {
- public boolean accept(String javaElementName) {
- return true;
- }
- };
- filters[1] = new ClassFilter(
- false, new Class[] {
- Entity.class,
- MappedSuperclass.class,
- Embeddable.class}
- ) {
- public boolean accept(String javaElementName) {
- return true;
- }
- };
- }
- if (detectedArtifacts[1] || searchORM || mappingFilesSize > 0) {
- filters[size - 1] = new FileFilter(true) {
- public boolean accept(String javaElementName) {
- return (detectedArtifacts[1] && javaElementName.endsWith("hbm.xml")) //$NON-NLS-1$
- || (searchORM && javaElementName.endsWith(META_INF_ORM_XML))
- || (mappingFilesSize > 0 && mappingFiles.contains(javaElementName));
- }
- };
- }
- return filters;
- }
-
-}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -64,12 +64,13 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.properties.HibernatePropertiesConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.stubs.util.OpenMappingUtilsEjb3;
+import org.hibernate.mediator.stubs.util.StringHelper;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
import org.xml.sax.InputSource;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -33,8 +33,6 @@
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.actions.AddConfigurationAction;
import org.hibernate.eclipse.console.actions.CloseConfigAction;
import org.hibernate.eclipse.console.actions.CriteriaEditorAction;
@@ -45,6 +43,8 @@
import org.hibernate.eclipse.console.actions.OpenMappingAction;
import org.hibernate.eclipse.console.actions.OpenSourceAction;
import org.hibernate.eclipse.console.actions.RefreshAction;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
/**
* @author max
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -46,12 +46,12 @@
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
@SuppressWarnings("restriction")
public class ConsoleConfigurationPropertySource implements IPropertySource {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -41,12 +41,12 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.hqleditor.HQLEditor;
import org.hibernate.eclipse.hqleditor.HQLEditorDocumentSetupParticipant;
import org.hibernate.eclipse.hqleditor.HQLSourceViewer;
import org.hibernate.eclipse.hqleditor.HQLSourceViewerConfiguration;
+import org.hibernate.mediator.stubs.util.StringHelper;
public class DynamicSQLPreviewView extends ViewPart {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -54,13 +54,13 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.node.BaseNode;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.actions.EditConsoleConfiguration;
import org.hibernate.eclipse.console.actions.OpenMappingAction;
import org.hibernate.eclipse.console.viewers.xpl.MTreeViewer;
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -60,16 +60,16 @@
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.Page;
-import org.hibernate.console.ConsoleQueryParameter;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.QueryInputModel;
-import org.hibernate.console.stubs.NullableTypeStub;
-import org.hibernate.console.stubs.TypeStub;
-import org.hibernate.console.stubs.util.ParserHelper;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.ConsoleQueryParameter;
+import org.hibernate.mediator.QueryInputModel;
+import org.hibernate.mediator.stubs.NullableTypeStub;
+import org.hibernate.mediator.stubs.TypeStub;
+import org.hibernate.mediator.stubs.util.ParserHelper;
+import org.hibernate.mediator.stubs.util.StringHelper;
public class QueryParametersPage extends Page implements IQueryParametersPage {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -5,11 +5,11 @@
import org.eclipse.jface.viewers.StructuredViewer;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
public class ReloadConfigurationAction extends ConsoleConfigurationBasedAction {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -23,7 +23,7 @@
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySource2;
-import org.hibernate.console.stubs.SessionStub;
+import org.hibernate.mediator.stubs.SessionStub;
public class EntityPropertySource implements IPropertySource2
{
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/HibernatePropertySourceProvider.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/HibernatePropertySourceProvider.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/HibernatePropertySourceProvider.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -24,8 +24,8 @@
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.IPropertySourceProvider;
import org.hibernate.console.QueryPage;
-import org.hibernate.console.stubs.SessionStub;
import org.hibernate.eclipse.console.views.QueryPageTabView;
+import org.hibernate.mediator.stubs.SessionStub;
public class HibernatePropertySourceProvider implements IPropertySourceProvider
{
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -67,8 +67,6 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.EclipseConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
@@ -77,6 +75,8 @@
import org.hibernate.eclipse.launch.ConsoleConfigurationMainTab;
import org.hibernate.eclipse.launch.ConsoleConfigurationTabGroup;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
+import org.hibernate.mediator.stubs.util.StringHelper;
/**
* This wizardpage wraps the LaunchConfiguration based tabs and thus mimicks the normal launch configuration ui.
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizard.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizard.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizard.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -46,11 +46,11 @@
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.eclipse.ui.ide.IDE;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.EnvironmentStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
-import org.hibernate.tool.hbm2x.HibernateConfigurationExporter;
+import org.hibernate.mediator.stubs.EnvironmentStub;
+import org.hibernate.mediator.stubs.HibernateConfigurationExporterStub;
/**
* Creates a new hibernate.cfg.xml
@@ -216,7 +216,7 @@
*/
private InputStream openContentStream(Properties props) {
StringWriter stringWriter = new StringWriter();
- HibernateConfigurationExporter hce = new HibernateConfigurationExporter();
+ HibernateConfigurationExporterStub hce = HibernateConfigurationExporterStub.newInstance();
hce.setCustomProperties(props);
hce.setOutput(stringWriter);
hce.start();
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -39,9 +39,6 @@
import org.eclipse.swt.widgets.TableItem;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.model.ITableFilter;
@@ -49,6 +46,9 @@
import org.hibernate.eclipse.console.workbench.LazyDatabaseSchema;
import org.hibernate.eclipse.console.workbench.TableContainer;
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.util.StringHelper;
public abstract class TableFilterView extends TreeToTableComposite {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -24,8 +24,8 @@
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.widgets.TableItem;
-import org.hibernate.cfg.reveng.SQLTypeMapping;
import org.hibernate.eclipse.console.model.ITypeMapping;
+import org.hibernate.mediator.stubs.SQLTypeMappingStub;
final public class TypeMappingCellModifier implements ICellModifier {
private final TableViewer tv;
@@ -73,8 +73,8 @@
private Boolean notnullToNullable(Integer value) {
if(value.intValue()==1) return Boolean.FALSE;
if(value.intValue()==0) return Boolean.TRUE;
- if(value.intValue()==2) return SQLTypeMapping.UNKNOWN_NULLABLE;
- return SQLTypeMapping.UNKNOWN_NULLABLE;
+ if(value.intValue()==2) return SQLTypeMappingStub.UNKNOWN_NULLABLE;
+ return SQLTypeMappingStub.UNKNOWN_NULLABLE;
}
private boolean safeEquals(Object value, Object tf) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ColumnWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ColumnWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ColumnWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -22,10 +22,10 @@
package org.hibernate.eclipse.console.workbench;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.ColumnStub;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.JDBCToHibernateTypeHelperStub;
public class ColumnWorkbenchAdapter extends BasicWorkbenchAdapter {
@@ -45,7 +45,7 @@
static String getColumnLabel(ColumnStub c) {
String label = c.getName();
if(c.getSqlTypeCode()!=null) {
- label += " : " + JDBCToHibernateTypeHelper.getJDBCTypeName(c.getSqlTypeCode().intValue()); //$NON-NLS-1$
+ label += " : " + JDBCToHibernateTypeHelperStub.getJDBCTypeName(c.getSqlTypeCode().intValue()); //$NON-NLS-1$
}
return label;
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationAdapterFactory.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -33,13 +33,13 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.node.BaseNode;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PrimaryKeyStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.ValueStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PrimaryKeyStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.ValueStub;
public class ConfigurationAdapterFactory implements IAdapterFactory {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -27,14 +27,13 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.PersistentClassStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
public class ConfigurationWorkbenchAdapter extends BasicWorkbenchAdapter {
- @SuppressWarnings("unchecked")
public Object[] getChildren(Object o) {
ConfigurationStub cfg = (ConfigurationStub) o;
Iterator<PersistentClassStub> classMappings = cfg.getClassMappings();
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -26,9 +26,9 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.ConfigurationStub;
public class ConsoleConfigurationWorkbenchAdapter extends BasicWorkbenchAdapter {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/HibernateWorkbenchHelper.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/HibernateWorkbenchHelper.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/HibernateWorkbenchHelper.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -24,10 +24,10 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.ValueStub;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.ValueStub;
+import org.hibernate.mediator.stubs.util.StringHelper;
public class HibernateWorkbenchHelper {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/IconNameValueVisitor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/IconNameValueVisitor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/IconNameValueVisitor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -22,21 +22,21 @@
package org.hibernate.eclipse.console.workbench;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.AnyStub;
-import org.hibernate.console.stubs.ArrayStub;
-import org.hibernate.console.stubs.BagStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.DependantValueStub;
-import org.hibernate.console.stubs.IdentifierBagStub;
-import org.hibernate.console.stubs.ListStub;
-import org.hibernate.console.stubs.ManyToOneStub;
-import org.hibernate.console.stubs.MapStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.OneToOneStub;
-import org.hibernate.console.stubs.PrimitiveArrayStub;
-import org.hibernate.console.stubs.SetStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.ValueVisitorStub;
+import org.hibernate.mediator.stubs.AnyStub;
+import org.hibernate.mediator.stubs.ArrayStub;
+import org.hibernate.mediator.stubs.BagStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.DependantValueStub;
+import org.hibernate.mediator.stubs.IdentifierBagStub;
+import org.hibernate.mediator.stubs.ListStub;
+import org.hibernate.mediator.stubs.ManyToOneStub;
+import org.hibernate.mediator.stubs.MapStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.OneToOneStub;
+import org.hibernate.mediator.stubs.PrimitiveArrayStub;
+import org.hibernate.mediator.stubs.SetStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.ValueVisitorStub;
final class IconNameValueVisitor implements ValueVisitorStub {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchema.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchema.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchema.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -21,20 +21,20 @@
*/
package org.hibernate.eclipse.console.workbench;
-import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
-import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.mediator.stubs.DefaultReverseEngineeringStrategyStub;
+import org.hibernate.mediator.stubs.ReverseEngineeringStrategyStub;
public class LazyDatabaseSchema {
private final ConsoleConfiguration ccfg;
- private final ReverseEngineeringStrategy res;
+ private final ReverseEngineeringStrategyStub res;
public LazyDatabaseSchema(ConsoleConfiguration ccfg) {
- this(ccfg, new DefaultReverseEngineeringStrategy());
+ this(ccfg, DefaultReverseEngineeringStrategyStub.newInstance());
}
- public LazyDatabaseSchema(ConsoleConfiguration ccfg, ReverseEngineeringStrategy res) {
+ public LazyDatabaseSchema(ConsoleConfiguration ccfg, ReverseEngineeringStrategyStub res) {
this.ccfg = ccfg;
this.res = res;
}
@@ -42,7 +42,7 @@
return ccfg;
}
- public ReverseEngineeringStrategy getReverseEngineeringStrategy() {
+ public ReverseEngineeringStrategyStub getReverseEngineeringStrategy() {
return res;
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -31,19 +31,19 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osgi.util.NLS;
-import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.execution.ExecutionContext;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.ConnectionProviderStub;
-import org.hibernate.console.stubs.DefaultDatabaseCollectorStub;
-import org.hibernate.console.stubs.JDBCReaderStub;
-import org.hibernate.console.stubs.SettingsStub;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.execution.ExecutionContext;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.ConnectionProviderStub;
+import org.hibernate.mediator.stubs.DefaultDatabaseCollectorStub;
+import org.hibernate.mediator.stubs.JDBCReaderStub;
+import org.hibernate.mediator.stubs.ReverseEngineeringStrategyStub;
+import org.hibernate.mediator.stubs.SettingsStub;
+import org.hibernate.mediator.stubs.TableStub;
public class LazyDatabaseSchemaWorkbenchAdapter extends BasicWorkbenchAdapter {
@@ -103,7 +103,7 @@
return getLazyDatabaseSchema(o).getConsoleConfiguration();
}
- protected void readDatabaseSchema(final IProgressMonitor monitor, final DefaultDatabaseCollectorStub db, ConsoleConfiguration consoleConfiguration, final ReverseEngineeringStrategy strategy) {
+ protected void readDatabaseSchema(final IProgressMonitor monitor, final DefaultDatabaseCollectorStub db, ConsoleConfiguration consoleConfiguration, final ReverseEngineeringStrategyStub strategy) {
final ConfigurationStub configuration = consoleConfiguration.buildWith(null, false);
consoleConfiguration.execute(new ExecutionContext.Command() {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PersistentClassWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PersistentClassWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PersistentClassWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -26,9 +26,9 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
public class PersistentClassWorkbenchAdapter extends BasicWorkbenchAdapter {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PrimaryKeyWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PrimaryKeyWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PrimaryKeyWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -23,10 +23,10 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.PrimaryKeyStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.PrimaryKeyStub;
public class PrimaryKeyWorkbenchAdapter extends BasicWorkbenchAdapter {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ProgressListenerMonitor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ProgressListenerMonitor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ProgressListenerMonitor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -22,9 +22,9 @@
package org.hibernate.eclipse.console.workbench;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.hibernate.cfg.reveng.ProgressListener;
+import org.hibernate.mediator.stubs.ProgressListenerStub;
-public class ProgressListenerMonitor implements ProgressListener {
+public class ProgressListenerMonitor extends ProgressListenerStub {
private final IProgressMonitor monitor;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PropertyWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PropertyWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PropertyWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -23,23 +23,23 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
-import org.hibernate.console.stubs.AnyStub;
-import org.hibernate.console.stubs.ArrayStub;
-import org.hibernate.console.stubs.BagStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.DependantValueStub;
-import org.hibernate.console.stubs.IdentifierBagStub;
-import org.hibernate.console.stubs.ListStub;
-import org.hibernate.console.stubs.ManyToOneStub;
-import org.hibernate.console.stubs.MapStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.OneToOneStub;
-import org.hibernate.console.stubs.PrimitiveArrayStub;
-import org.hibernate.console.stubs.PropertyStub;
-import org.hibernate.console.stubs.SetStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.ValueStub;
-import org.hibernate.console.stubs.ValueVisitorStub;
+import org.hibernate.mediator.stubs.AnyStub;
+import org.hibernate.mediator.stubs.ArrayStub;
+import org.hibernate.mediator.stubs.BagStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.DependantValueStub;
+import org.hibernate.mediator.stubs.IdentifierBagStub;
+import org.hibernate.mediator.stubs.ListStub;
+import org.hibernate.mediator.stubs.ManyToOneStub;
+import org.hibernate.mediator.stubs.MapStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.OneToOneStub;
+import org.hibernate.mediator.stubs.PrimitiveArrayStub;
+import org.hibernate.mediator.stubs.PropertyStub;
+import org.hibernate.mediator.stubs.SetStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.ValueStub;
+import org.hibernate.mediator.stubs.ValueVisitorStub;
public class PropertyWorkbenchAdapter extends BasicWorkbenchAdapter implements
IDeferredWorkbenchAdapter {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainer.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainer.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainer.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -23,7 +23,7 @@
import java.util.List;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.TableStub;
public class TableContainer {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -25,9 +25,9 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.TableStub;
public class TableContainerWorkbenchAdapter extends BasicWorkbenchAdapter {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableWorkbenchAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableWorkbenchAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableWorkbenchAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -27,10 +27,10 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.PrimaryKeyStub;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.PrimaryKeyStub;
+import org.hibernate.mediator.stubs.TableStub;
public class TableWorkbenchAdapter extends BasicWorkbenchAdapter {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -21,21 +21,21 @@
*/
package org.hibernate.eclipse.console.workbench;
-import org.hibernate.console.stubs.AnyStub;
-import org.hibernate.console.stubs.ArrayStub;
-import org.hibernate.console.stubs.BagStub;
-import org.hibernate.console.stubs.ComponentStub;
-import org.hibernate.console.stubs.DependantValueStub;
-import org.hibernate.console.stubs.IdentifierBagStub;
-import org.hibernate.console.stubs.ListStub;
-import org.hibernate.console.stubs.ManyToOneStub;
-import org.hibernate.console.stubs.MapStub;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.OneToOneStub;
-import org.hibernate.console.stubs.PrimitiveArrayStub;
-import org.hibernate.console.stubs.SetStub;
-import org.hibernate.console.stubs.SimpleValueStub;
-import org.hibernate.console.stubs.ValueVisitorStub;
+import org.hibernate.mediator.stubs.AnyStub;
+import org.hibernate.mediator.stubs.ArrayStub;
+import org.hibernate.mediator.stubs.BagStub;
+import org.hibernate.mediator.stubs.ComponentStub;
+import org.hibernate.mediator.stubs.DependantValueStub;
+import org.hibernate.mediator.stubs.IdentifierBagStub;
+import org.hibernate.mediator.stubs.ListStub;
+import org.hibernate.mediator.stubs.ManyToOneStub;
+import org.hibernate.mediator.stubs.MapStub;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.OneToOneStub;
+import org.hibernate.mediator.stubs.PrimitiveArrayStub;
+import org.hibernate.mediator.stubs.SetStub;
+import org.hibernate.mediator.stubs.SimpleValueStub;
+import org.hibernate.mediator.stubs.ValueVisitorStub;
public class TypeNameValueVisitor implements ValueVisitorStub {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -60,14 +60,14 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.QueryPage;
-import org.hibernate.console.execution.ExecutionContext.Command;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.SessionStub;
import org.hibernate.eclipse.console.AbstractQueryEditor;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.views.QueryPageTabView;
+import org.hibernate.mediator.execution.ExecutionContext.Command;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.SessionStub;
public class CriteriaEditor extends AbstractQueryEditor {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -34,11 +34,11 @@
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.swt.widgets.Shell;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.hqleditor.CompletionHelper;
+import org.hibernate.mediator.stubs.util.StringHelper;
public class JavaCompletionProcessor implements IContentAssistProcessor {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/ColumnEditPart.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/ColumnEditPart.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/ColumnEditPart.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -34,11 +34,11 @@
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.hibernate.console.stubs.ColumnStub;
import org.hibernate.eclipse.graph.anchor.LeftOrRightParentAnchor;
import org.hibernate.eclipse.graph.figures.EditableLabel;
import org.hibernate.eclipse.graph.model.ColumnViewAdapter;
import org.hibernate.eclipse.graph.model.GraphNode;
+import org.hibernate.mediator.stubs.ColumnStub;
public class ColumnEditPart extends AbstractGraphicalEditPart implements NodeEditPart, Observer {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/EntityGraphView.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/EntityGraphView.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/EntityGraphView.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -23,12 +23,12 @@
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.hibernate.console.stubs.ConfigurationStub;
import org.hibernate.eclipse.console.ConsolePreferencesConstants;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.views.KnownConfigurationsView;
import org.hibernate.eclipse.graph.model.ConfigurationViewAdapter;
import org.hibernate.eclipse.graph.parts.ConfigurationEditPart;
+import org.hibernate.mediator.stubs.ConfigurationStub;
public class EntityGraphView extends AbstractGraphViewPart {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalGraphView.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalGraphView.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalGraphView.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -26,11 +26,11 @@
import java.util.List;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.graph.model.ConfigurationViewAdapter;
import org.hibernate.eclipse.graph.model.TableViewAdapter;
import org.hibernate.eclipse.graph.parts.ConfigurationEditPart;
import org.hibernate.eclipse.graph.parts.PersistentClassEditPart;
+import org.hibernate.mediator.stubs.TableStub;
public class RelationalGraphView extends AbstractGraphViewPart {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/ColumnViewAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/ColumnViewAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/ColumnViewAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -23,7 +23,7 @@
import java.util.Observable;
-import org.hibernate.console.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.ColumnStub;
public class ColumnViewAdapter extends Observable {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/ConfigurationViewAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/ConfigurationViewAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/ConfigurationViewAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -28,8 +28,8 @@
import java.util.Map;
import java.util.Observable;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
public class ConfigurationViewAdapter extends Observable {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PersistentClassViewAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PersistentClassViewAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PersistentClassViewAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -21,7 +21,7 @@
*/
package org.hibernate.eclipse.graph.model;
-import org.hibernate.console.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PersistentClassStub;
public class PersistentClassViewAdapter extends GraphNode {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyAssociationViewAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyAssociationViewAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyAssociationViewAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -21,7 +21,7 @@
*/
package org.hibernate.eclipse.graph.model;
-import org.hibernate.console.stubs.util.StringHelper;
+import org.hibernate.mediator.stubs.util.StringHelper;
public class PropertyAssociationViewAdapter extends AssociationViewAdapter {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyViewAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyViewAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyViewAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -27,13 +27,13 @@
import java.util.Observable;
import org.eclipse.swt.graphics.Image;
-import org.hibernate.console.stubs.CollectionStub;
-import org.hibernate.console.stubs.EntityTypeStub;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
-import org.hibernate.console.stubs.OneToManyStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.workbench.HibernateWorkbenchHelper;
+import org.hibernate.mediator.stubs.CollectionStub;
+import org.hibernate.mediator.stubs.EntityTypeStub;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.stubs.OneToManyStub;
+import org.hibernate.mediator.stubs.PropertyStub;
public class PropertyViewAdapter extends Observable {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/TableViewAdapter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/TableViewAdapter.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/TableViewAdapter.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -25,8 +25,8 @@
import java.util.Iterator;
import java.util.List;
-import org.hibernate.console.stubs.ColumnStub;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.ColumnStub;
+import org.hibernate.mediator.stubs.TableStub;
public class TableViewAdapter extends GraphNode {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PersistentClassEditPart.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PersistentClassEditPart.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PersistentClassEditPart.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -27,13 +27,13 @@
import org.eclipse.draw2d.IFigure;
import org.eclipse.gef.EditPolicy;
-import org.hibernate.console.stubs.PersistentClassStub;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.console.workbench.HibernateWorkbenchHelper;
import org.hibernate.eclipse.graph.figures.PersistentClassFigure;
import org.hibernate.eclipse.graph.model.PersistentClassViewAdapter;
import org.hibernate.eclipse.graph.model.PropertyViewAdapter;
import org.hibernate.eclipse.graph.policy.PersistentClassLayoutPolicy;
+import org.hibernate.mediator.stubs.PersistentClassStub;
+import org.hibernate.mediator.stubs.PropertyStub;
public class PersistentClassEditPart extends GraphNodeEditPart {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/PropertyEditPart.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -33,12 +33,12 @@
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.hibernate.console.stubs.PropertyStub;
import org.hibernate.eclipse.graph.anchor.LeftOrRightParentAnchor;
import org.hibernate.eclipse.graph.figures.EditableLabel;
import org.hibernate.eclipse.graph.model.PersistentClassViewAdapter;
import org.hibernate.eclipse.graph.model.PropertyAssociationViewAdapter;
import org.hibernate.eclipse.graph.model.PropertyViewAdapter;
+import org.hibernate.mediator.stubs.PropertyStub;
public class PropertyEditPart extends AbstractGraphicalEditPart implements NodeEditPart, Observer {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/EclipseHQLCompletionRequestor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/EclipseHQLCompletionRequestor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/EclipseHQLCompletionRequestor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -27,12 +27,11 @@
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.swt.graphics.Image;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.HQLCompletionProposalStub;
-import org.hibernate.console.stubs.IHQLCompletionRequestorStub;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.console.workbench.HibernateWorkbenchHelper;
-import org.hibernate.tool.ide.completion.HQLCompletionProposal;
+import org.hibernate.mediator.stubs.HQLCompletionProposalStub;
+import org.hibernate.mediator.stubs.IHQLCompletionRequestorStub;
+import org.hibernate.mediator.stubs.util.StringHelper;
public class EclipseHQLCompletionRequestor extends IHQLCompletionRequestorStub {
@@ -67,8 +66,8 @@
private String getDisplayString(HQLCompletionProposalStub proposal) {
StringBuffer buf = new StringBuffer(proposal.getSimpleName());
- switch(proposal.getCompletionKind()) {
- case HQLCompletionProposal.ENTITY_NAME:
+ final int n = proposal.getCompletionKind();
+ if (n == HQLCompletionProposalStub.ENTITY_NAME) {
if(proposal.getEntityName()!=null &&
!(proposal.getSimpleName().equals( proposal.getEntityName()))) {
buf.append(" - "); //$NON-NLS-1$
@@ -77,15 +76,13 @@
!(proposal.getSimpleName().equals( proposal.getEntityName()))) {
buf.append( " - " + proposal.getShortEntityName() ); //$NON-NLS-1$
}
- break;
- case HQLCompletionProposal.ALIAS_REF:
+ } else if (n == HQLCompletionProposalStub.ALIAS_REF) {
if(proposal.getShortEntityName()!=null) {
buf.append( " - " + proposal.getShortEntityName() ); //$NON-NLS-1$
} else if(proposal.getEntityName()!=null) {
buf.append( " - " + proposal.getEntityName() ); //$NON-NLS-1$
}
- break;
- case HQLCompletionProposal.PROPERTY:
+ } else if (n == HQLCompletionProposalStub.PROPERTY) {
if(proposal.getShortEntityName()!=null) {
buf.append( " - " + proposal.getShortEntityName() ); //$NON-NLS-1$
} else if(proposal.getEntityName()!=null) {
@@ -95,13 +92,9 @@
buf.append( " - " + proposal.getEntityName() ); //$NON-NLS-1$
}
}
- break;
- case HQLCompletionProposal.KEYWORD:
- break;
- case HQLCompletionProposal.FUNCTION:
- break;
- default:
-
+ } else if (n == HQLCompletionProposalStub.KEYWORD) {
+ } else if (n == HQLCompletionProposalStub.FUNCTION) {
+ } else {
}
@@ -111,28 +104,23 @@
private Image getImage(HQLCompletionProposalStub proposal) {
String key = null;
- switch(proposal.getCompletionKind()) {
- case HQLCompletionProposal.ENTITY_NAME:
- case HQLCompletionProposal.ALIAS_REF:
+ final int n = proposal.getCompletionKind();
+ if (n == HQLCompletionProposalStub.ENTITY_NAME ||
+ n == HQLCompletionProposalStub.ALIAS_REF) {
key = ImageConstants.MAPPEDCLASS;
- break;
- case HQLCompletionProposal.PROPERTY:
+ } else if (n == HQLCompletionProposalStub.PROPERTY) {
if(proposal.getProperty()!=null) {
return HibernateWorkbenchHelper.getImage( proposal.getProperty() );
} else {
key = ImageConstants.PROPERTY;
}
- break;
- case HQLCompletionProposal.KEYWORD:
+ } else if (n == HQLCompletionProposalStub.KEYWORD) {
key = null;
- break;
- case HQLCompletionProposal.FUNCTION:
+ } else if (n == HQLCompletionProposalStub.FUNCTION) {
key = ImageConstants.FUNCTION;
- break;
- default:
+ } else {
key = null;
}
-
return key==null?null:EclipseImages.getImage( key );
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -35,10 +35,10 @@
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.stubs.IHQLCodeAssistStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.QueryEditor;
+import org.hibernate.mediator.stubs.IHQLCodeAssistStub;
/**
* content assist processor for HQL code.
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -56,14 +56,14 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.QueryPage;
-import org.hibernate.console.execution.ExecutionContext.Command;
-import org.hibernate.console.stubs.SessionStub;
import org.hibernate.eclipse.console.AbstractQueryEditor;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.views.IQueryParametersPage;
import org.hibernate.eclipse.console.views.QueryPageTabView;
import org.hibernate.eclipse.console.views.QueryParametersPage;
+import org.hibernate.mediator.execution.ExecutionContext.Command;
+import org.hibernate.mediator.stubs.SessionStub;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLFormattingStrategy.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLFormattingStrategy.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLFormattingStrategy.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -22,7 +22,7 @@
package org.hibernate.eclipse.hqleditor;
import org.eclipse.jface.text.formatter.IFormattingStrategy;
-import org.hibernate.console.util.QLFormatHelper;
+import org.hibernate.mediator.util.QLFormatHelper;
public class HQLFormattingStrategy implements IFormattingStrategy {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLLexerRule.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLLexerRule.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLLexerRule.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -27,11 +27,8 @@
import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IToken;
-import org.hibernate.console.stubs.HqlSqlTokenTypesStub;
-import org.hibernate.console.stubs.util.HqlBaseLexerStub;
+import org.hibernate.mediator.stubs.util.HqlBaseLexerStub;
-import antlr.Token;
-
public class HQLLexerRule implements IRule {
private final IToken hqlToken;
@@ -67,8 +64,7 @@
}
});
- Token token = lexer.nextToken();
- if (token != null && token.getType() == HqlSqlTokenTypesStub.IDENT) {
+ if (lexer.isNextTokenIdent()) {
return hqlToken;
}
return org.eclipse.jface.text.rules.Token.UNDEFINED;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -49,11 +49,11 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
import org.hibernate.eclipse.console.model.impl.ExporterProperty;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
+import org.hibernate.mediator.stubs.util.StringHelper;
/**
* Add/edit property dialog to configure Hibernate Exporters.
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -58,24 +58,24 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.osgi.util.NLS;
import org.eclipse.text.edits.TextEdit;
-import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
-import org.hibernate.cfg.reveng.OverrideRepository;
-import org.hibernate.cfg.reveng.ReverseEngineeringSettings;
-import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.execution.ExecutionContext.Command;
-import org.hibernate.console.stubs.ConfigurationStubFactory;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.ConfigurationStubJDBCMetaData;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
-import org.hibernate.console.stubs.util.ReflectHelper;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
-import org.hibernate.tool.hbm2x.ArtifactCollector;
-import org.hibernate.tool.hbm2x.Exporter;
+import org.hibernate.mediator.execution.ExecutionContext.Command;
+import org.hibernate.mediator.stubs.ArtifactCollectorStub;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.ConfigurationStubFactory;
+import org.hibernate.mediator.stubs.ConfigurationStubJDBCMetaData;
+import org.hibernate.mediator.stubs.DefaultReverseEngineeringStrategyStub;
+import org.hibernate.mediator.stubs.ExporterStub;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.stubs.OverrideRepositoryStub;
+import org.hibernate.mediator.stubs.ReverseEngineeringSettingsStub;
+import org.hibernate.mediator.stubs.ReverseEngineeringStrategyStub;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
+import org.hibernate.mediator.stubs.util.StringHelper;
public class CodeGenerationLaunchDelegate extends
LaunchConfigurationDelegate {
@@ -133,7 +133,7 @@
Set<String> outputDirectories = new HashSet<String>();
ExporterFactory[] exporters = exporterFactories.toArray( new ExporterFactory[exporterFactories.size()] );
- ArtifactCollector collector = runExporters(attributes, exporters, outputDirectories, monitor);
+ ArtifactCollectorStub collector = runExporters(attributes, exporters, outputDirectories, monitor);
for (String path : outputDirectories) {
refreshOutputDir( path );
@@ -157,7 +157,7 @@
}
- private void formatGeneratedCode(IProgressMonitor monitor, ArtifactCollector collector) {
+ private void formatGeneratedCode(IProgressMonitor monitor, ArtifactCollectorStub collector) {
final TextFileBufferOperation operation = new FormatGeneratedCode( HibernateConsoleMessages.CodeGenerationLaunchDelegate_formate_generated_code );
File[] javaFiles = collector.getFiles("java"); //$NON-NLS-1$
@@ -198,7 +198,7 @@
}
}
- private ArtifactCollector runExporters (final ExporterAttributes attributes, final ExporterFactory[] exporterFactories, final Set<String> outputDirectories, final IProgressMonitor monitor)
+ private ArtifactCollectorStub runExporters (final ExporterAttributes attributes, final ExporterFactory[] exporterFactories, final Set<String> outputDirectories, final IProgressMonitor monitor)
throws CoreException
{
@@ -218,10 +218,10 @@
if (monitor.isCanceled())
return null;
- return (ArtifactCollector) cc.execute(new Command() {
+ return (ArtifactCollectorStub) cc.execute(new Command() {
public Object execute() {
- ArtifactCollector artifactCollector = new ArtifactCollector();
+ ArtifactCollectorStub artifactCollector = ArtifactCollectorStub.newInstance();
// Global properties
Properties props = new Properties();
@@ -235,7 +235,7 @@
Properties globalProperties = new Properties();
globalProperties.putAll(props);
- Exporter exporter;
+ ExporterStub exporter;
try {
exporter = exporterFactories[i].createConfiguredExporter(cfg, attributes.getOutputPath(), attributes.getTemplatePath(), globalProperties, outputDirectories, artifactCollector);
} catch (CoreException e) {
@@ -284,13 +284,13 @@
public Object execute() {
//todo: factor this setup of revengstrategy to core
- ReverseEngineeringStrategy res = new DefaultReverseEngineeringStrategy();
+ ReverseEngineeringStrategyStub res = DefaultReverseEngineeringStrategyStub.newInstance();
- OverrideRepository repository = null;
+ OverrideRepositoryStub repository = null;
if(revengres!=null) {
File file = PathHelper.getLocation( revengres ).toFile();
- repository = new OverrideRepository();
+ repository = new OverrideRepositoryStub();
repository.addFile(file);
}
@@ -302,7 +302,7 @@
res = loadreverseEngineeringStrategy(reverseEngineeringStrategy, res);
}
- ReverseEngineeringSettings qqsettings = new ReverseEngineeringSettings(res)
+ ReverseEngineeringSettingsStub qqsettings = ReverseEngineeringSettingsStub.newInstance(res)
.setDefaultPackageName(attributes.getPackageName())
.setDetectManyToMany( attributes.detectManyToMany() )
.setDetectOneToOne( attributes.detectOneToOne() )
@@ -329,16 +329,16 @@
// TODO: merge with revstrategy load in JDBCConfigurationTask
@SuppressWarnings("unchecked")
- private ReverseEngineeringStrategy loadreverseEngineeringStrategy(final String className, ReverseEngineeringStrategy delegate) {
+ private ReverseEngineeringStrategyStub loadreverseEngineeringStrategy(final String className, ReverseEngineeringStrategyStub delegate) {
try {
- Class<ReverseEngineeringStrategy> clazz = ReflectHelper.classForName(className);
- Constructor<ReverseEngineeringStrategy> constructor = clazz.getConstructor(new Class[] { ReverseEngineeringStrategy.class });
+ Class<ReverseEngineeringStrategyStub> clazz = ReflectHelper.classForName(className);
+ Constructor<ReverseEngineeringStrategyStub> constructor = clazz.getConstructor(new Class[] { ReverseEngineeringStrategyStub.class });
return constructor.newInstance(new Object[] { delegate });
}
catch (NoSuchMethodException e) {
try {
Class<?> clazz = ReflectHelper.classForName(className);
- ReverseEngineeringStrategy rev = (ReverseEngineeringStrategy) clazz.newInstance();
+ ReverseEngineeringStrategyStub rev = (ReverseEngineeringStrategyStub) clazz.newInstance();
return rev;
}
catch (Exception eq) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -55,7 +55,6 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
-import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
@@ -64,6 +63,7 @@
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.console.wizards.NewReverseEngineeringFileWizard;
+import org.hibernate.mediator.stubs.ReverseEngineeringStrategyStub;
@SuppressWarnings("restriction")
public class CodeGenerationSettingsTab extends AbstractLaunchConfigurationTab {
@@ -155,7 +155,7 @@
reverseEngineeringStrategy = new StringButtonDialogField(new IStringButtonAdapter() {
public void changeControlPressed(DialogField field) {
- String string = DialogSelectionHelper.chooseImplementation(ReverseEngineeringStrategy.class.getName(), reverseEngineeringStrategy.getText(), HibernateConsoleMessages.CodeGenerationSettingsTab_choose_reverse_engineering_strategy, getShell());
+ String string = DialogSelectionHelper.chooseImplementation(ReverseEngineeringStrategyStub.getClassName(), reverseEngineeringStrategy.getText(), HibernateConsoleMessages.CodeGenerationSettingsTab_choose_reverse_engineering_strategy, getShell());
if(string!=null) {
reverseEngineeringStrategy.setText(string);
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConnectionProfileCtrl.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConnectionProfileCtrl.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConnectionProfileCtrl.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -42,9 +42,9 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.internal.dialogs.PropertyDialog;
-import org.hibernate.annotations.common.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.mediator.stubs.util.StringHelper;
/**
*
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -42,8 +42,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
@@ -51,6 +49,8 @@
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.console.wizards.NewConfigurationWizard;
import org.hibernate.eclipse.console.wizards.NewConfigurationWizardPage;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
+import org.hibernate.mediator.stubs.util.StringHelper;
@SuppressWarnings("restriction")
public class ConsoleConfigurationMainTab extends ConsoleConfigurationTab {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationOptionsTab.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationOptionsTab.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationOptionsTab.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -16,11 +16,11 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
-import org.hibernate.console.stubs.NamingStrategyStub;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.console.utils.DriverClassHelpers;
+import org.hibernate.mediator.stubs.NamingStrategyStub;
import org.xml.sax.EntityResolver;
@SuppressWarnings("restriction")
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTab.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTab.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTab.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -13,8 +13,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
-import org.hibernate.console.stubs.util.StringHelper;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
+import org.hibernate.mediator.stubs.util.StringHelper;
abstract public class ConsoleConfigurationTab extends AbstractLaunchConfigurationTab {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -51,12 +51,12 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.osgi.util.NLS;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.ExtensionManager;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
// This class was created to centralize launch configuration attribute loading/saving
// (and also to clean up CodeGenerationLaunchDelegate considerably)
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/nature/HibernateNature.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/nature/HibernateNature.java 2010-03-29 16:55:41 UTC (rev 21120)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/nature/HibernateNature.java 2010-03-29 17:23:44 UTC (rev 21121)
@@ -43,16 +43,16 @@
import org.eclipse.jdt.core.JavaCore;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.execution.ExecutionContext.Command;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.ConfigurationStubFactory;
-import org.hibernate.console.stubs.ConfigurationStubJDBCMetaData;
-import org.hibernate.console.stubs.TableIdentifierStub;
-import org.hibernate.console.stubs.TableStub;
import org.hibernate.eclipse.builder.HibernateBuilder;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.properties.HibernatePropertiesConstants;
+import org.hibernate.mediator.execution.ExecutionContext.Command;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.ConfigurationStubFactory;
+import org.hibernate.mediator.stubs.ConfigurationStubJDBCMetaData;
+import org.hibernate.mediator.stubs.TableIdentifierStub;
+import org.hibernate.mediator.stubs.TableStub;
import org.osgi.service.prefs.Preferences;
public class HibernateNature implements IProjectNature {
14 years, 11 months
JBoss Tools SVN: r21119 - in branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse: .settings and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-29 12:32:11 -0400 (Mon, 29 Mar 2010)
New Revision: 21119
Added:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.settings/org.eclipse.pde.core.prefs
Removed:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleQueryParameter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeDelegatingDriver.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeTransactionManagerLookup.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryInputModel.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/AbstractTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/AnyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ArrayStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/BagStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/Cfg2HbmToolStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ClassMetadataStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionMetadataStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ColumnStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ComponentStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubJDBCMetaData.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConnectionProviderStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DefaultDatabaseCollectorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DependantValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DialectStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EntityModeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EntityTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EnvironmentStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/FetchModeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ForeignKeyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HQLCompletionProposalStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HibernateConsoleRuntimeException.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HibernateStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HqlSqlTokenTypesStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IHQLCodeAssistStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IHQLCompletionRequestorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IdentifierBagStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IdentifierCollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ImmutableTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IndexedCollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IntegerTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JDBCReaderStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JoinStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JoinedSubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/KeyValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ListStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ManyToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MapStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MappingStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MappingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/NamingStrategyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/NullableTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/OneToManyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/OneToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PersistentClassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PersistentClassStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimaryKeyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimitiveArrayStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimitiveTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PropertyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/RootClassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SetStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SettingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SimpleValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SingleTableSubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TableIdentifierStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TableStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TypeStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueVisitorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/mapping/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.classpath
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/build.properties
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfigClassLoader.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPageModel.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ClassNode.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/IdentifierNode.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PropertyNode.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/TableNode.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/TypeNode.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/StandAloneConsoleConfigurationPreferences.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginFileAppender.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogListener.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.classpath
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.classpath 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.classpath 2010-03-29 16:32:11 UTC (rev 21119)
@@ -3,42 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/asm.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/asm-attrs.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/dom4j-1.6.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/jboss-cache.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/jboss-common.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/jboss-jmx.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/jboss-system.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/jdbc2_0-stdext.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/jta.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/jaas.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/oscache-2.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/proxool-0.8.3.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/swarmcache-1.0rc2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/bsh-core-2.0b4.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/annotations/hibernate-annotations.jar" sourcepath="D:/Temp/_hibernate/hibernate-annotations-3.4.0.GA-sources.jar "/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/jgroups-2.2.8.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/antlr-2.7.6.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/annotations/hibernate-entitymanager.jar" sourcepath="D:/Temp/_hibernate/hibernate-entitymanager-3.4.0.GA-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/javassist.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/annotations/hibernate-validator.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/log4j-1.2.15.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/hibernate-jmx.jar" sourcepath="D:/Temp/_hibernate/hibernate-jmx-3.3.2.GA-sources.jar "/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/commons-collections-3.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/slf4j-api-1.5.8.jar" sourcepath="D:/Temp/_hibernate/slf4j-api-1.5.8-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/cglib-2.2.jar" sourcepath="D:/Temp/_hibernate/cglib-src-2.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/annotations/hibernate-commons-annotations.jar" sourcepath="D:/Temp/_hibernate/hibernate-commons-annotations-3.1.0.GA-sources.jar "/>
- <classpathentry exported="true" kind="lib" path="lib/annotations/ejb3-persistence.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/c3p0-0.9.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/commons-logging-1.0.4.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/concurrent-1.3.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/connector.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/ehcache-1.2.3.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate/slf4j-log4j12-1.5.8.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/tools/freemarker.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/tools/hibernate-tools.jar" sourcepath="C:/RHDS/hibernate/branches/Branch_3_2/HibernateExt_without_changes"/>
- <classpathentry exported="true" kind="lib" path="lib/tools/jtidy-r8-20060801.jar"/>
- <classpathentry kind="lib" path="lib/hibernate/hibernate3.jar" sourcepath="D:/Temp/_hibernate/hibernate-core-3.3.2.GA-sources.jar "/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.hibernate.mediator"/>
<classpathentry kind="output" path="build/eclipse"/>
</classpath>
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.settings/org.eclipse.pde.core.prefs
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/.settings/org.eclipse.pde.core.prefs 2010-03-29 16:32:11 UTC (rev 21119)
@@ -0,0 +1,3 @@
+#Mon Mar 29 16:19:25 EEST 2010
+eclipse.preferences.version=1
+resolve.requirebundle=false
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF 2010-03-29 16:32:11 UTC (rev 21119)
@@ -3,448 +3,24 @@
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.hibernate.eclipse
Bundle-Version: 3.3.0.qualifier
-Bundle-ClassPath: org.hibernate.eclipse.jar,
- lib/hibernate/asm.jar,
- lib/hibernate/asm-attrs.jar,
- lib/hibernate/commons-collections-2.1.1.jar,
- lib/hibernate/commons-logging-1.0.4.jar,
- lib/hibernate/concurrent-1.3.2.jar,
- lib/hibernate/connector.jar,
- lib/hibernate/dom4j-1.6.1.jar,
- lib/hibernate/hibernate3.jar,
- lib/hibernate/jboss-cache.jar,
- lib/hibernate/jboss-common.jar,
- lib/hibernate/jboss-jmx.jar,
- lib/hibernate/jboss-system.jar,
- lib/hibernate/jdbc2_0-stdext.jar,
- lib/hibernate/jta.jar,
- lib/hibernate/jaas.jar,
- lib/hibernate/oscache-2.1.jar,
- lib/hibernate/proxool-0.8.3.jar,
- lib/hibernate/swarmcache-1.0rc2.jar,
- lib/tools/hibernate-tools.jar,
- lib/tools/bsh-2.0b1.jar,
- lib/tools/freemarker.jar,
- lib/bsh-core-2.0b4.jar,
- lib/annotations/ejb3-persistence.jar,
- lib/annotations/hibernate-annotations.jar,
- lib/hibernate/cglib-2.1.3.jar,
- lib/hibernate/jgroups-2.2.8.jar,
- lib/hibernate/antlr-2.7.6.jar,
- lib/tools/jtidy-r8-20060801.jar,
- lib/annotations/hibernate-entitymanager.jar,
- lib/hibernate/javassist.jar,
- lib/hibernate/ehcache-1.2.3.jar,
- lib/hibernate/c3p0-0.9.1.jar,
- lib/annotations/hibernate-commons-annotations.jar,
- lib/annotations/hibernate-validator.jar,
- lib/annotations/hibernate-search.jar,
- lib/annotations/lucene-core-2.2.0.jar,
- lib/hibernate/log4j-1.2.15.jar,
- lib/hibernate/cglib-2.2.jar,
- lib/hibernate/commons-collections-3.1.jar,
- lib/hibernate/hibernate-jmx.jar,
- lib/hibernate/slf4j-api-1.5.8.jar,
- lib/hibernate/slf4j-log4j12-1.5.8.jar
+Bundle-ClassPath: org.hibernate.eclipse.jar
Bundle-Activator: org.hibernate.eclipse.HibernatePlugin
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
-Export-Package: EDU.oswego.cs.dl.util.concurrent,
- antlr,
- antlr.ASdebug,
- antlr.actions.cpp,
- antlr.actions.csharp,
- antlr.actions.java,
- antlr.actions.python,
- antlr.build,
- antlr.collections,
- antlr.collections.impl,
- antlr.debug,
- antlr.debug.misc,
- antlr.preprocessor,
- bsh,
- com.mchange,
- com.mchange.lang,
- com.mchange.util,
- com.mchange.v1,
- com.mchange.v1.db,
- com.mchange.v1.db.sql,
- com.mchange.v1.identicator,
- com.mchange.v1.io,
- com.mchange.v1.lang,
- com.mchange.v1.util,
- com.mchange.v1.xml,
- com.mchange.v2,
- com.mchange.v2.async,
- com.mchange.v2.beans,
- com.mchange.v2.c3p0,
- com.mchange.v2.c3p0.cfg,
- com.mchange.v2.c3p0.filter,
- com.mchange.v2.c3p0.impl,
- com.mchange.v2.c3p0.jboss,
- com.mchange.v2.c3p0.management,
- com.mchange.v2.c3p0.mbean,
- com.mchange.v2.c3p0.stmt,
- com.mchange.v2.c3p0.subst,
- com.mchange.v2.c3p0.util,
- com.mchange.v2.cfg,
- com.mchange.v2.cfg.junit,
- com.mchange.v2.coalesce,
- com.mchange.v2.codegen,
- com.mchange.v2.codegen.bean,
- com.mchange.v2.codegen.intfc,
- com.mchange.v2.debug,
- com.mchange.v2.encounter,
- com.mchange.v2.holders,
- com.mchange.v2.io,
- com.mchange.v2.lang,
- com.mchange.v2.log,
- com.mchange.v2.log.jdk14logging,
- com.mchange.v2.log.log4j,
- com.mchange.v2.management,
- com.mchange.v2.naming,
- com.mchange.v2.resourcepool,
- com.mchange.v2.ser,
- com.mchange.v2.sql,
- com.mchange.v2.sql.filter,
- com.mchange.v2.util,
- com.opensymphony.oscache.base,
- com.opensymphony.oscache.base.algorithm,
- com.opensymphony.oscache.base.events,
- com.opensymphony.oscache.base.persistence,
- com.opensymphony.oscache.extra,
- com.opensymphony.oscache.general,
- com.opensymphony.oscache.plugins.clustersupport,
- com.opensymphony.oscache.plugins.diskpersistence,
- com.opensymphony.oscache.util,
- com.opensymphony.oscache.web,
- com.opensymphony.oscache.web.filter,
- com.opensymphony.oscache.web.tag,
- com.sun.security.auth,
- com.sun.security.auth.login,
- dao,
- doc,
- doc.entities,
- doc.tables,
- dot,
- dtd,
- freemarker,
- freemarker.cache,
- freemarker.core,
- freemarker.debug,
- freemarker.debug.impl,
- freemarker.ext.ant,
- freemarker.ext.beans,
- freemarker.ext.dom,
- freemarker.ext.jdom,
- freemarker.ext.jsp,
- freemarker.ext.jython,
- freemarker.ext.rhino,
- freemarker.ext.servlet,
- freemarker.ext.util,
- freemarker.ext.xml,
- freemarker.log,
- freemarker.template,
- freemarker.template.utility,
- hbm,
- javassist,
- javassist.bytecode,
- javassist.bytecode.analysis,
- javassist.bytecode.annotation,
- javassist.bytecode.stackmap,
- javassist.compiler,
- javassist.compiler.ast,
- javassist.convert,
- javassist.expr,
- javassist.runtime,
- javassist.scopedpool,
- javassist.tools,
- javassist.tools.reflect,
- javassist.tools.rmi,
- javassist.tools.web,
- javassist.util,
- javassist.util.proxy,
- javax.management,
- javax.management.loading,
- javax.management.modelmbean,
- javax.management.monitor,
- javax.management.openmbean,
- javax.management.relation,
- javax.management.timer,
- javax.persistence,
- javax.persistence.spi,
- javax.resource,
- javax.resource.cci,
- javax.resource.spi,
- javax.resource.spi.security,
- javax.security.auth,
- javax.security.auth.callback,
- javax.security.auth.login,
- javax.security.auth.spi,
- javax.sql,
- javax.transaction,
- javax.transaction.xa,
- lint,
- net.sf.cglib.beans,
- net.sf.cglib.core,
- net.sf.cglib.proxy,
- net.sf.cglib.reflect,
- net.sf.cglib.transform,
- net.sf.cglib.transform.impl,
- net.sf.cglib.util,
- net.sf.ehcache,
- net.sf.ehcache.bootstrap,
- net.sf.ehcache.config,
- net.sf.ehcache.constructs.asynchronous,
- net.sf.ehcache.constructs.blocking,
- net.sf.ehcache.constructs.concurrent,
- net.sf.ehcache.constructs.web,
- net.sf.ehcache.constructs.web.filter,
- net.sf.ehcache.distribution,
- net.sf.ehcache.event,
- net.sf.ehcache.hibernate,
- net.sf.ehcache.store,
- net.sf.ehcache.util,
- net.sf.swarmcache,
- org.apache.commons.collections,
- org.apache.commons.collections.bag,
- org.apache.commons.collections.bidimap,
- org.apache.commons.collections.buffer,
- org.apache.commons.collections.collection,
- org.apache.commons.collections.comparators,
- org.apache.commons.collections.functors,
- org.apache.commons.collections.iterators,
- org.apache.commons.collections.keyvalue,
- org.apache.commons.collections.list,
- org.apache.commons.collections.map,
- org.apache.commons.collections.set,
- org.apache.commons.logging,
- org.apache.commons.logging.impl,
- org.apache.log4j,
- org.apache.log4j.chainsaw,
- org.apache.log4j.config,
- org.apache.log4j.helpers,
- org.apache.log4j.jdbc,
- org.apache.log4j.jmx,
- org.apache.log4j.lf5,
- org.apache.log4j.lf5.config,
- org.apache.log4j.lf5.util,
- org.apache.log4j.lf5.viewer,
- org.apache.log4j.lf5.viewer.categoryexplorer,
- org.apache.log4j.lf5.viewer.configure,
- org.apache.log4j.lf5.viewer.images,
- org.apache.log4j.net,
- org.apache.log4j.nt,
- org.apache.log4j.or,
- org.apache.log4j.or.jms,
- org.apache.log4j.or.sax,
- org.apache.log4j.spi,
- org.apache.log4j.varia,
- org.apache.log4j.xml,
- org.apache.xerces.impl.xs,
- org.dom4j,
- org.dom4j.bean,
- org.dom4j.datatype,
- org.dom4j.dom,
- org.dom4j.dtd,
- org.dom4j.io,
- org.dom4j.jaxb,
- org.dom4j.rule,
- org.dom4j.rule.pattern,
- org.dom4j.swing,
- org.dom4j.tree,
- org.dom4j.util,
- org.dom4j.xpath,
- org.dom4j.xpp,
- org.hibernate,
- org.hibernate.annotations,
- org.hibernate.annotations.common,
- org.hibernate.annotations.common.annotationfactory,
- org.hibernate.annotations.common.reflection,
- org.hibernate.annotations.common.reflection.java,
- org.hibernate.annotations.common.reflection.java.generics,
- org.hibernate.annotations.common.util,
- org.hibernate.cfg,
- org.hibernate.cfg.annotations,
- org.hibernate.cfg.annotations.reflection,
- org.hibernate.cfg.reveng,
- org.hibernate.cfg.reveng.dialect,
- org.hibernate.cfg.search,
- org.hibernate.console,
- org.hibernate.console.execution,
+Export-Package: org.hibernate.console,
org.hibernate.console.node,
org.hibernate.console.preferences,
- org.hibernate.console.stubs,
- org.hibernate.console.stubs.util,
org.hibernate.eclipse,
org.hibernate.eclipse.launch,
org.hibernate.eclipse.logging,
- org.hibernate.eclipse.logging.xpl,
- org.hibernate.ejb,
- org.hibernate.ejb.connection,
- org.hibernate.ejb.event,
- org.hibernate.ejb.instrument,
- org.hibernate.ejb.packaging,
- org.hibernate.ejb.transaction,
- org.hibernate.ejb.util,
- org.hibernate.engine,
- org.hibernate.jmx,
- org.hibernate.mapping,
- org.hibernate.tool,
- org.hibernate.tool.ant,
- org.hibernate.tool.hbm2x,
- org.hibernate.tool.hbm2x.doc,
- org.hibernate.tool.hbm2x.pojo,
- org.hibernate.tool.hbm2x.visitor,
- org.hibernate.tool.hbmlint,
- org.hibernate.tool.hbmlint.detector,
- org.hibernate.tool.ide.completion,
- org.hibernate.tool.ide.formatting,
- org.hibernate.tool.stat,
- org.hibernate.type,
- org.hibernate.validator,
- org.hibernate.validator.event,
- org.hibernate.validator.interpolator,
- org.hibernate.validator.resources,
- org.jboss,
- org.jboss.cache,
- org.jboss.cache.aop,
- org.jboss.cache.aop.annotation,
- org.jboss.cache.aop.collection,
- org.jboss.cache.aop.eviction,
- org.jboss.cache.aop.interceptors,
- org.jboss.cache.aop.references,
- org.jboss.cache.aop.util,
- org.jboss.cache.buddyreplication,
- org.jboss.cache.config,
- org.jboss.cache.eviction,
- org.jboss.cache.factories,
- org.jboss.cache.interceptors,
- org.jboss.cache.loader,
- org.jboss.cache.loader.bdbje,
- org.jboss.cache.loader.jdbm,
- org.jboss.cache.loader.rmi,
- org.jboss.cache.loader.tcp,
- org.jboss.cache.lock,
- org.jboss.cache.marshall,
- org.jboss.cache.optimistic,
- org.jboss.cache.rpc,
- org.jboss.cache.statetransfer,
- org.jboss.cache.transaction,
- org.jboss.cache.util,
- org.jboss.cache.xml,
- org.jboss.deployment,
- org.jboss.deployment.cache,
- org.jboss.deployment.scanner,
- org.jboss.logging,
- org.jboss.logging.appender,
- org.jboss.logging.filter,
- org.jboss.logging.layout,
- org.jboss.logging.util,
- org.jboss.mx.capability,
- org.jboss.mx.interceptor,
- org.jboss.mx.loading,
- org.jboss.mx.metadata,
- org.jboss.mx.modelmbean,
- org.jboss.mx.notification,
- org.jboss.mx.persistence,
- org.jboss.mx.server,
- org.jboss.mx.server.registry,
- org.jboss.mx.service,
- org.jboss.mx.util,
- org.jboss.mx.util.propertyeditor,
- org.jboss.net.protocol,
- org.jboss.net.protocol.file,
- org.jboss.net.protocol.http,
- org.jboss.net.protocol.njar,
- org.jboss.net.protocol.resource,
- org.jboss.net.sockets,
- org.jboss.net.ssl,
- org.jboss.system,
- org.jboss.system.pm,
- org.jboss.system.server,
- org.jboss.util,
- org.jboss.util.coerce,
- org.jboss.util.collection,
- org.jboss.util.deadlock,
- org.jboss.util.file,
- org.jboss.util.id,
- org.jboss.util.loading,
- org.jboss.util.platform,
- org.jboss.util.property,
- org.jboss.util.property.jmx,
- org.jboss.util.propertyeditor,
- org.jboss.util.state,
- org.jboss.util.state.xml,
- org.jboss.util.stream,
- org.jboss.util.threadpool,
- org.jboss.util.timeout,
- org.jboss.util.xml,
- org.jboss.xml,
- org.jboss.xml.binding,
- org.jboss.xml.binding.metadata,
- org.jboss.xml.binding.metadata.marshalling,
- org.jboss.xml.binding.metadata.unmarshalling,
- org.jboss.xml.binding.metadata.unmarshalling.impl,
- org.jboss.xml.binding.parser,
- org.jboss.xml.binding.parser.sax,
- org.jboss.xml.binding.parser.xni,
- org.jgroups,
- org.jgroups.blocks,
- org.jgroups.conf,
- org.jgroups.debug,
- org.jgroups.demos,
- org.jgroups.demos.applets,
- org.jgroups.demos.wb,
- org.jgroups.persistence,
- org.jgroups.protocols,
- org.jgroups.protocols.pbcast,
- org.jgroups.protocols.ring,
- org.jgroups.service,
- org.jgroups.service.lease,
- org.jgroups.stack,
- org.jgroups.tests,
- org.jgroups.tests.adapt,
- org.jgroups.tests.adaptjms,
- org.jgroups.tests.adapttcp,
- org.jgroups.tests.adaptudp,
- org.jgroups.tests.perf,
- org.jgroups.tests.perf.transports,
- org.jgroups.tests.stack,
- org.jgroups.util,
- org.logicalcobwebs.asm,
- org.logicalcobwebs.asm.tree,
- org.logicalcobwebs.asm.util,
- org.logicalcobwebs.cglib.core,
- org.logicalcobwebs.cglib.proxy,
- org.logicalcobwebs.cglib.reflect,
- org.logicalcobwebs.cglib.util,
- org.logicalcobwebs.concurrent,
- org.logicalcobwebs.logging,
- org.logicalcobwebs.logging.impl,
- org.logicalcobwebs.proxool,
- org.logicalcobwebs.proxool.admin,
- org.logicalcobwebs.proxool.admin.jmx,
- org.logicalcobwebs.proxool.admin.servlet,
- org.logicalcobwebs.proxool.configuration,
- org.logicalcobwebs.proxool.resources,
- org.logicalcobwebs.proxool.util,
- org.objectweb.asm,
- org.objectweb.asm.attrs,
- org.objectweb.asm.signature,
- org.slf4j,
- org.slf4j.helpers,
- org.slf4j.impl,
- org.slf4j.spi,
- org.w3c.tidy,
- org.w3c.tidy.ant,
- pojo
+ org.hibernate.eclipse.logging.xpl
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui.console,
org.eclipse.ui.views,
org.eclipse.jface,
org.eclipse.jdt.apt.core,
- org.eclipse.datatools.connectivity
+ org.eclipse.datatools.connectivity,
+ org.hibernate.mediator
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: registered
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/build.properties
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/build.properties 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/build.properties 2010-03-29 16:32:11 UTC (rev 21119)
@@ -4,7 +4,6 @@
META-INF/,\
hibernate-log4j.properties,\
about.html,\
- lib/tools/bsh-2.0b1.jar,\
lib/tools/jtidy-r8-20060801.jar,\
lib/annotations/hibernate-entitymanager.jar,\
lib/hibernate/javassist.jar,\
@@ -29,4 +28,3 @@
src.includes = src/,\
about.html
bin.excludes = lib/.cvsignore
-source.lib/tools/bsh-2.0b1.jar = src/
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -27,7 +27,8 @@
import java.util.Iterator;
import java.util.List;
-import org.hibernate.console.stubs.SessionStub;
+import org.hibernate.mediator.QueryInputModel;
+import org.hibernate.mediator.stubs.SessionStub;
/**
* @author MAX
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfigClassLoader.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfigClassLoader.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfigClassLoader.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -22,7 +22,7 @@
import java.util.Vector;
import java.util.jar.JarFile;
-import org.hibernate.console.stubs.util.ReflectHelper;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
/**
* Workaround for jdk disgrace with open jar files & native libs,
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -35,19 +35,20 @@
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
-import org.hibernate.HibernateException;
-import org.hibernate.console.execution.DefaultExecutionContext;
-import org.hibernate.console.execution.ExecutionContext;
-import org.hibernate.console.execution.ExecutionContextHolder;
-import org.hibernate.console.execution.ExecutionContext.Command;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.stubs.ConfigurationStubFactory;
-import org.hibernate.console.stubs.ConfigurationStub;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
-import org.hibernate.console.stubs.IHQLCodeAssistStub;
-import org.hibernate.console.stubs.SessionStub;
-import org.hibernate.console.stubs.SessionStubFactory;
-import org.hibernate.console.stubs.SettingsStub;
+import org.hibernate.mediator.ConsoleConfigClassLoader;
+import org.hibernate.mediator.QueryInputModel;
+import org.hibernate.mediator.execution.DefaultExecutionContext;
+import org.hibernate.mediator.execution.ExecutionContext;
+import org.hibernate.mediator.execution.ExecutionContextHolder;
+import org.hibernate.mediator.execution.ExecutionContext.Command;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.stubs.ConfigurationStub;
+import org.hibernate.mediator.stubs.ConfigurationStubFactory;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.stubs.IHQLCodeAssistStub;
+import org.hibernate.mediator.stubs.SessionStub;
+import org.hibernate.mediator.stubs.SessionStubFactory;
+import org.hibernate.mediator.stubs.SettingsStub;
import org.xml.sax.EntityResolver;
public class ConsoleConfiguration implements ExecutionContextHolder {
@@ -448,7 +449,8 @@
try{
build();
buildMappings();
- } catch (HibernateException e){
+ } catch (RuntimeException e) {
+ // TODO: RuntimeException ? - find correct solution
// String mess = NLS.bind(HibernateConsoleMessages.CompletionHelper_error_could_not_build_cc, consoleConfiguration.getName());
throw e;
//HibernateConsolePlugin.getDefault().logErrorMessage(mess, e);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleMessages.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -4,24 +4,24 @@
public class ConsoleMessages extends NLS {
private static final String BUNDLE_NAME = "org.hibernate.console.ConsoleMessages"; //$NON-NLS-1$
- public static String ConsoleConfiguration_connection_profile_not_found;
- public static String ConsoleConfiguration_could_not_access;
- public static String ConsoleConfiguration_could_not_configure_entity_resolver;
- public static String ConsoleConfiguration_could_not_configure_naming_strategy;
- public static String ConsoleConfiguration_could_not_create_jpa_based_configuration;
- public static String ConsoleConfiguration_could_not_load_annotationconfiguration;
- public static String ConsoleConfiguration_could_not_load_jpa_configuration;
- public static String ConsoleConfiguration_could_not_parse_configuration;
+ //public static String ConsoleConfiguration_connection_profile_not_found;
+ //public static String ConsoleConfiguration_could_not_access;
+ //public static String ConsoleConfiguration_could_not_configure_entity_resolver;
+ //public static String ConsoleConfiguration_could_not_configure_naming_strategy;
+ //public static String ConsoleConfiguration_could_not_create_jpa_based_configuration;
+ //public static String ConsoleConfiguration_could_not_load_annotationconfiguration;
+ //public static String ConsoleConfiguration_could_not_load_jpa_configuration;
+ //public static String ConsoleConfiguration_could_not_parse_configuration;
public static String ConsoleConfiguration_factory_not_closed_before_build_new_factory;
- public static String ConsoleConfiguration_invalid_configuration;
- public static String ConsoleConfiguration_persistence_unit_not_found;
- public static String ConsoleConfiguration_problems_while_loading_database_driverclass;
+ //public static String ConsoleConfiguration_invalid_configuration;
+ //public static String ConsoleConfiguration_persistence_unit_not_found;
+ //public static String ConsoleConfiguration_problems_while_loading_database_driverclass;
public static String JavaPage_no_info;
- public static String JavaPage_not_allowed;
+ //public static String JavaPage_not_allowed;
public static String KnownConfigurations_could_not_write_state;
public static String KnownConfigurations_hibernate_log;
public static String KnownConfigurations_unknown;
- public static String DefaultExecutionContext_existing_classloader;
+ //public static String DefaultExecutionContext_existing_classloader;
public static String ClassNode_uninitialized_proxy;
public static String ConfigurationNode_mapped_entities;
public static String NodeFactory_unknown;
@@ -31,12 +31,12 @@
public static String AbstractConsoleConfigurationPreferences_unknown;
public static String StandAloneConsoleConfigurationPreferences_could_not_resolve_classpaths;
public static String StandAloneConsoleConfigurationPreferences_errors_while_parsing;
- public static String PluginFileAppender_missing_plugin_state_location;
+ //public static String PluginFileAppender_missing_plugin_state_location;
public static String PluginLogAppender_missing_layout_for_appender;
- public static String EntityPropertySource_identifier;
- public static String EntityPropertySource_properties;
- public static String DynamicSQLPreviewView_caused_by;
- public static String DynamicSQLPreviewView_manipulation_of;
+ //public static String EntityPropertySource_identifier;
+ //public static String EntityPropertySource_properties;
+ //public static String DynamicSQLPreviewView_caused_by;
+ //public static String DynamicSQLPreviewView_manipulation_of;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, ConsoleMessages.class);
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleQueryParameter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleQueryParameter.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleQueryParameter.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,166 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.console;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Currency;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.TimeZone;
-
-import org.hibernate.console.stubs.HibernateStub;
-import org.hibernate.console.stubs.NullableTypeStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.TypeStub;
-
-
-public class ConsoleQueryParameter {
-
- static private final Object NULL_MARKER = null; //new Object() { public String toString() { return "[null]"; } };
-
- static final Map<TypeStub, String> typeFormats = new HashMap<TypeStub, String>();
- static {
- addTypeFormat(HibernateStub.BOOLEAN, Boolean.TRUE );
- addTypeFormat(HibernateStub.BYTE, Byte.valueOf((byte) 42));
- addTypeFormat(HibernateStub.BIG_INTEGER, BigInteger.valueOf(42));
- addTypeFormat(HibernateStub.SHORT, Short.valueOf((short) 42));
- addTypeFormat(HibernateStub.CALENDAR, new GregorianCalendar());
- addTypeFormat(HibernateStub.CALENDAR_DATE, new GregorianCalendar());
- addTypeFormat(HibernateStub.INTEGER, Integer.valueOf(42));
- addTypeFormat(HibernateStub.INTEGER, Integer.valueOf(42));
- addTypeFormat(HibernateStub.BIG_DECIMAL, new BigDecimal(42.0));
- addTypeFormat(HibernateStub.CHARACTER, Character.valueOf('h'));
- addTypeFormat(HibernateStub.CLASS, TableStub.class);
- addTypeFormat(HibernateStub.CURRENCY, Currency.getInstance(Locale.getDefault()));
- addTypeFormat(HibernateStub.DATE, new Date());
- addTypeFormat(HibernateStub.DOUBLE, Double.valueOf(42.42));
- addTypeFormat(HibernateStub.FLOAT, Float.valueOf((float)42.42));
- addTypeFormat(HibernateStub.LOCALE, Locale.getDefault());
- addTypeFormat(HibernateStub.LONG, Long.valueOf(42));
- addTypeFormat(HibernateStub.STRING, "a string"); //$NON-NLS-1$
- addTypeFormat(HibernateStub.TEXT, "a text"); //$NON-NLS-1$
- addTypeFormat(HibernateStub.TIME, new Date());
- addTypeFormat(HibernateStub.TIMESTAMP, new Date());
- addTypeFormat(HibernateStub.TIMEZONE, TimeZone.getDefault());
- addTypeFormat(HibernateStub.TRUE_FALSE, Boolean.TRUE);
- addTypeFormat(HibernateStub.YES_NO, Boolean.TRUE);
- }
-
-
- private static void addTypeFormat(NullableTypeStub nullableType, Object value) {
- typeFormats.put(nullableType, nullableType.toString(value));
- }
- String name;
- NullableTypeStub type;
- Object value;
-
- public ConsoleQueryParameter(ConsoleQueryParameter cqp) {
- name = cqp.name;
- type = cqp.type;
- value = cqp.value;
- }
-
- public ConsoleQueryParameter() {
-
- }
-
- public ConsoleQueryParameter(String name, NullableTypeStub type, Object value) {
- this.name = name;
- this.type = type;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public NullableTypeStub getType() {
- return type;
- }
-
- public void setType(NullableTypeStub type) {
- this.type = type;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- //if(value == null) { throw new IllegalArgumentException("Value must not be set to null"); }
- this.value = value;
- }
-
- public String getValueAsString() {
- if(isNull()) return ""; //$NON-NLS-1$
- return type.toString(getValue());
- }
-
- public void setValueFromString(String value) {
- try {
- Object object = type.fromStringValue(value);
- setValue(object);
- } catch(Exception he) {
- setNull();
- }
- }
-
-
- public String getDefaultFormat() {
- if(type!=null) {
- Object object = typeFormats.get(type);
- if(object!=null) {
- return object.toString();
- }
- }
- return "<unknown>"; //$NON-NLS-1$
- }
-
- public static Set<TypeStub> getPossibleTypes() {
- return typeFormats.keySet();
- }
-
- public void setNull() {
- setValue( NULL_MARKER );
- }
-
- public boolean isNull() {
- return getValue()==NULL_MARKER;
- }
-
- public Object getValueForQuery() {
- if(isNull()) {
- return null;
- } else {
- return getValue();
- }
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeDelegatingDriver.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeDelegatingDriver.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeDelegatingDriver.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.console;
-
-import java.sql.Connection;
-import java.sql.Driver;
-import java.sql.DriverPropertyInfo;
-import java.sql.SQLException;
-import java.util.Properties;
-
-public class FakeDelegatingDriver implements Driver {
- private Driver driver;
-
- public FakeDelegatingDriver(Driver d) {
- this.driver = d;
- }
- public boolean acceptsURL(String u) throws SQLException {
- return this.driver.acceptsURL(u);
- }
- public Connection connect(String u, Properties p) throws SQLException {
- return this.driver.connect(u, p);
- }
- public int getMajorVersion() {
- return this.driver.getMajorVersion();
- }
- public int getMinorVersion() {
- return this.driver.getMinorVersion();
- }
- public DriverPropertyInfo[] getPropertyInfo(String u, Properties p)
- throws SQLException {
- return this.driver.getPropertyInfo(u, p);
- }
- public boolean jdbcCompliant() {
- return this.driver.jdbcCompliant();
- }
-}
\ No newline at end of file
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeTransactionManagerLookup.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeTransactionManagerLookup.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/FakeTransactionManagerLookup.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,236 +0,0 @@
-package org.hibernate.console;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.InvalidTransactionException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.XAResource;
-
-import org.hibernate.HibernateException;
-import org.hibernate.connection.ConnectionProvider;
-import org.hibernate.connection.ConnectionProviderFactory;
-import org.hibernate.transaction.TransactionManagerLookup;
-
-public class FakeTransactionManagerLookup implements TransactionManagerLookup {
-
- public TransactionManager getTransactionManager(Properties props)
- throws HibernateException {
- if ( FakeTransactionManager.INSTANCE == null ) {
- FakeTransactionManager.INSTANCE = new FakeTransactionManager(props);
- }
- return FakeTransactionManager.INSTANCE;
- }
-
- public String getUserTransactionName() {
- return null; //throw new UnsupportedOperationException();
- }
-
- public Object getTransactionIdentifier(Transaction transaction) {
- return transaction;
- }
-
-}
-
-class FakeTransactionManager implements TransactionManager {
-
- public static FakeTransactionManager INSTANCE;
-
- private FakeTransaction current;
- ConnectionProvider connections;
-
- public FakeTransactionManager(Properties props) {
- connections = ConnectionProviderFactory.newConnectionProvider();
- }
-
- public void begin() throws NotSupportedException, SystemException {
- current = new FakeTransaction(this);
- current.begin();
- }
-
- public void commit() throws RollbackException, HeuristicMixedException,
- HeuristicRollbackException, SecurityException,
- IllegalStateException, SystemException {
- if(current!=null) current.commit();
- }
-
-
- public int getStatus() throws SystemException {
- if(current!=null) {
- return current.getStatus();
- } else {
- return Status.STATUS_NO_TRANSACTION;
- }
- }
-
- public Transaction getTransaction() throws SystemException {
- return current;
- }
-
- public void resume(Transaction tx) throws InvalidTransactionException,
- IllegalStateException, SystemException {
- current = (FakeTransaction) tx;
- }
-
- public void rollback() throws IllegalStateException, SecurityException,
- SystemException {
- if(current!=null) current.rollback();
- }
-
- public void setRollbackOnly() throws IllegalStateException, SystemException {
- if(current!=null) current.setRollbackOnly();
- }
-
- public void setTransactionTimeout(int t) throws SystemException {
- }
-
- public Transaction suspend() throws SystemException {
- Transaction result = current;
- current = null;
- return result;
- }
-
- public FakeTransaction getCurrent() {
- return current;
- }
-
- void endCurrent(FakeTransaction tx) {
- if (current==tx) current=null;
- }
-
-}
-
-class FakeTransaction implements Transaction {
-
- int status;
- private Connection connection;
- List<Synchronization> synchronizations = new ArrayList<Synchronization>();
- private FakeTransactionManager transactionManager;
-
- FakeTransaction(FakeTransactionManager transactionManager) {
- status = Status.STATUS_NO_TRANSACTION;
- this.transactionManager = transactionManager;
- }
-
- public void begin() throws SystemException {
- try {
- connection = transactionManager.connections.getConnection();
- }
- catch (SQLException sqle) {
-
- sqle.printStackTrace();
- throw new SystemException(sqle.toString());
- }
- status = Status.STATUS_ACTIVE;
- }
-
- public void commit() throws RollbackException, HeuristicMixedException,
- HeuristicRollbackException, SecurityException,
- IllegalStateException, SystemException {
-
- if (status == Status.STATUS_MARKED_ROLLBACK) {
- rollback();
- }
- else {
- status = Status.STATUS_PREPARING;
-
- for (Synchronization s : synchronizations) {
- s.beforeCompletion();
- }
-
- status = Status.STATUS_COMMITTING;
-
- try {
- connection.commit();
- connection.close();
- }
- catch (SQLException sqle) {
- status = Status.STATUS_UNKNOWN;
- throw new SystemException();
- }
-
- status = Status.STATUS_COMMITTED;
-
- for (Synchronization s : synchronizations) {
- s.afterCompletion(status);
- }
-
- //status = Status.STATUS_NO_TRANSACTION;
- transactionManager.endCurrent(this);
- }
-
- }
-
- public boolean delistResource(XAResource arg0, int arg1)
- throws IllegalStateException, SystemException {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean enlistResource(XAResource arg0) throws RollbackException,
- IllegalStateException, SystemException {
- // TODO Auto-generated method stub
- return false;
- }
-
- public int getStatus() throws SystemException {
- return status;
- }
-
- public void registerSynchronization(Synchronization sync)
- throws RollbackException, IllegalStateException, SystemException {
- synchronizations.add(sync);
- }
-
- public void rollback() throws IllegalStateException, SystemException {
-
- status = Status.STATUS_ROLLING_BACK;
-
-// Synch.beforeCompletion() should *not* be called for rollbacks
-// for ( int i=0; i<synchronizations.size(); i++ ) {
-// Synchronization s = (Synchronization) synchronizations.get(i);
-// s.beforeCompletion();
-// }
-
- status = Status.STATUS_ROLLEDBACK;
-
- try {
- connection.rollback();
- connection.close();
- }
- catch (SQLException sqle) {
- status = Status.STATUS_UNKNOWN;
- throw new SystemException();
- }
-
- for (Synchronization s : synchronizations) {
- s.afterCompletion(status);
- }
-
- //status = Status.STATUS_NO_TRANSACTION;
- transactionManager.endCurrent(this);
- }
-
- public void setRollbackOnly() throws IllegalStateException, SystemException {
- status = Status.STATUS_MARKED_ROLLBACK;
- }
-
- void setConnection(Connection connection) {
- this.connection = connection;
- }
-
- public Connection getConnection() {
- return connection;
- }
-}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -25,7 +25,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.hibernate.console.stubs.SessionStub;
+import org.hibernate.mediator.QueryInputModel;
+import org.hibernate.mediator.stubs.SessionStub;
public class HQLQueryPage extends AbstractQueryPage {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -25,7 +25,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.hibernate.console.stubs.SessionStub;
+import org.hibernate.mediator.QueryInputModel;
+import org.hibernate.mediator.stubs.SessionStub;
/**
* @author MAX
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -52,7 +52,8 @@
import org.eclipse.ui.console.MessageConsoleStream;
import org.hibernate.console.node.BaseNode;
import org.hibernate.console.node.ConfigurationListNode;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.ConsoleQueryParameter;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryInputModel.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryInputModel.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryInputModel.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,167 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.console;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Observable;
-import java.util.Set;
-
-import org.hibernate.console.stubs.HibernateStub;
-
-/**
- * Class for managing misc parameters and other inputs to a Query, Criteria etc.
- *
- * Currently only holds parameters.
- *
- * @author Max Rydahl Andersen
- *
- */
-public class QueryInputModel extends Observable {
-
- List<ConsoleQueryParameter> parameters;
- boolean ignoreParameters = false;
-
- private Integer maxResults;
-
- public QueryInputModel() {
- parameters = new ArrayList<ConsoleQueryParameter>();
- }
-
- public int getParameterCount() {
- return parameters.size();
- }
-
- public ConsoleQueryParameter[] getQueryParameters() {
- return parameters.toArray(new ConsoleQueryParameter[parameters.size()]);
- }
-
- /** return a copy of the parameters currently in this model */
- public ConsoleQueryParameter[] getQueryParametersForQuery() {
- //pass 0-size array to guarantee Collection.toArray(T[]) will return new Array instance
- return ignoreParameters ? new ConsoleQueryParameter[0]
- : parameters.toArray(new ConsoleQueryParameter[0]);
- }
-
- public QueryInputModel getCopyForQuery() {
- QueryInputModel result = new QueryInputModel();
-
- ConsoleQueryParameter[] queryParametersForQuery = getQueryParametersForQuery();
- result.parameters = Arrays.asList( queryParametersForQuery );
-
- result.maxResults = getMaxResults();
- result.ignoreParameters = ignoreParameters;
-
- return result;
- }
-
- public void addParameter(ConsoleQueryParameter cqp) {
- parameters.add(cqp);
- setChanged();
- notifyObservers("addParameter"); //$NON-NLS-1$
- }
-
- public void removeParameter(ConsoleQueryParameter cqp) {
- parameters.remove(cqp);
- setChanged();
- notifyObservers("removeParameter"); //$NON-NLS-1$
- }
-
- public void moveUp(ConsoleQueryParameter cqp) {
- move(cqp, 1, parameters);
- }
-
- public void moveDown(ConsoleQueryParameter cqp) {
- move(cqp, 1, parameters);
- }
-
- protected <T> void move(T tf, int shift, List<T> list) {
- int i = list.indexOf(tf);
-
- if(i>=0) {
- if(i+shift<list.size() && i+shift>=0) {
- list.remove(i);
- list.add(i+shift, tf);
- }
- }
- setChanged();
- notifyObservers("move"); //$NON-NLS-1$
- }
-
- /** create a parameter which does not collide with any other parameter */
- public ConsoleQueryParameter createUniqueParameter(String paramName) {
- if(parameters.isEmpty()) {
- return new ConsoleQueryParameter(paramName, HibernateStub.STRING, ""); //$NON-NLS-1$
- } else {
- ConsoleQueryParameter cqp = parameters.get(parameters.size()-1);
- ConsoleQueryParameter c = new ConsoleQueryParameter(cqp);
- c.setName(makeUnique(parameters.iterator(), paramName));
- return c;
- }
- }
-
- private static String makeUnique(Iterator<ConsoleQueryParameter> items, String originalPropertyName) {
- int cnt = 0;
- String propertyName = originalPropertyName;
- Set<String> uniqueNames = new HashSet<String>();
-
- while ( items.hasNext() ) {
- ConsoleQueryParameter element = items.next();
- uniqueNames.add( element.getName() );
- }
-
- while( uniqueNames.contains(propertyName) ) {
- cnt++;
- propertyName = originalPropertyName + "-" + cnt; //$NON-NLS-1$
- }
-
- return propertyName;
- }
-
-
- public void setIgnoreParameters(boolean ignoreParameters) {
- this.ignoreParameters = ignoreParameters;
- setChanged();
- notifyObservers();
- }
-
- public boolean ignoreParameters() {
- return ignoreParameters;
- }
-
- public void clear() {
- parameters.clear();
- setChanged();
- notifyObservers("clear"); //$NON-NLS-1$
- }
-
- public void setMaxResults(Integer maxResults) {
- this.maxResults = maxResults;
- }
-
- public Integer getMaxResults() {
- return maxResults;
- }
-}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -24,7 +24,8 @@
import java.beans.PropertyChangeListener;
import java.util.List;
-import org.hibernate.console.stubs.SessionStub;
+import org.hibernate.mediator.QueryInputModel;
+import org.hibernate.mediator.stubs.SessionStub;
/**
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPageModel.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPageModel.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPageModel.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -36,6 +36,8 @@
*/
public class QueryPageModel extends AbstractListModel {
+ private static final long serialVersionUID = 3705805796946900733L;
+
List<QueryPage> pages = new ArrayList<QueryPage>();
public int getSize() {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/BaseNode.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -30,8 +30,8 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.execution.ExecutionContext;
-import org.hibernate.console.execution.ExecutionContextHolder;
+import org.hibernate.mediator.execution.ExecutionContext;
+import org.hibernate.mediator.execution.ExecutionContextHolder;
/**
* @author MAX
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ClassNode.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ClassNode.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ClassNode.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -26,11 +26,11 @@
import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.ClassMetadataStub;
-import org.hibernate.console.stubs.CollectionTypeStub;
-import org.hibernate.console.stubs.EntityModeStub;
-import org.hibernate.console.stubs.HibernateStub;
-import org.hibernate.console.stubs.TypeStub;
+import org.hibernate.mediator.stubs.ClassMetadataStub;
+import org.hibernate.mediator.stubs.CollectionTypeStub;
+import org.hibernate.mediator.stubs.EntityModeStub;
+import org.hibernate.mediator.stubs.HibernateStub;
+import org.hibernate.mediator.stubs.TypeStub;
/**
* @author MAX
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/IdentifierNode.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/IdentifierNode.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/IdentifierNode.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -22,7 +22,7 @@
package org.hibernate.console.node;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.ClassMetadataStub;
+import org.hibernate.mediator.stubs.ClassMetadataStub;
/**
* @author MAX
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -28,13 +28,13 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.stubs.ClassMetadataStub;
-import org.hibernate.console.stubs.CollectionMetadataStub;
-import org.hibernate.console.stubs.CollectionTypeStub;
-import org.hibernate.console.stubs.EntityTypeStub;
-import org.hibernate.console.stubs.SessionStub;
-import org.hibernate.console.stubs.TableStub;
-import org.hibernate.console.stubs.TypeStub;
+import org.hibernate.mediator.stubs.ClassMetadataStub;
+import org.hibernate.mediator.stubs.CollectionMetadataStub;
+import org.hibernate.mediator.stubs.CollectionTypeStub;
+import org.hibernate.mediator.stubs.EntityTypeStub;
+import org.hibernate.mediator.stubs.SessionStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.TypeStub;
/**
* @author MAX
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PersistentCollectionNode.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -27,11 +27,11 @@
import javax.swing.tree.TreeNode;
import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.stubs.ClassMetadataStub;
-import org.hibernate.console.stubs.CollectionMetadataStub;
-import org.hibernate.console.stubs.CollectionTypeStub;
-import org.hibernate.console.stubs.EntityModeStub;
-import org.hibernate.console.stubs.TypeStub;
+import org.hibernate.mediator.stubs.ClassMetadataStub;
+import org.hibernate.mediator.stubs.CollectionMetadataStub;
+import org.hibernate.mediator.stubs.CollectionTypeStub;
+import org.hibernate.mediator.stubs.EntityModeStub;
+import org.hibernate.mediator.stubs.TypeStub;
/**
* @author MAX
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PropertyNode.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PropertyNode.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/PropertyNode.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -21,8 +21,8 @@
*/
package org.hibernate.console.node;
-import org.hibernate.console.stubs.ClassMetadataStub;
-import org.hibernate.console.stubs.EntityModeStub;
+import org.hibernate.mediator.stubs.ClassMetadataStub;
+import org.hibernate.mediator.stubs.EntityModeStub;
public class PropertyNode extends TypeNode {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ProxyFactory.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -30,8 +30,8 @@
import net.sf.cglib.proxy.MethodProxy;
import net.sf.cglib.proxy.NoOp;
-import org.hibernate.console.execution.ExecutionContext;
-import org.hibernate.console.execution.ExecutionContextHolder;
+import org.hibernate.mediator.execution.ExecutionContext;
+import org.hibernate.mediator.execution.ExecutionContextHolder;
public class ProxyFactory {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/TableNode.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/TableNode.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/TableNode.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -21,7 +21,7 @@
*/
package org.hibernate.console.node;
-import org.hibernate.console.stubs.TableStub;
+import org.hibernate.mediator.stubs.TableStub;
public class TableNode extends BaseNode {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/TypeNode.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/TypeNode.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/TypeNode.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -21,8 +21,8 @@
*/
package org.hibernate.console.node;
-import org.hibernate.console.stubs.ClassMetadataStub;
-import org.hibernate.console.stubs.TypeStub;
+import org.hibernate.mediator.stubs.ClassMetadataStub;
+import org.hibernate.mediator.stubs.TypeStub;
/**
* @author MAX
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/AbstractConsoleConfigurationPreferences.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -27,8 +27,9 @@
import java.util.Properties;
import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
-import org.hibernate.console.stubs.util.StringHelper;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.stubs.util.StringHelper;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/ConsoleConfigurationPreferences.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,135 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.console.preferences;
-
-import java.io.File;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import org.w3c.dom.Element;
-
-/**
- * @author max
- *
- */
-public interface ConsoleConfigurationPreferences {
-
- static final String PATH_TAG = "path"; //$NON-NLS-1$
- static final String CLASSPATH_TAG = "classpath"; //$NON-NLS-1$
- static final String MAPPING_TAG = "mapping"; //$NON-NLS-1$
- static final String MAPPINGS_TAG = "mappings"; //$NON-NLS-1$
- static final String HIBERNATE_PROPERTIES_TAG = "hibernate-properties"; //$NON-NLS-1$
- static final String LOCATION_ATTRIB = "location"; //$NON-NLS-1$
- static final String HIBERNATE_CONFIG_XML_TAG = "hibernate-config-xml"; //$NON-NLS-1$
- static final String NAME_ATTRIB = "name"; //$NON-NLS-1$
- static final String CONFIGURATION_TAG = "configuration"; //$NON-NLS-1$
- static final String ANNOTATIONS_ATTRIB = "annotations"; //$NON-NLS-1$
- static final String ENTITYRESOLVER_ATTRIB = "entityresolver"; //$NON-NLS-1$
- static final String CONFIGURATION_MODE_ATTRIB = "configuration-factory"; //$NON-NLS-1$
-
- // TODO: we should move this to some classhandler
- static public class ConfigurationMode implements Serializable {
-
- private static final Map<String, ConfigurationMode> INSTANCES = new HashMap<String, ConfigurationMode>();
-
- public static final ConfigurationMode CORE = new ConfigurationMode( "CORE" ); //$NON-NLS-1$
- public static final ConfigurationMode ANNOTATIONS = new ConfigurationMode( "ANNOTATIONS" ); //$NON-NLS-1$
- public static final ConfigurationMode JPA = new ConfigurationMode( "JPA" ); //$NON-NLS-1$
-
- static {
- INSTANCES.put( CORE.name, CORE );
- INSTANCES.put( ANNOTATIONS.name, ANNOTATIONS );
- INSTANCES.put( JPA.name, JPA );
- }
-
- private final String name;
-
- public ConfigurationMode(String name) {
- this.name = name;
- }
-
- public String toString() {
- return name;
- }
-
- private Object readResolve() {
- return INSTANCES.get( name );
- }
-
- public static ConfigurationMode parse(String name) {
- ConfigurationMode rtn = INSTANCES.get( name );
- if ( rtn == null ) {
- // default is POJO
- rtn = CORE;
- }
- return rtn;
- }
-
- public static String[] values(){
- return INSTANCES.keySet().toArray(new String[INSTANCES.size()]);
- }
- }
-
-
- public abstract ConfigurationMode getConfigurationMode();
-
- public abstract String getName();
-
- /**
- * @return return non-null array of URLs for a customclasspath
- */
- public abstract URL[] getCustomClassPathURLS();
-
- /**
- * @return return non-null array of URLs for mapping files
- */
- public abstract File[] getMappingFiles();
-
- public abstract Properties getProperties();
-
- public abstract File getConfigXMLFile();
-
- public abstract File getPropertyFile();
-
- public abstract void writeStateTo(Element node);
-
- public abstract void readStateFrom(Element element);
-
- public abstract void setName(String name);
-
- public abstract String getEntityResolverName();
-
- public abstract String getPersistenceUnitName();
-
- public abstract String getNamingStrategy();
-
- /**
- *
- * @return null if ConnectionProfile was not specified
- */
- public abstract String getConnectionProfileName();
-
- public abstract String getDialectName();
-}
\ No newline at end of file
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/StandAloneConsoleConfigurationPreferences.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/StandAloneConsoleConfigurationPreferences.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/preferences/StandAloneConsoleConfigurationPreferences.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -31,7 +31,7 @@
import javax.xml.parsers.ParserConfigurationException;
import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/AbstractTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/AbstractTypeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/AbstractTypeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,12 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.type.AbstractType;
-
-public class AbstractTypeStub extends TypeStub {
- protected AbstractType abstractType;
-
- protected AbstractTypeStub(Object abstractType) {
- super(abstractType);
- this.abstractType = (AbstractType)abstractType;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/AnyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/AnyStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/AnyStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,13 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.Any;
-
-public class AnyStub extends SimpleValueStub {
- protected Any any;
-
- protected AnyStub(Object any) {
- super(any);
- this.any = (Any)any;
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ArrayStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ArrayStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ArrayStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,36 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.Array;
-
-public class ArrayStub extends ListStub {
- protected Array array;
-
- protected ArrayStub(Object array) {
- super(array);
- this.array = (Array)array;
- }
-
- public static ArrayStub newInstance(PersistentClassStub owner) {
- return new ArrayStub(new Array(owner.persistentClass));
- }
-
- public void setElement(ValueStub element) {
- array.setElement(element.value);
- }
-
- public void setCollectionTable(TableStub table) {
- array.setCollectionTable(table.table);
- }
-
- public void setElementClassName(String elementClassName) {
- array.setElementClassName(elementClassName);
- }
-
- public void setIndex(ValueStub index) {
- array.setIndex(index.value);
- }
-
- public String getElementClassName() {
- return array.getElementClassName();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/BagStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/BagStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/BagStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,21 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.Bag;
-
-public class BagStub extends CollectionStub {
- protected Bag bag;
-
- protected BagStub(Object bag) {
- super(bag);
- this.bag = (Bag)bag;
- }
-
- public static BagStub newInstance(PersistentClassStub owner) {
- return new BagStub(new Bag(owner.persistentClass));
- }
-
- @Override
- public Object accept(ValueVisitorStub visitor) {
- return visitor.accept(this);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/Cfg2HbmToolStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/Cfg2HbmToolStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/Cfg2HbmToolStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,23 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.tool.hbm2x.Cfg2HbmTool;
-
-public class Cfg2HbmToolStub {
- protected Cfg2HbmTool cfg2HbmTool;
-
- protected Cfg2HbmToolStub(Object cfg2HbmTool) {
- this.cfg2HbmTool = (Cfg2HbmTool)cfg2HbmTool;
- }
-
- public static Cfg2HbmToolStub newInstance() {
- return new Cfg2HbmToolStub(new Cfg2HbmTool());
- }
-
- public String getTag(PersistentClassStub persistentClass) {
- return cfg2HbmTool.getTag(persistentClass.persistentClass);
- }
-
- public String getTag(PropertyStub property) {
- return cfg2HbmTool.getTag(property.property);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ClassMetadataStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ClassMetadataStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ClassMetadataStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,46 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.metadata.ClassMetadata;
-import org.hibernate.type.Type;
-
-public class ClassMetadataStub {
- protected ClassMetadata classMetadata;
-
- protected ClassMetadataStub(Object classMetadata) {
- this.classMetadata = (ClassMetadata)classMetadata;
- }
-
- public String[] getPropertyNames() {
- return classMetadata.getPropertyNames();
- }
-
- public TypeStub[] getPropertyTypes() {
- Type[] types = classMetadata.getPropertyTypes();
- TypeStub[] res = new TypeStub[types.length];
- for (int i = 0; i < types.length; i++) {
- res[i] = TypeStubFactory.createTypeStub(types[i]);
- }
- return res;
- }
-
- public String getIdentifierPropertyName() {
- return classMetadata.getIdentifierPropertyName();
- }
-
- public Object getPropertyValue(Object baseObject, String name, EntityModeStub pojo) {
- return classMetadata.getPropertyValue(baseObject, name, pojo.entityMode);
- }
-
- public String getEntityName() {
- return classMetadata.getEntityName();
- }
-
- public TypeStub getIdentifierType() {
- return TypeStubFactory.createTypeStub(classMetadata.getIdentifierType());
- }
-
- public Class getMappedClass(EntityModeStub pojo) {
- return classMetadata.getMappedClass(pojo.entityMode);
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionMetadataStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionMetadataStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionMetadataStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,15 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.metadata.CollectionMetadata;
-
-public class CollectionMetadataStub {
- protected CollectionMetadata collectionMetadata;
-
- protected CollectionMetadataStub(Object collectionMetadata) {
- this.collectionMetadata = (CollectionMetadata)collectionMetadata;
- }
-
- public TypeStub getElementType() {
- return TypeStubFactory.createTypeStub(collectionMetadata.getElementType());
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,65 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.FetchMode;
-import org.hibernate.mapping.Collection;
-
-public abstract class CollectionStub extends ValueStub {
-
- protected Collection collection;
-
- protected CollectionStub(Object collection) {
- super(collection);
- this.collection = (Collection)collection;
- }
-
- public void setCollectionTable(TableStub table) {
- collection.setCollectionTable(table.table);
- }
-
- public void setKey(KeyValueStub key) {
- collection.setKey(key.keyValue);
- }
-
- public void setLazy(boolean lazy) {
- collection.setLazy(lazy);
- }
-
- public void setRole(String role) {
- collection.setRole(role);
- }
-
- public void setElement(ValueStub element) {
- collection.setElement(element.value);
- }
-
- public void setFetchMode(FetchModeStub fetchMode) {
- if (FetchModeStub.DEFAULT.equals(fetchMode)) {
- collection.setFetchMode(FetchMode.DEFAULT);
- } else if (FetchModeStub.SELECT.equals(fetchMode)) {
- collection.setFetchMode(FetchMode.SELECT);
- } else if (FetchModeStub.JOIN.equals(fetchMode)) {
- collection.setFetchMode(FetchMode.JOIN);
- } else if (FetchModeStub.SUBSELECT.equals(fetchMode)) {
- }
- }
-
- public ValueStub getElement() {
- return ValueStubFactory.createValueStub(collection.getElement());
- }
-
- public TableStub getCollectionTable() {
- return new TableStub(collection.getCollectionTable());
- }
-
- public KeyValueStub getKey() {
- return (KeyValueStub)ValueStubFactory.createValueStub(collection.getKey());
- }
-
- public boolean isOneToMany() {
- return collection.isOneToMany();
- }
-
- public boolean isInverse() {
- return collection.isInverse();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionTypeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/CollectionTypeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,22 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.type.CollectionType;
-
-public class CollectionTypeStub extends AbstractTypeStub {
-
- protected CollectionType collectionType;
-
- protected CollectionTypeStub(Object collectionType) {
- super(collectionType);
- this.collectionType = (CollectionType)collectionType;
- }
-
- public String getRole() {
- return collectionType.getRole();
- }
-
- public boolean isArrayType() {
- return collectionType.isArrayType();
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ColumnStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ColumnStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ColumnStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,68 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.Column;
-
-public class ColumnStub {
- public static final int DEFAULT_LENGTH = 255;
- public static final int DEFAULT_PRECISION = 19;
- public static final int DEFAULT_SCALE = 2;
-
- protected Column column;
-
- protected ColumnStub(Object column) {
- this.column = (Column)column;
- }
-
- public static ColumnStub newInstance() {
- return new ColumnStub(new Column());
- }
-
- public static ColumnStub newInstance(String columnName) {
- return new ColumnStub(new Column(columnName));
- }
-
- public String getSqlType() {
- return column.getSqlType();
- }
-
- public void setSqlType(String sqlType) {
- column.setSqlType(sqlType);
- }
-
- public String getSqlType(DialectStub dialect, MappingStub mapping) {
- return column.getSqlType(dialect.dialect, mapping.mapping);
- }
-
- public ValueStub getValue() {
- return ValueStubFactory.createValueStub(column.getValue());
- }
-
- public String getName() {
- return column.getName();
- }
-
- public boolean isNullable() {
- return column.isNullable();
- }
-
- public boolean isUnique() {
- return column.isUnique();
- }
-
- public Integer getSqlTypeCode() {
- return column.getSqlTypeCode();
- }
-
- public int getLength() {
- return column.getLength();
- }
-
- public int getPrecision() {
- return column.getPrecision();
- }
-
- public int getScale() {
- return column.getScale();
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ComponentStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ComponentStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ComponentStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,42 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.hibernate.mapping.Component;
-import org.hibernate.mapping.Property;
-
-public class ComponentStub extends SimpleValueStub {
- protected Component component;
-
- protected ComponentStub(Object component) {
- super(component);
- this.component = (Component)component;
- }
-
- public String getComponentClassName() {
- return component.getComponentClassName();
- }
-
- public PersistentClassStub getOwner() {
- return PersistentClassStubFactory.createPersistentClassStub(component.getOwner());
- }
-
- public String getParentProperty() {
- return component.getParentProperty();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<PropertyStub> getPropertyIterator() {
- Iterator<Property> it = (Iterator<Property>)component.getPropertyIterator();
- ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
- while (it.hasNext()) {
- al.add(new PropertyStub(it.next()));
- }
- return al.iterator();
- }
-
- public boolean isEmbedded() {
- return component.isEmbedded();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,199 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.io.File;
-import java.sql.Driver;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import org.eclipse.osgi.util.NLS;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.FakeDelegatingDriver;
-import org.hibernate.console.stubs.util.ReflectHelper;
-import org.hibernate.mapping.PersistentClass;
-import org.hibernate.tool.hbm2ddl.SchemaExport;
-import org.hibernate.tool.hbm2x.Exporter;
-import org.hibernate.tool.hbm2x.HibernateMappingExporter;
-import org.hibernate.tool.hbm2x.pojo.POJOClass;
-import org.hibernate.tool.ide.completion.HQLCodeAssist;
-import org.xml.sax.EntityResolver;
-
-public class ConfigurationStub {
-
- private Map<String, FakeDelegatingDriver> fakeDrivers = new HashMap<String, FakeDelegatingDriver>();
-
- // configuration != null - by default
- protected Configuration configuration;
-
- protected ConfigurationStub(Configuration configuration) {
- //Class.forName(className)
- //Method ReflectionUtils.findPublicMethod(Class declaringClass, "isOpen",
- // new Class[]());
- this.configuration = configuration;
- }
-
- protected Configuration getConfiguration() {
- return configuration;
- }
-
- public void cleanUp() {
- Iterator<FakeDelegatingDriver> it = fakeDrivers.values().iterator();
- while (it.hasNext()) {
- try {
- DriverManager.deregisterDriver(it.next());
- } catch (SQLException e) {
- // ignore
- }
- }
- fakeDrivers.clear();
- }
-
- public void buildMappings() {
- configuration.buildMappings();
- }
-
- // TODO: temporary should be protected and/or SettingsStub?
- public SettingsStub buildSettings() {
- return new SettingsStub(configuration.buildSettings());
- }
-
- protected SessionFactory buildSessionFactory() {
- return configuration.buildSessionFactory();
- }
-
- public EntityResolver getEntityResolver() {
- return configuration.getEntityResolver();
- }
-
- public IHQLCodeAssistStub getHQLCodeAssist() {
- return new IHQLCodeAssistStub(new HQLCodeAssist(configuration));
- }
-
- // TODO: temporary should be protected and/or NamingStrategyStub?
- public NamingStrategyStub getNamingStrategy() {
- return new NamingStrategyStub(configuration.getNamingStrategy());
- }
-
- public boolean hasNamingStrategy() {
- return (configuration.getNamingStrategy() != null);
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<PersistentClassStub> getClassMappings() {
- Iterator<PersistentClass> it = (Iterator<PersistentClass>)configuration.getClassMappings();
- ArrayList<PersistentClassStub> arr = new ArrayList<PersistentClassStub>();
- while (it.hasNext()) {
- arr.add(PersistentClassStubFactory.createPersistentClassStub(it.next()));
- }
- return arr.iterator();
- }
-
- // TODO: temporary should be protected and/or PersistentClassStub?
- public PersistentClassStub getClassMapping(String entityName) {
- return PersistentClassStubFactory.createPersistentClassStub(configuration.getClassMapping(entityName));
- }
-
- // TODO: temporary should be protected and/or MappingsStub?
- public MappingsStub createMappings() {
- return new MappingsStub(configuration.createMappings());
- }
-
- // TODO: temporary should be protected and/or MappingsStub?
- public MappingStub buildMapping() {
- return new MappingStub(configuration.buildMapping());
- }
-
- public static interface IExporterNewOutputDir {
- File getNewOutputDir(POJOClass element, File outputdir4FileNew);
- }
-
- public HibernateMappingExporter createHibernateMappingExporter(File folder2Gen, final IExporterNewOutputDir enod) {
- return new HibernateMappingExporter(configuration, folder2Gen) {
- @SuppressWarnings("unchecked")
- protected void exportPOJO(Map additionalContext, POJOClass element) {
- File outputdir4FileOld = getOutputDirectory();
- File outputdir4FileNew = enod.getNewOutputDir(element, outputdir4FileOld);
- if (!outputdir4FileNew.exists()) {
- outputdir4FileNew.mkdirs();
- }
- setOutputDirectory(outputdir4FileNew);
- super.exportPOJO(additionalContext, element);
- setOutputDirectory(outputdir4FileOld);
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<Throwable> doSchemaExport() {
- SchemaExport export = new SchemaExport(configuration);
- export.create(false, true);
- if (!export.getExceptions().isEmpty()) {
- return (Iterator<Throwable>)export.getExceptions().iterator();
- }
- return null;
- }
-
- public void updateExporter(Exporter exporter) {
- exporter.setConfiguration(configuration);
- }
-
- public Properties getProperties() {
- return configuration.getProperties();
- }
-
- public String getProperty(String propertyName) {
- return configuration.getProperty(propertyName);
- }
-
- /**
- * DriverManager checks what classloader a class is loaded from thus we register a FakeDriver
- * that we know is loaded "properly" which delegates all it class to the real driver. By doing
- * so we can convince DriverManager that we can use any dynamically loaded driver.
- *
- * @param driverClassName
- */
- @SuppressWarnings("unchecked")
- protected void registerFakeDriver(String driverClassName) {
- if (driverClassName != null) {
- try {
- Class<Driver> driverClass = ReflectHelper.classForName(driverClassName);
- if (!fakeDrivers.containsKey(driverClassName)) { // To avoid "double registration"
- FakeDelegatingDriver fakeDelegatingDriver = new FakeDelegatingDriver(
- driverClass.newInstance());
- DriverManager.registerDriver(fakeDelegatingDriver);
- fakeDrivers.put(driverClassName, fakeDelegatingDriver);
- }
- } catch (ClassNotFoundException e) {
- String out = NLS
- .bind(
- ConsoleMessages.ConsoleConfiguration_problems_while_loading_database_driverclass,
- driverClassName);
- throw new HibernateConsoleRuntimeException(out, e);
- } catch (InstantiationException e) {
- String out = NLS
- .bind(
- ConsoleMessages.ConsoleConfiguration_problems_while_loading_database_driverclass,
- driverClassName);
- throw new HibernateConsoleRuntimeException(out, e);
- } catch (IllegalAccessException e) {
- String out = NLS
- .bind(
- ConsoleMessages.ConsoleConfiguration_problems_while_loading_database_driverclass,
- driverClassName);
- throw new HibernateConsoleRuntimeException(out, e);
- } catch (SQLException e) {
- String out = NLS
- .bind(
- ConsoleMessages.ConsoleConfiguration_problems_while_loading_database_driverclass,
- driverClassName);
- throw new HibernateConsoleRuntimeException(out, e);
- }
- }
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubFactory.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubFactory.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,413 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.dom4j.DocumentException;
-import org.dom4j.Node;
-import org.dom4j.io.DOMWriter;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.osgi.util.NLS;
-import org.hibernate.HibernateException;
-import org.hibernate.MappingException;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.hibernate.cfg.JDBCMetaDataConfiguration;
-import org.hibernate.cfg.NamingStrategy;
-import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
-import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
-import org.hibernate.console.stubs.util.ReflectHelper;
-import org.hibernate.console.stubs.util.StringHelper;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.resolver.DialectFactory;
-import org.hibernate.util.ConfigHelper;
-import org.hibernate.util.XMLHelper;
-import org.w3c.dom.Document;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-public class ConfigurationStubFactory {
-
- private ConsoleConfigurationPreferences prefs = null;
-
- public ConfigurationStubFactory(ConsoleConfigurationPreferences prefs) {
- this.prefs = prefs;
- }
-
- public ConfigurationStub createConfiguration() {
- ConfigurationStub res = new ConfigurationStub(new Configuration());
- return res;
- }
-
- public ConfigurationStubJDBCMetaData createConfigurationJDBCMetaData() {
- ConfigurationStubJDBCMetaData res = new ConfigurationStubJDBCMetaData(new JDBCMetaDataConfiguration());
- return res;
- }
-
- public ConfigurationStub createConfiguration(ConfigurationStub cfg, boolean includeMappings) {
- Configuration localCfg = cfg == null ? null : cfg.getConfiguration();
- Properties properties = prefs.getProperties();
- if (properties != null) {
- // to fix: JBIDE-5839 - setup this property: false is default value
- // to make hibernate tools diff hibernate versions compatible
- if (properties.getProperty("hibernate.search.autoregister_listeners") == null) { //$NON-NLS-1$
- properties.setProperty("hibernate.search.autoregister_listeners", "false"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // in case the transaction manager is empty then we need to inject a faketm since
- // hibernate will still try and instantiate it.
- String str = properties.getProperty("hibernate.transaction.manager_lookup_class"); //$NON-NLS-1$
- if (str != null && StringHelper.isEmpty(str)) {
- properties
- .setProperty(
- "hibernate.transaction.manager_lookup_class", "org.hibernate.console.FakeTransactionManagerLookup"); //$NON-NLS-1$ //$NON-NLS-2$
- // properties.setProperty( "hibernate.transaction.factory_class", "");
- }
- }
- if (localCfg == null) {
- localCfg = buildConfiguration(properties, includeMappings);
- } else {
- // Properties origProperties = cfg.getProperties();
- // origProperties.putAll(properties);
- // cfg.setProperties(origProperties);
- // TODO: this is actually only for jdbc reveng...
- // localCfg = configureStandardConfiguration( includeMappings, localCfg, properties );
- }
- // non-running databases + i havent been needed until now...
- // TODO: jpa configuration ?
- if (includeMappings) {
- File[] mappingFiles = prefs.getMappingFiles();
- for (int i = 0; i < mappingFiles.length; i++) {
- File hbm = mappingFiles[i];
- localCfg = localCfg.addFile(hbm);
- }
- }
- // TODO: HBX-
- localCfg.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false"); //$NON-NLS-1$//$NON-NLS-2$
- localCfg.setProperty(Environment.HBM2DDL_AUTO, "false"); //$NON-NLS-1$
- ConfigurationStub res = new ConfigurationStub(localCfg);
- // here both setProperties and configxml have had their chance to tell which databasedriver
- // is needed.
- res.registerFakeDriver(localCfg.getProperty(Environment.DRIVER));
- // autoConfigureDialect(localCfg); Disabled for now since it causes very looong timeouts for
- return res;
- }
-
- private Configuration buildAnnotationConfiguration() throws ClassNotFoundException,
- InstantiationException, IllegalAccessException {
- Class<?> clazz = ReflectHelper
- .classForName("org.hibernate.cfg.AnnotationConfiguration", ConsoleConfiguration.class); //$NON-NLS-1$
- Configuration annotationConfig = (Configuration)clazz.newInstance();
- return annotationConfig;
- }
-
- private Configuration buildJPAConfiguration(String persistenceUnit, Properties properties,
- String entityResolver, boolean includeMappings) {
- if (StringHelper.isEmpty(persistenceUnit)) {
- persistenceUnit = null;
- }
- try {
- Map<Object, Object> overrides = new HashMap<Object, Object>();
- if (properties != null) {
- overrides.putAll(properties);
- }
- if (StringHelper.isNotEmpty(prefs.getNamingStrategy())) {
- overrides.put("hibernate.ejb.naming_strategy", prefs.getNamingStrategy()); //$NON-NLS-1$
- }
- if (StringHelper.isNotEmpty(prefs.getDialectName())) {
- overrides.put("hibernate.dialect", prefs.getDialectName()); //$NON-NLS-1$
- }
- if (!includeMappings) {
- overrides.put("hibernate.archive.autodetection", "none"); //$NON-NLS-1$//$NON-NLS-2$
- }
- Class<?> clazz = ReflectHelper.classForName(
- "org.hibernate.ejb.Ejb3Configuration", ConsoleConfiguration.class); //$NON-NLS-1$
- Object ejb3cfg = clazz.newInstance();
-
- if (StringHelper.isNotEmpty(entityResolver)) {
- Class<?> resolver = ReflectHelper.classForName(entityResolver, this.getClass());
- Object object = resolver.newInstance();
- Method method = clazz.getMethod(
- "setEntityResolver", new Class[] { EntityResolver.class });//$NON-NLS-1$
- method.invoke(ejb3cfg, new Object[] { object });
- }
-
- Method method = clazz.getMethod("configure", new Class[] { String.class, Map.class }); //$NON-NLS-1$
- if (method.invoke(ejb3cfg, new Object[] { persistenceUnit, overrides }) == null) {
- String out = NLS.bind(
- ConsoleMessages.ConsoleConfiguration_persistence_unit_not_found,
- persistenceUnit);
- throw new HibernateConsoleRuntimeException(out, null);
- }
-
- method = clazz.getMethod("getHibernateConfiguration", new Class[0]);//$NON-NLS-1$
- Object obj = method.invoke(ejb3cfg, (Object[]) null);
- Configuration invoke = (Configuration)obj;
- invoke = configureConnectionProfile(invoke);
-
- return invoke;
- } catch (HibernateConsoleRuntimeException he) {
- throw he;
- } catch (Exception e) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_create_jpa_based_configuration,
- e);
- }
- }
-
- private Configuration buildConfiguration(Properties properties, boolean includeMappings) {
- Configuration localCfg = null;
- if (prefs.getConfigurationMode().equals(ConfigurationMode.ANNOTATIONS)) {
- try {
- localCfg = buildAnnotationConfiguration();
- localCfg = configureStandardConfiguration(includeMappings, localCfg, properties);
- } catch (HibernateConsoleRuntimeException he) {
- throw he;
- } catch (Exception e) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_load_annotationconfiguration,
- e);
- }
- } else if (prefs.getConfigurationMode().equals(ConfigurationMode.JPA)) {
- try {
- localCfg = buildJPAConfiguration(prefs.getPersistenceUnitName(), properties, prefs
- .getEntityResolverName(), includeMappings);
- } catch (HibernateConsoleRuntimeException he) {
- throw he;
- } catch (Exception e) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_load_jpa_configuration, e);
- }
- } else {
- localCfg = new Configuration();
- localCfg = configureStandardConfiguration(includeMappings, localCfg, properties);
- }
- return localCfg;
- }
-
- private Configuration configureStandardConfiguration(final boolean includeMappings,
- Configuration localCfg, Properties properties) {
- if (properties != null) {
- localCfg = localCfg.setProperties(properties);
- }
- EntityResolver entityResolver = XMLHelper.DEFAULT_DTD_RESOLVER;
- if (StringHelper.isNotEmpty(prefs.getEntityResolverName())) {
- try {
- entityResolver = (EntityResolver) ReflectHelper.classForName(
- prefs.getEntityResolverName()).newInstance();
- } catch (Exception c) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_configure_entity_resolver
- + prefs.getEntityResolverName(), c);
- }
- }
- localCfg.setEntityResolver(entityResolver);
- if (StringHelper.isNotEmpty(prefs.getNamingStrategy())) {
- try {
- NamingStrategy ns = (NamingStrategy) ReflectHelper.classForName(
- prefs.getNamingStrategy()).newInstance();
- localCfg.setNamingStrategy(ns);
- } catch (Exception c) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_configure_naming_strategy
- + prefs.getNamingStrategy(), c);
- }
- }
- localCfg = loadConfigurationXML(localCfg, includeMappings, entityResolver);
- localCfg = configureConnectionProfile(localCfg);
-
- // replace dialect if it is set in preferences
- if (StringHelper.isNotEmpty(prefs.getDialectName())) {
- localCfg.setProperty("hibernate.dialect", prefs.getDialectName()); //$NON-NLS-1$
- }
-
- return localCfg;
- }
-
- @SuppressWarnings("unchecked")
- private Configuration loadConfigurationXML(Configuration localCfg, boolean includeMappings,
- EntityResolver entityResolver) {
- File configXMLFile = prefs.getConfigXMLFile();
- if (!includeMappings) {
- org.dom4j.Document doc;
- XMLHelper xmlHelper = new XMLHelper();
- InputStream stream = null;
- String resourceName = "<unknown>"; //$NON-NLS-1$
- if (configXMLFile != null) {
- resourceName = configXMLFile.toString();
- try {
- stream = new FileInputStream(configXMLFile);
- } catch (FileNotFoundException e1) {
- throw new HibernateConsoleRuntimeException(
- ConsoleMessages.ConsoleConfiguration_could_not_access + configXMLFile,
- e1);
- }
- } else {
- resourceName = "/hibernate.cfg.xml"; //$NON-NLS-1$
- if (checkHibernateResoureExistence(resourceName)) {
- stream = ConfigHelper.getResourceAsStream(resourceName); // simulate hibernate's
- // default look up
- } else {
- return localCfg;
- }
- }
-
- try {
- List<Throwable> errors = new ArrayList<Throwable>();
-
- doc = xmlHelper.createSAXReader(resourceName, errors, entityResolver).read(
- new InputSource(stream));
- if (errors.size() != 0) {
- throw new MappingException(
- ConsoleMessages.ConsoleConfiguration_invalid_configuration, errors
- .get(0));
- }
-
- List<Node> list = doc.getRootElement()
- .element("session-factory").elements("mapping"); //$NON-NLS-1$ //$NON-NLS-2$
- for (Node element : list) {
- element.getParent().remove(element);
- }
-
- DOMWriter dw = new DOMWriter();
- Document document = dw.write(doc);
- return localCfg.configure(document);
-
- } catch (DocumentException e) {
- throw new HibernateException(
- ConsoleMessages.ConsoleConfiguration_could_not_parse_configuration
- + resourceName, e);
- } finally {
- try {
- if (stream != null)
- stream.close();
- } catch (IOException ioe) {
- // log.warn( "could not close input stream for: " + resourceName, ioe );
- }
- }
- } else {
- if (configXMLFile != null) {
- return localCfg.configure(configXMLFile);
- } else {
- Configuration resultCfg = localCfg;
- if (checkHibernateResoureExistence("/hibernate.cfg.xml")) { //$NON-NLS-1$
- resultCfg = localCfg.configure();
- }
- return resultCfg;
- }
- }
- }
-
- private boolean checkHibernateResoureExistence(String resource) {
- InputStream is = null;
- try {
- is = ConfigHelper.getResourceAsStream(resource);
- } catch (HibernateException e) {
- // just ignore
- } finally {
- try {
- if (is != null)
- is.close();
- } catch (IOException e) {
- // ignore
- }
- }
- return (is != null);
- }
-
- private Configuration configureConnectionProfile(Configuration localCfg) {
- String connectionProfile = prefs.getConnectionProfileName();
- if (connectionProfile == null) {
- return localCfg;
- }
- IConnectionProfile profile = ProfileManager.getInstance().getProfileByName(
- connectionProfile);
- if (profile != null) {
- refreshProfile(profile);
- //
- final Properties invokeProperties = localCfg.getProperties();
- // set this property to null!
- invokeProperties.remove(Environment.DATASOURCE);
- localCfg.setProperties(invokeProperties);
- Properties cpProperties = profile.getProperties(profile.getProviderId());
- // seems we should not setup dialect here
- // String dialect =
- // "org.hibernate.dialect.HSQLDialect";//cpProperties.getProperty("org.eclipse.datatools.connectivity.db.driverClass");
- // invoke.setProperty(Environment.DIALECT, dialect);
- String driver = cpProperties
- .getProperty("org.eclipse.datatools.connectivity.db.driverClass"); //$NON-NLS-1$
- localCfg.setProperty(Environment.DRIVER, driver);
- // TODO:
- @SuppressWarnings("unused")
- String driverJarPath = cpProperties.getProperty("jarList"); //$NON-NLS-1$
- String url = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.URL"); //$NON-NLS-1$
- // url += "/";// +
- // cpProperties.getProperty("org.eclipse.datatools.connectivity.db.databaseName");
- localCfg.setProperty(Environment.URL, url);
- String user = cpProperties
- .getProperty("org.eclipse.datatools.connectivity.db.username"); //$NON-NLS-1$
- if (null != user && user.length() > 0) {
- localCfg.setProperty(Environment.USER, user);
- }
- String pass = cpProperties
- .getProperty("org.eclipse.datatools.connectivity.db.password"); //$NON-NLS-1$
- if (null != pass && pass.length() > 0) {
- localCfg.setProperty(Environment.PASS, pass);
- }
- } else {
- String out = NLS.bind(
- ConsoleMessages.ConsoleConfiguration_connection_profile_not_found,
- connectionProfile);
- throw new HibernateConsoleRuntimeException(out, null);
- }
- return localCfg;
- }
-
- @SuppressWarnings("unused")
- private void autoConfigureDialect(Configuration localCfg) {
- if (localCfg.getProperty(Environment.DIALECT) == null) {
- String url = localCfg.getProperty(Environment.URL);
- String user = localCfg.getProperty(Environment.USER);
- String pass = localCfg.getProperty(Environment.PASS);
- Connection connection = null;
- try {
- connection = DriverManager.getConnection(url, user, pass);
- // SQL Dialect:
- Dialect dialect = DialectFactory.buildDialect(localCfg.getProperties(), connection);
- localCfg.setProperty(Environment.DIALECT, dialect.toString());
- } catch (SQLException e) {
- // can't determine dialect
- }
- if (connection != null) {
- try {
- connection.close();
- } catch (SQLException e) {
- // ignore
- }
- }
- }
- }
-
- public static void refreshProfile(IConnectionProfile profile) {
- // refresh profile (refresh jpa connection):
- // get fresh information about current db structure and update error markers
- if (profile.getConnectionState() == IConnectionProfile.CONNECTED_STATE) {
- profile.disconnect(null);
- }
- profile.connect(null);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubJDBCMetaData.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubJDBCMetaData.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConfigurationStubJDBCMetaData.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,49 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Properties;
-
-import org.hibernate.cfg.JDBCMetaDataConfiguration;
-import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
-
-public class ConfigurationStubJDBCMetaData extends ConfigurationStub {
-
- protected JDBCMetaDataConfiguration jdbcMetaDataConfiguration;
-
- protected ConfigurationStubJDBCMetaData(JDBCMetaDataConfiguration configuration) {
- super(configuration);
- jdbcMetaDataConfiguration = configuration;
- }
-
- public void setProperties(Properties properties) {
- jdbcMetaDataConfiguration.setProperties(properties);
- }
-
- public void setPreferBasicCompositeIds(boolean flag) {
- jdbcMetaDataConfiguration.setPreferBasicCompositeIds(flag);
- }
-
- public void setReverseEngineeringStrategy(ReverseEngineeringStrategy reverseEngineeringStrategy) {
- jdbcMetaDataConfiguration.setReverseEngineeringStrategy(reverseEngineeringStrategy);
- }
-
- public void readFromJDBC() {
- jdbcMetaDataConfiguration.readFromJDBC();
- }
-
- public ArrayList<TableStub> getTableMappingsArr() {
- ArrayList<TableStub> arr = new ArrayList<TableStub>();
- Iterator<?> it = jdbcMetaDataConfiguration.getTableMappings();
- while (it.hasNext() ) {
- Object table = it.next();
- arr.add(new TableStub(table));
- }
- return arr;
- }
-
- public Iterator<TableStub> getTableMappingsIt() {
- return getTableMappingsArr().iterator();
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConnectionProviderStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConnectionProviderStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ConnectionProviderStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,15 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.connection.ConnectionProvider;
-
-public class ConnectionProviderStub {
- protected ConnectionProvider connectionProvider;
-
- protected ConnectionProviderStub(Object connectionProvider) {
- this.connectionProvider = (ConnectionProvider)connectionProvider;
- }
-
- public void close() {
- connectionProvider.close();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DefaultDatabaseCollectorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DefaultDatabaseCollectorStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DefaultDatabaseCollectorStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,39 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.hibernate.cfg.reveng.DefaultDatabaseCollector;
-import org.hibernate.mapping.Table;
-
-public class DefaultDatabaseCollectorStub {
- protected DefaultDatabaseCollector defaultDatabaseCollector;
-
- protected DefaultDatabaseCollectorStub(Object defaultDatabaseCollector) {
- this.defaultDatabaseCollector = (DefaultDatabaseCollector)defaultDatabaseCollector;
- }
-
- public static DefaultDatabaseCollectorStub newInstance() {
- return new DefaultDatabaseCollectorStub(new DefaultDatabaseCollector());
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<Entry<String, List<TableStub>>> getQualifierEntries() {
- Iterator<Map.Entry<String, List<Table>>> it = defaultDatabaseCollector.getQualifierEntries();
- HashMap<String, List<TableStub>> map = new HashMap<String, List<TableStub>>();
- while (it.hasNext()) {
- Map.Entry<String, List<Table>> entry = it.next();
- ArrayList<TableStub> arr = new ArrayList<TableStub>();
- Iterator<Table> itValue = (Iterator<Table>)entry.getValue().iterator();
- while (itValue.hasNext()) {
- arr.add(new TableStub(itValue.next()));
- }
- map.put(entry.getKey(), arr);
- }
- return map.entrySet().iterator();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DependantValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DependantValueStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DependantValueStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,13 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.DependantValue;
-
-public class DependantValueStub extends SimpleValueStub {
- protected DependantValue dependantValue;
-
- protected DependantValueStub(Object dependantValue) {
- super(dependantValue);
- this.dependantValue = (DependantValue)dependantValue;
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DialectStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DialectStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/DialectStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,15 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.dialect.Dialect;
-
-public class DialectStub {
- protected Dialect dialect;
-
- protected DialectStub(Object dialect) {
- this.dialect = (Dialect)dialect;
- }
-
- public static DialectStub newInstance(final String dialectName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
- return new DialectStub(Class.forName(dialectName).newInstance());
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EntityModeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EntityModeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EntityModeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,16 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.EntityMode;
-
-public class EntityModeStub {
-
- public static final EntityModeStub POJO = new EntityModeStub(EntityMode.POJO);
- public static final EntityModeStub DOM4J = new EntityModeStub(EntityMode.DOM4J);
- public static final EntityModeStub MAP = new EntityModeStub(EntityMode.MAP);
-
- protected EntityMode entityMode;
-
- protected EntityModeStub(Object entityMode) {
- this.entityMode = (EntityMode)entityMode;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EntityTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EntityTypeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EntityTypeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,20 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.type.EntityType;
-
-public class EntityTypeStub extends AbstractTypeStub {
- protected EntityType entityType;
-
- protected EntityTypeStub(Object entityType) {
- super(entityType);
- this.entityType = (EntityType)entityType;
- }
-
- public String getAssociatedEntityName() {
- return entityType.getAssociatedEntityName();
- }
-
- public boolean isOneToOne() {
- return entityType.isOneToOne();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EnvironmentStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EnvironmentStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/EnvironmentStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,46 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.hibernate.cfg.Environment;
-
-public class EnvironmentStub {
- public static final String DIALECT = Environment.DIALECT;
- public static final String DEFAULT_CATALOG = Environment.DEFAULT_CATALOG;
- public static final String DEFAULT_SCHEMA = Environment.DEFAULT_SCHEMA;
- public static final String DRIVER = Environment.DRIVER;
- public static final String PASS = Environment.PASS;
- public static final String SESSION_FACTORY_NAME = Environment.SESSION_FACTORY_NAME;
- public static final String URL = Environment.URL;
- public static final String USER = Environment.USER;
-
- @SuppressWarnings("unchecked")
- public static String[] extractHibernateProperties() {
- try {
- // TODO: extract property names from the Environment class in the users hibernate
- // configuration.
- Class cl = Environment.class;
- List<String> names = new ArrayList<String>();
- Field[] fields = cl.getFields();
- for (int i = 0; i < fields.length; i++) {
- Field field = fields[i];
- if (Modifier.isStatic(field.getModifiers()) && field.getType().equals(String.class)) {
- String str = (String) field.get(cl);
- if (str.startsWith("hibernate.")) { //$NON-NLS-1$
- names.add(str);
- }
- }
- }
- String[] propertyNames = (String[]) names.toArray(new String[names.size()]);
- Arrays.sort(propertyNames);
- return propertyNames;
- } catch (IllegalAccessException iae) {
- // ignore
- return new String[0];
- }
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/FetchModeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/FetchModeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/FetchModeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,8 +0,0 @@
-package org.hibernate.console.stubs;
-
-public enum FetchModeStub {
- DEFAULT,
- SELECT,
- JOIN,
- SUBSELECT
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ForeignKeyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ForeignKeyStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ForeignKeyStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,49 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.hibernate.mapping.Column;
-import org.hibernate.mapping.ForeignKey;
-
-public class ForeignKeyStub {
- protected ForeignKey foreignKey;
-
- protected ForeignKeyStub(Object foreignKey) {
- this.foreignKey = (ForeignKey)foreignKey;
- }
-
- public boolean containsColumn(ColumnStub column) {
- return foreignKey.containsColumn(column.column);
- }
-
- public TableStub getReferencedTable() {
- return new TableStub(foreignKey.getReferencedTable());
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<ColumnStub> columnIterator() {
- Iterator<Column> it = (Iterator<Column>)foreignKey.getColumnIterator();
- ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
- while (it.hasNext()) {
- al.add(new ColumnStub(it.next()));
- }
- return al.iterator();
- }
-
- @SuppressWarnings("unchecked")
- public List<ColumnStub> getReferencedColumns() {
- Iterator<Column> it = foreignKey.getReferencedColumns().iterator();
- ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
- while (it.hasNext()) {
- al.add(new ColumnStub(it.next()));
- }
- return al;
- }
-
- public boolean isReferenceToPrimaryKey() {
- return foreignKey.isReferenceToPrimaryKey();
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HQLCompletionProposalStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HQLCompletionProposalStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HQLCompletionProposalStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,44 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.tool.ide.completion.HQLCompletionProposal;
-
-public class HQLCompletionProposalStub {
-
- protected HQLCompletionProposal hqlCompletionProposal;
-
- protected HQLCompletionProposalStub(Object hqlCompletionProposal) {
- this.hqlCompletionProposal = (HQLCompletionProposal)hqlCompletionProposal;
- }
-
- public String getCompletion() {
- return hqlCompletionProposal.getCompletion();
- }
-
- public int getReplaceStart() {
- return hqlCompletionProposal.getReplaceStart();
- }
-
- public int getReplaceEnd() {
- return hqlCompletionProposal.getReplaceEnd();
- }
-
- public int getCompletionKind() {
- return hqlCompletionProposal.getCompletionKind();
- }
-
- public String getEntityName() {
- return hqlCompletionProposal.getEntityName();
- }
-
- public String getSimpleName() {
- return hqlCompletionProposal.getSimpleName();
- }
-
- public String getShortEntityName() {
- return hqlCompletionProposal.getShortEntityName();
- }
-
- public PropertyStub getProperty() {
- return new PropertyStub(hqlCompletionProposal.getProperty());
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HibernateConsoleRuntimeException.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HibernateConsoleRuntimeException.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HibernateConsoleRuntimeException.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.console.stubs;
-
-/**
- * @author max
- *
- */
-public class HibernateConsoleRuntimeException extends RuntimeException {
-
- private static final long serialVersionUID = -9056528343206573782L;
-
- public HibernateConsoleRuntimeException(Throwable cause) {
- super("HibernateConsoleRuntimeException", cause); //$NON-NLS-1$
- }
-
- public HibernateConsoleRuntimeException(String message) {
- super(message);
- }
-
- public HibernateConsoleRuntimeException(String message, Throwable cause) {
- super(message, cause);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HibernateStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HibernateStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HibernateStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,39 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.Hibernate;
-
-public class HibernateStub {
- public static final NullableTypeStub BOOLEAN = new NullableTypeStub(Hibernate.BOOLEAN);
- public static final NullableTypeStub BYTE = new NullableTypeStub(Hibernate.BYTE);
- public static final NullableTypeStub BIG_INTEGER = new NullableTypeStub(Hibernate.BIG_INTEGER);
- public static final NullableTypeStub SHORT = new NullableTypeStub(Hibernate.SHORT);
- public static final NullableTypeStub CALENDAR = new NullableTypeStub(Hibernate.CALENDAR);
- public static final NullableTypeStub CALENDAR_DATE = new NullableTypeStub(Hibernate.CALENDAR_DATE);
- public static final NullableTypeStub INTEGER = new NullableTypeStub(Hibernate.INTEGER);
- public static final NullableTypeStub BIG_DECIMAL = new NullableTypeStub(Hibernate.BIG_DECIMAL);
- public static final NullableTypeStub CHARACTER = new NullableTypeStub(Hibernate.CHARACTER);
- public static final NullableTypeStub CLASS = new NullableTypeStub(Hibernate.CLASS);
- public static final NullableTypeStub CURRENCY = new NullableTypeStub(Hibernate.CURRENCY);
- public static final NullableTypeStub DATE = new NullableTypeStub(Hibernate.DATE);
- public static final NullableTypeStub DOUBLE = new NullableTypeStub(Hibernate.DOUBLE);
- public static final NullableTypeStub FLOAT = new NullableTypeStub(Hibernate.FLOAT);
- public static final NullableTypeStub LOCALE = new NullableTypeStub(Hibernate.LOCALE);
- public static final NullableTypeStub LONG = new NullableTypeStub(Hibernate.LONG);
- public static final NullableTypeStub STRING = new NullableTypeStub(Hibernate.STRING);
- public static final NullableTypeStub TEXT = new NullableTypeStub(Hibernate.TEXT);
- public static final NullableTypeStub TIME = new NullableTypeStub(Hibernate.TIME);
- public static final NullableTypeStub TIMESTAMP = new NullableTypeStub(Hibernate.TIMESTAMP);
- public static final NullableTypeStub TIMEZONE = new NullableTypeStub(Hibernate.TIMEZONE);
- public static final NullableTypeStub TRUE_FALSE = new NullableTypeStub(Hibernate.TRUE_FALSE);
- public static final NullableTypeStub YES_NO = new NullableTypeStub(Hibernate.YES_NO);
-
- protected Hibernate hibernate;
-
- protected HibernateStub(Object hibernate) {
- this.hibernate = (Hibernate)hibernate;
- }
-
- public static boolean isInitialized(Object proxy) {
- return Hibernate.isInitialized(proxy);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HqlSqlTokenTypesStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HqlSqlTokenTypesStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/HqlSqlTokenTypesStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,7 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.hql.antlr.HqlSqlTokenTypes;
-
-public class HqlSqlTokenTypesStub {
- public static final int IDENT = HqlSqlTokenTypes.IDENT;
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IHQLCodeAssistStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IHQLCodeAssistStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IHQLCodeAssistStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,19 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.tool.ide.completion.HQLCodeAssist;
-
-public class IHQLCodeAssistStub {
- protected HQLCodeAssist hqlCodeAssist;
-
- protected IHQLCodeAssistStub(Object hqlCodeAssist) {
- this.hqlCodeAssist = (HQLCodeAssist)hqlCodeAssist;
- }
-
- public static IHQLCodeAssistStub createHQLCodeAssist() {
- return new IHQLCodeAssistStub(new HQLCodeAssist(null));
- }
-
- public void codeComplete(String query, int position, IHQLCompletionRequestorStub requestor) {
- hqlCodeAssist.codeComplete(query, position, requestor.hqlCompletionRequestor);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IHQLCompletionRequestorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IHQLCompletionRequestorStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IHQLCompletionRequestorStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,26 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.tool.ide.completion.HQLCompletionProposal;
-import org.hibernate.tool.ide.completion.IHQLCompletionRequestor;
-
-public abstract class IHQLCompletionRequestorStub {
-
- protected IHQLCompletionRequestor hqlCompletionRequestor;
-
- protected IHQLCompletionRequestorStub() {
- hqlCompletionRequestor = new IHQLCompletionRequestor() {
-
- public boolean accept(HQLCompletionProposal proposal) {
- return IHQLCompletionRequestorStub.this.accept(new HQLCompletionProposalStub(proposal));
- }
-
- public void completionFailure(String errorMessage) {
- IHQLCompletionRequestorStub.this.completionFailure(errorMessage);
- }
-
- };
- }
-
- public abstract boolean accept(HQLCompletionProposalStub proposal);
- public abstract void completionFailure(String errorMessage);
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IdentifierBagStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IdentifierBagStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IdentifierBagStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,18 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.IdentifierBag;
-
-public class IdentifierBagStub extends IdentifierCollectionStub {
- protected IdentifierBag identifierBag;
-
- protected IdentifierBagStub(Object identifierBag) {
- super(identifierBag);
- this.identifierBag = (IdentifierBag)identifierBag;
- }
-
- @Override
- public Object accept(ValueVisitorStub visitor) {
- return visitor.accept(this);
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IdentifierCollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IdentifierCollectionStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IdentifierCollectionStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,13 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.IdentifierCollection;
-
-public abstract class IdentifierCollectionStub extends CollectionStub {
- protected IdentifierCollection identifierCollection;
-
- protected IdentifierCollectionStub(Object identifierCollection) {
- super(identifierCollection);
- this.identifierCollection = (IdentifierCollection)identifierCollection;
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ImmutableTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ImmutableTypeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ImmutableTypeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,13 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.type.ImmutableType;
-
-public class ImmutableTypeStub extends NullableTypeStub {
-
- protected ImmutableType immutableType;
-
- protected ImmutableTypeStub(Object immutableType) {
- super(immutableType);
- this.immutableType = (ImmutableType)immutableType;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IndexedCollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IndexedCollectionStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IndexedCollectionStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,18 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.IndexedCollection;
-
-public abstract class IndexedCollectionStub extends CollectionStub {
-
- protected IndexedCollection indexedCollection;
-
- protected IndexedCollectionStub(Object indexedCollection) {
- super(indexedCollection);
- this.indexedCollection = (IndexedCollection)indexedCollection;
- }
-
- public void setIndex(ValueStub index) {
- indexedCollection.setIndex(index.value);
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IntegerTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IntegerTypeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/IntegerTypeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,13 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.type.IntegerType;
-
-public class IntegerTypeStub extends PrimitiveTypeStub {
-
- protected IntegerType integerType;
-
- protected IntegerTypeStub(Object integerType) {
- super(integerType);
- this.integerType = (IntegerType)integerType;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JDBCReaderStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JDBCReaderStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JDBCReaderStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,27 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.hibernate.cfg.JDBCReaderFactory;
-import org.hibernate.cfg.reveng.JDBCReader;
-import org.hibernate.cfg.reveng.ProgressListener;
-import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
-
-public class JDBCReaderStub {
-
- protected JDBCReader jdbcReader;
-
- protected JDBCReaderStub(Properties cfg, SettingsStub settings, ReverseEngineeringStrategy revengStrategy) {
- jdbcReader = JDBCReaderFactory.newJDBCReader(cfg, settings.settings, revengStrategy);
- }
-
- public static JDBCReaderStub newInstance(Properties cfg, SettingsStub settings, ReverseEngineeringStrategy revengStrategy) {
- return new JDBCReaderStub(cfg, settings, revengStrategy);
- }
-
- @SuppressWarnings("unchecked")
- public List readDatabaseSchema(DefaultDatabaseCollectorStub dbs, String catalog, String schema, ProgressListener progress) {
- return jdbcReader.readDatabaseSchema(dbs.defaultDatabaseCollector, catalog, schema, progress);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JoinStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JoinStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JoinStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,25 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.hibernate.mapping.Join;
-import org.hibernate.mapping.Property;
-
-public class JoinStub {
- protected Join join;
-
- protected JoinStub(Object join) {
- this.join = (Join)join;
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<PropertyStub> getPropertyIterator() {
- Iterator<Property> it = (Iterator<Property>)join.getPropertyIterator();
- ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
- while (it.hasNext()) {
- al.add(new PropertyStub(it.next()));
- }
- return al.iterator();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JoinedSubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JoinedSubclassStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/JoinedSubclassStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,26 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.JoinedSubclass;
-
-public class JoinedSubclassStub extends SubclassStub {
-
- protected JoinedSubclass joinedSubclass;
-
- protected JoinedSubclassStub(Object joinedSubclass) {
- super(joinedSubclass);
- this.joinedSubclass = (JoinedSubclass)joinedSubclass;
- }
-
- public static JoinedSubclassStub newInstance(PersistentClassStub persistentClass) {
- return new JoinedSubclassStub(persistentClass);
- }
-
- public void setTable(TableStub table) {
- joinedSubclass.setTable(table.getTable());
- }
-
- public void setKey(KeyValueStub key) {
- joinedSubclass.setKey(key.keyValue);
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/KeyValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/KeyValueStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/KeyValueStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,16 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.KeyValue;
-
-public abstract class KeyValueStub extends ValueStub {
- protected KeyValue keyValue;
-
- protected KeyValueStub(Object keyValue) {
- super(keyValue);
- this.keyValue = (KeyValue)keyValue;
- }
-
- @Override
- public abstract Object accept(ValueVisitorStub visitor);
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ListStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ListStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ListStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,26 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.List;
-
-public class ListStub extends IndexedCollectionStub {
- protected List list;
-
- protected ListStub(Object list) {
- super(list);
- this.list = (List)list;
- }
-
- public static ListStub newInstance(PersistentClassStub owner) {
- return new ListStub(new List(owner.persistentClass));
- }
-
- @Override
- public Object accept(ValueVisitorStub visitor) {
- return visitor.accept(this);
- }
-
- public ValueStub getIndex() {
- return ValueStubFactory.createValueStub(list.getIndex());
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ManyToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ManyToOneStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ManyToOneStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,21 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.ManyToOne;
-
-public class ManyToOneStub extends ToOneStub {
- protected ManyToOne manyToOne;
-
- protected ManyToOneStub(Object manyToOne) {
- super(manyToOne);
- this.manyToOne = (ManyToOne)manyToOne;
- }
-
- public static ManyToOneStub newInstance(TableStub table) {
- return new ManyToOneStub(new ManyToOne(table.table));
- }
-
- public String getReferencedEntityName() {
- return manyToOne.getReferencedEntityName();
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MapStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MapStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MapStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,21 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.Map;
-
-public class MapStub extends IndexedCollectionStub {
- protected Map map;
-
- protected MapStub(Object map) {
- super(map);
- this.map = (Map)map;
- }
-
- public static MapStub newInstance(PersistentClassStub owner) {
- return new MapStub(new Map(owner.persistentClass));
- }
-
- @Override
- public Object accept(ValueVisitorStub visitor) {
- return visitor.accept(this);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MappingStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MappingStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MappingStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,11 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.engine.Mapping;
-
-public class MappingStub {
- protected Mapping mapping;
-
- protected MappingStub(Object mapping) {
- this.mapping = (Mapping)mapping;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MappingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MappingsStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/MappingsStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,15 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.cfg.Mappings;
-
-public class MappingsStub {
- protected Mappings mappings;
-
- protected MappingsStub(Object mappings) {
- this.mappings = (Mappings)mappings;
- }
-
- public void addClass(PersistentClassStub persistentClass) {
- mappings.addClass(persistentClass.getPersistentClass());
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/NamingStrategyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/NamingStrategyStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/NamingStrategyStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,53 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.cfg.NamingStrategy;
-
-public class NamingStrategyStub {
- protected NamingStrategy namingStrategy;
-
- protected NamingStrategyStub(Object namingStrategy) {
- this.namingStrategy = (NamingStrategy)namingStrategy;
- }
-
- @SuppressWarnings("nls")
- public static String getClassName() {
- return "org.hibernate.cfg.NamingStrategy";
- }
-
- public String classToTableName(String className) {
- return namingStrategy.classToTableName(className);
- }
-
- public String tableName(String tableName) {
- return namingStrategy.tableName(tableName);
- }
-
- public String columnName(String columnName) {
- return namingStrategy.columnName(columnName);
- }
-
- public String propertyToColumnName(String propertyName) {
- return namingStrategy.propertyToColumnName(propertyName);
- }
-
- public String joinKeyColumnName(String joinedColumn, String joinedTable) {
- return namingStrategy.joinKeyColumnName(joinedColumn, joinedTable);
- }
-
- public String collectionTableName(String ownerEntity, String ownerEntityTable,
- String associatedEntity, String associatedEntityTable,
- String propertyName) {
- return namingStrategy.collectionTableName(ownerEntity, ownerEntityTable,
- associatedEntity, associatedEntityTable, propertyName);
- }
-
- public String logicalColumnName(String columnName, String propertyName) {
- return namingStrategy.logicalColumnName(columnName, propertyName);
- }
-
- public String foreignKeyColumnName(String propertyName, String propertyEntityName,
- String propertyTableName, String referencedColumnName) {
- return namingStrategy.foreignKeyColumnName(propertyName,
- propertyEntityName, propertyTableName, referencedColumnName);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/NullableTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/NullableTypeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/NullableTypeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,21 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.type.NullableType;
-
-public class NullableTypeStub extends AbstractTypeStub {
-
- protected NullableType nullableType;
-
- protected NullableTypeStub(Object nullableType) {
- super(nullableType);
- this.nullableType = (NullableType)nullableType;
- }
-
- public String toString(Object value) {
- return nullableType.toString(value);
- }
-
- public Object fromStringValue(String xml) {
- return nullableType.fromStringValue(xml);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/OneToManyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/OneToManyStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/OneToManyStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,36 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.OneToMany;
-
-public class OneToManyStub extends ValueStub {
- protected OneToMany oneToMany;
-
- protected OneToManyStub(Object oneToMany) {
- super(oneToMany);
- this.oneToMany = (OneToMany)oneToMany;
- }
-
- public static OneToManyStub newInstance(PersistentClassStub owner) {
- return new OneToManyStub(new OneToMany(owner.persistentClass));
- }
-
- public void setAssociatedClass(PersistentClassStub associatedClass) {
- oneToMany.setAssociatedClass(associatedClass.persistentClass);
- }
-
- public void setReferencedEntityName(String referencedEntityName) {
- oneToMany.setReferencedEntityName(referencedEntityName);
- }
-
- public PersistentClassStub getAssociatedClass() {
- return PersistentClassStubFactory.createPersistentClassStub(oneToMany.getAssociatedClass());
- }
-
- public Object accept(ValueVisitorStub visitor) {
- return visitor.accept(this);
- }
-
- public String getReferencedEntityName() {
- return oneToMany.getReferencedEntityName();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/OneToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/OneToOneStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/OneToOneStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,21 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.OneToOne;
-
-public class OneToOneStub extends ToOneStub {
- protected OneToOne oneToOne;
-
- protected OneToOneStub(Object oneToOne) {
- super(oneToOne);
- this.oneToOne = (OneToOne)oneToOne;
- }
-
- public static OneToOneStub newInstance(TableStub table, PersistentClassStub owner) {
- return new OneToOneStub(new OneToOne(table.table, owner.persistentClass));
- }
-
- public String getEntityName() {
- return oneToOne.getEntityName();
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PersistentClassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PersistentClassStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PersistentClassStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,98 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.hibernate.mapping.Join;
-import org.hibernate.mapping.PersistentClass;
-import org.hibernate.mapping.Property;
-
-public abstract class PersistentClassStub {
- protected PersistentClass persistentClass;
-
- protected PersistentClassStub(Object persistentClass) {
- this.persistentClass = (PersistentClass)persistentClass;
- }
-
- protected PersistentClass getPersistentClass() {
- return persistentClass;
- }
-
- public Boolean isAbstract() {
- return persistentClass.isAbstract();
- }
-
- public ValueStub getDiscriminator() {
- return ValueStubFactory.createValueStub(persistentClass.getDiscriminator());
- }
-
- public String getClassName() {
- return persistentClass.getClassName();
- }
-
- public String getEntityName() {
- return persistentClass.getEntityName();
- }
-
- public PropertyStub getIdentifierProperty() {
- return new PropertyStub(persistentClass.getIdentifierProperty());
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<PropertyStub> getPropertyIterator() {
- Iterator<Property> it = persistentClass.getPropertyIterator();
- ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
- while (it.hasNext()) {
- al.add(new PropertyStub(it.next()));
- }
- return al.iterator();
- }
-
- public RootClassStub getRootClass() {
- return new RootClassStub(persistentClass.getRootClass());
- }
-
- public PropertyStub getVersion() {
- return new PropertyStub(persistentClass.getVersion());
- }
-
- public TableStub getTable() {
- return new TableStub(persistentClass.getTable());
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<JoinStub> getJoinIterator() {
- Iterator<Join> it = (Iterator<Join>)persistentClass.getJoinIterator();
- ArrayList<JoinStub> al = new ArrayList<JoinStub>();
- while (it.hasNext()) {
- al.add(new JoinStub(it.next()));
- }
- return al.iterator();
- }
-
- public KeyValueStub getIdentifier() {
- return (KeyValueStub)ValueStubFactory.createValueStub(persistentClass.getIdentifier());
- }
-
- public PersistentClassStub getSuperclass() {
- return PersistentClassStubFactory.createPersistentClassStub(persistentClass.getSuperclass());
- }
-
- public PropertyStub getProperty(String propertyName) {
- return new PropertyStub(persistentClass.getProperty(propertyName));
- }
-
- public String getNodeName() {
- return persistentClass.getNodeName();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<PropertyStub> getPropertyClosureIterator() {
- Iterator<Property> it = (Iterator<Property>)persistentClass.getPropertyClosureIterator();
- ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
- while (it.hasNext()) {
- al.add(new PropertyStub(it.next()));
- }
- return al.iterator();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PersistentClassStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PersistentClassStubFactory.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PersistentClassStubFactory.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,26 +0,0 @@
-package org.hibernate.console.stubs;
-
-public class PersistentClassStubFactory {
- @SuppressWarnings("unchecked")
- public static PersistentClassStub createPersistentClassStub(Object value) {
- final Class cl = value.getClass();
- if (0 == "org.hibernate.mapping.RootClass".compareTo(cl.getName())) { //$NON-NLS-1$
- return new RootClassStub(value);
- //} else if (0 == "org.hibernate.mapping.PersistentClass".compareTo(cl.getName())) { //$NON-NLS-1$
- // return new PersistentClassStub(value);
- } else if (0 == "org.hibernate.mapping.Subclass".compareTo(cl.getName())) { //$NON-NLS-1$
- return new SubclassStub(value);
- } else if (0 == "org.hibernate.mapping.JoinedSubclass".compareTo(cl.getName())) { //$NON-NLS-1$
- return new JoinedSubclassStub(value);
- } else if (0 == "org.hibernate.mapping.SingleTableSubclass".compareTo(cl.getName())) { //$NON-NLS-1$
- return new SingleTableSubclassStub(value);
- //} else if (0 == "org.hibernate.mapping.UnionSubclass".compareTo(cl.getName())) { //$NON-NLS-1$
- // return new UnionSubclassStub(value);
- }
- return null;
- }
-
- public static PersistentClassStub createPersistentClassStub(PersistentClassStub value) {
- return createPersistentClassStub(value.persistentClass);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimaryKeyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimaryKeyStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimaryKeyStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,57 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.hibernate.mapping.Column;
-import org.hibernate.mapping.PrimaryKey;
-
-public class PrimaryKeyStub {
- protected PrimaryKey primaryKey;
-
- protected PrimaryKeyStub(Object primaryKey) {
- this.primaryKey = (PrimaryKey)primaryKey;
- }
-
- public boolean containsColumn(ColumnStub column) {
- return primaryKey.containsColumn(column.column);
- }
-
- public String getName() {
- return primaryKey.getName();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<ColumnStub> columnIterator() {
- Iterator<Column> it = (Iterator<Column>)primaryKey.getColumnIterator();
- ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
- while (it.hasNext()) {
- al.add(new ColumnStub(it.next()));
- }
- return al.iterator();
- }
-
- @SuppressWarnings("unchecked")
- public List<ColumnStub> getColumns() {
- Iterator<Column> it = (Iterator<Column>)primaryKey.getColumnIterator();
- ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
- while (it.hasNext()) {
- al.add(new ColumnStub(it.next()));
- }
- return al;
- }
-
- public int getColumnSpan() {
- return primaryKey.getColumnSpan();
- }
-
- public ColumnStub getColumn(int i) {
- return new ColumnStub(primaryKey.getColumn(i));
- }
-
- public TableStub getTable() {
- return new TableStub(primaryKey.getTable());
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimitiveArrayStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimitiveArrayStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimitiveArrayStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,21 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.PrimitiveArray;
-
-public class PrimitiveArrayStub extends ArrayStub {
- protected PrimitiveArray primitiveArray;
-
- protected PrimitiveArrayStub(Object primitiveArray) {
- super(primitiveArray);
- this.primitiveArray = (PrimitiveArray)primitiveArray;
- }
-
- public static PrimitiveArrayStub newInstance(PersistentClassStub owner) {
- return new PrimitiveArrayStub(new PrimitiveArray(owner.persistentClass));
- }
-
- public void setElement(ValueStub element) {
- primitiveArray.setElement(element.value);
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimitiveTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimitiveTypeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PrimitiveTypeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,13 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.type.PrimitiveType;
-
-public class PrimitiveTypeStub extends ImmutableTypeStub {
-
- protected PrimitiveType primitiveType;
-
- protected PrimitiveTypeStub(Object primitiveType) {
- super(primitiveType);
- this.primitiveType = (PrimitiveType)primitiveType;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PropertyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PropertyStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/PropertyStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,96 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.Property;
-
-public class PropertyStub {
- protected Property property;
-
- protected PropertyStub(Object property) {
- this.property = (Property)property;
- }
-
- public static PropertyStub newInstance() {
- return new PropertyStub(new Property());
- }
-
- public void setName(String name) {
- property.setName(name);
- }
-
- public void setValue(ValueStub value) {
- property.setValue(value.value);
- }
-
- public ValueStub getValue() {
- return ValueStubFactory.createValueStub(property.getValue());
- }
-
- public void setCascade(String cascade) {
- property.setCascade(cascade);
- }
-
- public String getName() {
- return property.getName();
- }
-
- public TypeStub getType() {
- return TypeStubFactory.createTypeStub(property.getType());
- }
-
- public PersistentClassStub getPersistentClass() {
- return PersistentClassStubFactory.createPersistentClassStub(property.getPersistentClass());
- }
-
- public void setPersistentClass(PersistentClassStub ownerClass) {
- property.setPersistentClass(ownerClass.persistentClass);
- }
-
- public boolean isSelectable() {
- return property.isSelectable();
- }
-
- public boolean isInsertable() {
- return property.isInsertable();
- }
-
- public boolean isUpdateable() {
- return property.isUpdateable();
- }
-
- public boolean isLazy() {
- return property.isLazy();
- }
-
- public boolean isOptional() {
- return property.isOptional();
- }
-
- public boolean isNaturalIdentifier() {
- return property.isNaturalIdentifier();
- }
-
- public boolean isOptimisticLocked() {
- return property.isOptimisticLocked();
- }
-
- public String getCascade() {
- return property.getCascade();
- }
-
- public String getNodeName() {
- return property.getNodeName();
- }
-
- public boolean isBackRef() {
- return property.isBackRef();
- }
-
- public boolean isComposite() {
- return property.isComposite();
- }
-
- public String getPropertyAccessorName() {
- return property.getPropertyAccessorName();
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/RootClassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/RootClassStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/RootClassStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,195 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.hibernate.mapping.RootClass;
-import org.hibernate.mapping.Subclass;
-
-public class RootClassStub extends PersistentClassStub {
- protected RootClass rootClass;
-
- protected RootClassStub(Object rootClass) {
- super(rootClass);
- this.rootClass = (RootClass)rootClass;
- }
-
- public static RootClassStub newInstance() {
- return new RootClassStub(new RootClass());
- }
-
- public String getClassName() {
- return rootClass.getClassName();
- }
-
- public void setDiscriminator(ValueStub discr) {
- rootClass.setDiscriminator(discr.value);
- }
-
- public TableStub getTable() {
- return new TableStub(rootClass.getTable());
- }
-
- public void addProperty(PropertyStub p) {
- rootClass.addProperty(p.property);
- }
-
- public void setIdentifierProperty(PropertyStub p) {
- rootClass.setIdentifierProperty(p.property);
- }
-
- public PropertyStub getIdentifierProperty() {
- return new PropertyStub(rootClass.getIdentifierProperty());
- }
-
- public void setEntityName(String entityName) {
- rootClass.setEntityName(entityName);
- }
-
- public void setClassName(String className) {
- rootClass.setClassName(className);
- }
-
- public void setProxyInterfaceName(String proxyInterfaceName) {
- rootClass.setProxyInterfaceName(proxyInterfaceName);
- }
-
- public void setLazy(boolean lazy) {
- rootClass.setLazy(lazy);
- }
-
- public void setTable(TableStub table) {
- rootClass.setTable(table.table);
- }
-
- public void setAbstract(Boolean isAbstract) {
- rootClass.setAbstract(isAbstract);
- }
-
- public String getNodeName() {
- return rootClass.getNodeName();
- }
-
- public KeyValueStub getIdentifier() {
- return (KeyValueStub)ValueStubFactory.createValueStub(rootClass.getIdentifier());
- }
-
- public boolean isCustomDeleteCallable() {
- return rootClass.isCustomDeleteCallable();
- }
-
- public boolean isCustomInsertCallable() {
- return rootClass.isCustomInsertCallable();
- }
-
- public boolean isCustomUpdateCallable() {
- return rootClass.isCustomUpdateCallable();
- }
-
- public boolean isDiscriminatorInsertable() {
- return rootClass.isDiscriminatorInsertable();
- }
-
- public boolean isDiscriminatorValueNotNull() {
- return rootClass.isDiscriminatorValueNotNull();
- }
-
- public boolean isDiscriminatorValueNull() {
- return rootClass.isDiscriminatorValueNull();
- }
-
- public boolean isExplicitPolymorphism() {
- return rootClass.isExplicitPolymorphism();
- }
-
- public boolean isForceDiscriminator() {
- return rootClass.isForceDiscriminator();
- }
-
- public boolean isInherited() {
- return rootClass.isInherited();
- }
-
- public boolean isJoinedSubclass() {
- return rootClass.isJoinedSubclass();
- }
-
- public boolean isLazy() {
- return rootClass.isLazy();
- }
-
- public boolean isLazyPropertiesCacheable() {
- return rootClass.isLazyPropertiesCacheable();
- }
-
- public boolean isMutable() {
- return rootClass.isMutable();
- }
-
- public boolean isPolymorphic() {
- return rootClass.isPolymorphic();
- }
-
- public boolean isVersioned() {
- return rootClass.isVersioned();
- }
-
- public int getBatchSize() {
- return rootClass.getBatchSize();
- }
-
- public String getCacheConcurrencyStrategy() {
- return rootClass.getCacheConcurrencyStrategy();
- }
-
- public String getCustomSQLDelete() {
- return rootClass.getCustomSQLDelete();
- }
-
- public String getCustomSQLInsert() {
- return rootClass.getCustomSQLInsert();
- }
-
- public String getCustomSQLUpdate() {
- return rootClass.getCustomSQLUpdate();
- }
-
- public String getDiscriminatorValue() {
- return rootClass.getDiscriminatorValue();
- }
-
- public String getLoaderName() {
- return rootClass.getLoaderName();
- }
-
- public int getOptimisticLockMode() {
- return rootClass.getOptimisticLockMode();
- }
-
- public String getTemporaryIdTableDDL() {
- return rootClass.getTemporaryIdTableDDL();
- }
-
- public String getTemporaryIdTableName() {
- return rootClass.getTemporaryIdTableName();
- }
-
- public String getWhere() {
- return rootClass.getWhere();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<SubclassStub> getSubclassIterator() {
- Iterator<Subclass> it = (Iterator<Subclass>)rootClass.getSubclassIterator();
- ArrayList<SubclassStub> al = new ArrayList<SubclassStub>();
- while (it.hasNext()) {
- al.add(new SubclassStub(it.next()));
- }
- return al.iterator();
- }
-
- @Override
- public ValueStub getDiscriminator() {
- return ValueStubFactory.createValueStub(rootClass.getDiscriminator());
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,345 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.sql.Time;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.PropertyDescriptor;
-import org.hibernate.Criteria;
-import org.hibernate.EntityMode;
-import org.hibernate.Session;
-import org.hibernate.Query;
-import org.hibernate.HibernateException;
-import org.hibernate.SessionFactory;
-import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.ConsoleQueryParameter;
-import org.hibernate.console.QueryInputModel;
-import org.hibernate.console.util.CollectionPropertySource;
-import org.hibernate.engine.SessionImplementor;
-import org.hibernate.metadata.ClassMetadata;
-import org.hibernate.metadata.CollectionMetadata;
-import org.hibernate.proxy.HibernateProxyHelper;
-import org.hibernate.type.Type;
-
-import bsh.EvalError;
-import bsh.Interpreter;
-
-public class SessionStub {
-
- protected Session session;
-
- protected SessionStub(Session session) {
- this.session = session;
- }
-
- public boolean isOpen() {
- boolean res = false;
- if (session != null) {
- res = session.isOpen();
- }
- return res;
- }
-
- public void close(List<Throwable> exceptions) {
- if (session != null && session.isOpen()) {
- try {
- session.close();
- } catch (HibernateException e) {
- exceptions.add(e);
- }
- }
- }
-
- public boolean contains(Object obj) {
- boolean res = false;
- if (session != null) {
- res = session.contains(obj);
- }
- return res;
- }
-
- public boolean hasMetaData(Object obj) {
- boolean res = false;
- if (session != null) {
- res = session.getSessionFactory().getClassMetadata(
- HibernateProxyHelper.getClassWithoutInitializingProxy(obj)) != null;
- }
- return res;
- }
-
- public boolean hasMetaData(Object obj, List<Throwable> exceptions) {
- boolean res = false;
- if (session != null) {
- try {
- res = session.getSessionFactory().getClassMetadata(
- HibernateProxyHelper.getClassWithoutInitializingProxy(obj)) != null;
- } catch (HibernateException e) {
- exceptions.add(e);
- }
- }
- return res;
- }
-
- public String getEntityName(Object obj) {
- String res = null;
- if (session != null) {
- res = session.getEntityName(obj);
- }
- return res;
- }
-
- public String getEntityName(Object obj, List<Throwable> exceptions) {
- String res = null;
- if (session != null) {
- try {
- res = session.getEntityName(obj);
- } catch (HibernateException e) {
- exceptions.add(e);
- }
- }
- return res;
- }
-
- public Object getPropertyValue(Object obj, Object id) {
- Object pv = null;
- if (session != null) {
- SessionFactory sf = session.getSessionFactory();
- ClassMetadata classMetadata;
- if (session.isOpen()) {
- classMetadata = sf.getClassMetadata(session.getEntityName(obj));
- } else {
- classMetadata = sf.getClassMetadata(HibernateProxyHelper
- .getClassWithoutInitializingProxy(obj));
- }
- if (id.equals(classMetadata.getIdentifierPropertyName())) {
- pv = classMetadata.getIdentifier(obj, EntityMode.POJO);
- } else {
- pv = classMetadata.getPropertyValue(obj, (String) id, EntityMode.POJO);
- }
- if (pv instanceof Collection<?>) {
- CollectionMetadata collectionMetadata = sf.getCollectionMetadata(classMetadata
- .getEntityName()
- + "." + id); //$NON-NLS-1$
- if (collectionMetadata != null) {
- pv = new CollectionPropertySource((Collection<?>) pv);
- }
- }
- }
- return pv;
- }
-
- public IPropertyDescriptor[] getPropertyDescriptors(final Object obj) {
- SessionFactory sf = session.getSessionFactory();
- ClassMetadata classMetadata;
- if (session.isOpen()) {
- classMetadata = sf.getClassMetadata(session.getEntityName(obj));
- } else {
- classMetadata = sf.getClassMetadata(HibernateProxyHelper
- .getClassWithoutInitializingProxy(obj));
- }
- return initializePropertyDescriptors(classMetadata);
- }
-
- protected IPropertyDescriptor[] initializePropertyDescriptors(ClassMetadata classMetadata) {
-
- String[] propertyNames = classMetadata.getPropertyNames();
- int length = propertyNames.length;
-
- PropertyDescriptor identifier = null;
-
- if (classMetadata.hasIdentifierProperty()) {
- identifier = new PropertyDescriptor(classMetadata.getIdentifierPropertyName(),
- classMetadata.getIdentifierPropertyName());
- identifier.setCategory(ConsoleMessages.EntityPropertySource_identifier);
- length++;
- }
-
- PropertyDescriptor[] properties = new PropertyDescriptor[length];
-
- int idx = 0;
- if (identifier != null) {
- properties[idx++] = identifier;
- }
-
- for (int i = 0; i < propertyNames.length; i++) {
- PropertyDescriptor prop = new PropertyDescriptor(propertyNames[i], propertyNames[i]);
- prop.setCategory(ConsoleMessages.EntityPropertySource_properties);
- properties[i + idx] = prop;
- }
-
- return properties;
- }
-
- @SuppressWarnings("unchecked")
- public List<Object> evalCriteria(String criteriaCode, QueryInputModel model, Time queryTime,
- List<Throwable> exceptions) {
- List<Object> res = Collections.emptyList();
- if (criteriaCode.indexOf("System.exit") >= 0) { // TODO: externalize run so we don't need this bogus check! //$NON-NLS-1$
- exceptions.add(new IllegalArgumentException(ConsoleMessages.JavaPage_not_allowed));
- return res;
- }
- try {
- Interpreter ip = setupInterpreter();
- final Integer maxResults = model.getMaxResults();
- long startTime = System.currentTimeMillis();
- Object o = ip.eval(criteriaCode);
- // ugly! TODO: make un-ugly!
- if (o instanceof Criteria) {
- Criteria criteria = (Criteria) o;
- if (maxResults != null) {
- criteria.setMaxResults(maxResults.intValue());
- }
- res = criteria.list();
- } else if (o instanceof List<?>) {
- res = (List<Object>) o;
- if (maxResults != null) {
- res = res.subList(0, Math.min(res.size(), maxResults.intValue()));
- }
- } else {
- res = new ArrayList<Object>();
- res.add(o);
- }
- queryTime.setTime(System.currentTimeMillis() - startTime);
- } catch (EvalError e) {
- exceptions.add(e);
- } catch (HibernateException e) {
- exceptions.add(e);
- }
- return res;
- }
-
- @SuppressWarnings("unchecked")
- private Interpreter setupInterpreter() throws EvalError, HibernateException {
- Interpreter interpreter = new Interpreter();
-
- interpreter.set("session", session); //$NON-NLS-1$
- interpreter.setClassLoader(Thread.currentThread().getContextClassLoader());
- SessionImplementor si = (SessionImplementor) session;
-
- Map<String, ?> map = si.getFactory().getAllClassMetadata();
-
- Iterator<String> iterator = map.keySet().iterator();
- // TODO: filter non classes.
- String imports = ""; //$NON-NLS-1$
- while (iterator.hasNext()) {
- String element = iterator.next();
- imports += "import " + element + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- imports += "import org.hibernate.criterion.*;\n"; //$NON-NLS-1$
- imports += "import org.hibernate.*;\n"; //$NON-NLS-1$
- // TODO: expose the parameters as values to be used in the code.
- interpreter.eval(imports);
-
- return interpreter;
- }
-
- public List<Object> evalQuery(String queryString, QueryInputModel model, Time queryTime,
- List<Throwable> exceptions) {
- List<Object> res = Collections.emptyList();
- Query query = null;
- try {
- query = session.createQuery(queryString);
- } catch (HibernateException e) {
- exceptions.add(e);
- } catch (Exception e) {
- exceptions.add(e);
- }
- if (query == null) {
- return res;
- }
- try {
- res = new ArrayList<Object>();
- setupParameters(query, model);
- long startTime = System.currentTimeMillis();
- // need to be user-controllable to toggle between iterate, scroll etc.
- Iterator<?> iter = query.list().iterator();
- queryTime.setTime(System.currentTimeMillis() - startTime);
- while (iter.hasNext()) {
- Object element = iter.next();
- res.add(element);
- }
- } catch (HibernateException e) {
- exceptions.add(e);
- } catch (IllegalArgumentException e) {
- exceptions.add(e);
- }
- return res;
- }
-
- private void setupParameters(Query query, QueryInputModel model) {
- if (model.getMaxResults() != null) {
- query.setMaxResults(model.getMaxResults().intValue());
- }
- ConsoleQueryParameter[] qp = model.getQueryParameters();
- for (int i = 0; i < qp.length; i++) {
- ConsoleQueryParameter parameter = qp[i];
- try {
- int pos = Integer.parseInt(parameter.getName());
- query.setParameter(pos, calcValue(parameter), parameter.getType().type);
- } catch (NumberFormatException nfe) {
- query.setParameter(parameter.getName(), calcValue(parameter), parameter.getType().type);
- }
- }
- }
-
- private Object calcValue(ConsoleQueryParameter parameter) {
- return parameter.getValueForQuery();
- }
-
- public List<String> evalQueryPathNames(String queryString, QueryInputModel model,
- List<Throwable> exceptions) {
- List<String> res = Collections.emptyList();
- Query query = null;
- try {
- query = session.createQuery(queryString);
- } catch (HibernateException e) {
- exceptions.add(e);
- } catch (Exception e) {
- exceptions.add(e);
- }
- if (query == null) {
- return res;
- }
- try {
- String[] returnAliases = null;
- try {
- returnAliases = query.getReturnAliases();
- } catch (NullPointerException e) {
- // ignore - http://opensource.atlassian.com/projects/hibernate/browse/HHH-2188
- }
- if (returnAliases == null) {
- Type[] t;
- try {
- t = query.getReturnTypes();
- } catch (NullPointerException npe) {
- t = new Type[] { null };
- // ignore - http://opensource.atlassian.com/projects/hibernate/browse/HHH-2188
- }
- res = new ArrayList<String>(t.length);
- for (int i = 0; i < t.length; i++) {
- Type type = t[i];
- if (type == null) {
- res.add("<multiple types>"); //$NON-NLS-1$
- } else {
- res.add(type.getName());
- }
- }
- } else {
- String[] t = returnAliases;
- res = new ArrayList<String>(t.length);
- for (int i = 0; i < t.length; i++) {
- res.add(t[i]);
- }
- }
- } catch (HibernateException e) {
- exceptions.add(e);
- }
- return res;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStubFactory.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStubFactory.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,164 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.util.ELTransformer;
-import org.hibernate.console.util.QLFormatHelper;
-import org.hibernate.engine.query.HQLQueryPlan;
-import org.hibernate.hql.QueryTranslator;
-import org.hibernate.impl.SessionFactoryImpl;
-import org.hibernate.metadata.ClassMetadata;
-import org.hibernate.metadata.CollectionMetadata;
-import org.hibernate.type.Type;
-
-public class SessionStubFactory {
-
- protected SessionFactory sessionFactory;
-
- public SessionStubFactory(ConfigurationStub configStub) {
- sessionFactory = configStub.buildSessionFactory();
- }
-
- public boolean isSessionFactoryCreated() {
- return sessionFactory != null;
- }
-
- public SessionStub openSession() {
- if (sessionFactory != null) {
- return new SessionStub(sessionFactory.openSession());
- }
- return null;
- }
-
- public void close() {
- if (sessionFactory != null) {
- sessionFactory.close();
- }
- }
-
- @SuppressWarnings("unchecked")
- public List<String> getClasses() {
- List<String> res = Collections.emptyList();
- if (sessionFactory != null) {
- res = new ArrayList<String>();
- res.addAll(sessionFactory.getAllClassMetadata().keySet());
- }
- return res;
- }
-
- @SuppressWarnings("unchecked")
- public Map<String, ClassMetadataStub> getClassMetaData() {
- if (sessionFactory == null) {
- return new HashMap<String, ClassMetadataStub>();
- }
- Map<String, ClassMetadata> allClassMetadata = sessionFactory.getAllClassMetadata();
- Iterator<Map.Entry<String, ClassMetadata>> it = allClassMetadata.entrySet().iterator();
- Map<String, ClassMetadataStub> res = new HashMap<String, ClassMetadataStub>();
- while (it.hasNext()) {
- Map.Entry<String, ClassMetadata> entry = it.next();
- res.put(entry.getKey(), new ClassMetadataStub(entry.getValue()));
- }
- return res;
- }
-
- @SuppressWarnings("unchecked")
- public Map<String, CollectionMetadataStub> getCollectionMetaData() {
- if (sessionFactory == null) {
- return new HashMap<String, CollectionMetadataStub>();
- }
- Map<String, CollectionMetadata> allClassMetadata = sessionFactory.getAllCollectionMetadata();
- Iterator<Map.Entry<String, CollectionMetadata>> it = allClassMetadata.entrySet().iterator();
- Map<String, CollectionMetadataStub> res = new HashMap<String, CollectionMetadataStub>();
- while (it.hasNext()) {
- Map.Entry<String, CollectionMetadata> entry = it.next();
- res.put(entry.getKey(), new CollectionMetadataStub(entry.getValue()));
- }
- return res;
- }
-
- /**
- * Given a ConsoleConfiguration and a query this method validates the query through hibernate if
- * a sessionfactory is available.
- *
- * @param query
- * @param allowEL
- * if true, EL syntax will be replaced as a named variable
- */
- public void checkQuery(String query, boolean allowEL) {
- if (sessionFactory != null) {
- if (allowEL) {
- query = ELTransformer.removeEL(query);
- }
- new HQLQueryPlan(query, false, Collections.EMPTY_MAP,
- (SessionFactoryImpl) sessionFactory);
- }
- }
-
- public String generateSQL(String query) {
- try {
- SessionFactoryImpl sfimpl = (SessionFactoryImpl) sessionFactory; // hack - to get to the
- // actual queries..
- StringBuffer str = new StringBuffer(256);
- HQLQueryPlan plan = new HQLQueryPlan(query, false, Collections.EMPTY_MAP, sfimpl);
-
- QueryTranslator[] translators = plan.getTranslators();
- for (int i = 0; i < translators.length; i++) {
- QueryTranslator translator = translators[i];
- if (translator.isManipulationStatement()) {
- str.append(ConsoleMessages.DynamicSQLPreviewView_manipulation_of + i
- + ":"); //$NON-NLS-1$
- Iterator<?> iterator = translator.getQuerySpaces().iterator();
- while (iterator.hasNext()) {
- Object qspace = iterator.next();
- str.append(qspace);
- if (iterator.hasNext()) {
- str.append(", ");} //$NON-NLS-1$
- }
-
- } else {
- Type[] returnTypes = translator.getReturnTypes();
- str.append(i + ": "); //$NON-NLS-1$
- for (int j = 0; j < returnTypes.length; j++) {
- Type returnType = returnTypes[j];
- str.append(returnType.getName());
- if (j < returnTypes.length - 1) {
- str.append(", ");} //$NON-NLS-1$
- }
- }
- str.append("\n-----------------\n"); //$NON-NLS-1$
- Iterator<?> sqls = translator.collectSqlStrings().iterator();
- while (sqls.hasNext()) {
- String sql = (String) sqls.next();
- str.append(QLFormatHelper.formatForScreen(sql));
- str.append("\n\n"); //$NON-NLS-1$
- }
- }
- return str.toString();
- } catch (Throwable t) {
- // StringWriter sw = new StringWriter();
- StringBuffer msgs = new StringBuffer();
-
- Throwable cause = t;
- while (cause != null) {
- msgs.append(t);
- if (cause.getCause() == cause) {
- cause = null;
- } else {
- cause = cause.getCause();
- if (cause != null)
- msgs.append(ConsoleMessages.DynamicSQLPreviewView_caused_by);
- }
- }
- // t.printStackTrace(new PrintWriter(sw));
- // return sw.getBuffer().toString();
- return msgs.toString();
- }
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SetStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SetStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SetStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,22 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.Set;
-
-public class SetStub extends CollectionStub {
- protected Set set;
-
- protected SetStub(Object set) {
- super(set);
- this.set = (Set)set;
- }
-
- public static SetStub newInstance(PersistentClassStub owner) {
- return new SetStub(new Set(owner.persistentClass));
- }
-
- @Override
- public Object accept(ValueVisitorStub visitor) {
- return visitor.accept(this);
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SettingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SettingsStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SettingsStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,23 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.cfg.Settings;
-
-public class SettingsStub {
- protected Settings settings;
-
- protected SettingsStub(Object settings) {
- this.settings = (Settings)settings;
- }
-
- public ConnectionProviderStub getConnectionProvider() {
- return new ConnectionProviderStub(settings.getConnectionProvider());
- }
-
- public String getDefaultCatalogName() {
- return settings.getDefaultCatalogName();
- }
-
- public String getDefaultSchemaName() {
- return settings.getDefaultSchemaName();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SimpleValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SimpleValueStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SimpleValueStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,52 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.Properties;
-
-import org.hibernate.mapping.SimpleValue;
-
-public class SimpleValueStub extends KeyValueStub {
-
- protected SimpleValue simpleValue;
-
- protected SimpleValueStub(Object simpleValue) {
- super(simpleValue);
- this.simpleValue = (SimpleValue)simpleValue;
- }
-
- public static SimpleValueStub newInstance() {
- return new SimpleValueStub(new SimpleValue());
- }
-
- public void setTypeName(String type) {
- simpleValue.setTypeName(type);
- }
-
- public void addColumn(ColumnStub column) {
- simpleValue.addColumn(column.column);
- }
-
- public void setTable(TableStub table) {
- simpleValue.setTable(table.table);
- }
-
- public void setTypeParameters(Properties parameterMap) {
- simpleValue.setTypeParameters(parameterMap);
- }
-
- public String getForeignKeyName() {
- return simpleValue.getForeignKeyName();
- }
-
- public String getTypeName() {
- return simpleValue.getTypeName();
- }
-
- public boolean isTypeSpecified() {
- return simpleValue.isTypeSpecified();
- }
-
- @Override
- public Object accept(ValueVisitorStub visitor) {
- return visitor.accept(this);
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SingleTableSubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SingleTableSubclassStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SingleTableSubclassStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,17 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.SingleTableSubclass;
-
-public class SingleTableSubclassStub extends SubclassStub {
- protected SingleTableSubclass singleTableSubclass;
-
- protected SingleTableSubclassStub(Object singleTableSubclass) {
- super(singleTableSubclass);
- this.singleTableSubclass = (SingleTableSubclass)singleTableSubclass;
- }
-
- public static SingleTableSubclassStub newInstance(Object singleTableSubclass) {
- return new SingleTableSubclassStub(singleTableSubclass);
- }
-
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SubclassStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SubclassStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,41 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.mapping.Subclass;
-
-public class SubclassStub extends PersistentClassStub {
-
- protected Subclass subclass;
-
- protected SubclassStub(Object subclass) {
- super(subclass);
- this.subclass = (Subclass)subclass;
- }
-
- public void setClassName(String className) {
- subclass.setClassName(className);
- }
-
- public void setEntityName(String entityName) {
- subclass.setEntityName(entityName);
- }
-
- public void setDiscriminatorValue(String discriminatorValue) {
- subclass.setDiscriminatorValue(discriminatorValue);
- }
-
- public void setAbstract(Boolean isAbstract) {
- subclass.setAbstract(isAbstract);
- }
-
- public void addProperty(PropertyStub p) {
- subclass.addProperty(p.property);
- }
-
- public TableStub getRootTable() {
- return new TableStub(subclass.getRootTable());
- }
-
- public boolean isJoinedSubclass() {
- return subclass.isJoinedSubclass();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TableIdentifierStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TableIdentifierStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TableIdentifierStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,23 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.cfg.reveng.TableIdentifier;
-
-public class TableIdentifierStub {
- protected TableIdentifier tableIdentifier;
-
- protected TableIdentifierStub(Object tableIdentifier) {
- this.tableIdentifier = (TableIdentifier)tableIdentifier;
- }
-
- public static TableIdentifierStub create(TableStub table) {
- return newInstance(table.getCatalog(), table.getSchema(), table.getName() );
- }
-
- public static TableIdentifierStub newInstance(String catalog, String schema, String name) {
- return new TableIdentifierStub(new TableIdentifier(catalog, schema, name));
- }
-
- public String getName() {
- return tableIdentifier.getName();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TableStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TableStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TableStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,92 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.hibernate.mapping.Column;
-import org.hibernate.mapping.ForeignKey;
-import org.hibernate.mapping.Table;
-
-public class TableStub {
- protected Table table;
-
- protected TableStub(Object table) {
- this.table = (Table)table;
- }
-
- protected Table getTable() {
- return table;
- }
-
- public static TableStub newInstance(String name) {
- return new TableStub(new Table(name));
- }
-
- public String getName() {
- return table.getName();
- }
-
- public PrimaryKeyStub getPrimaryKey() {
- return new PrimaryKeyStub(table.getPrimaryKey());
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<ForeignKeyStub> getForeignKeyIterator() {
- Iterator<ForeignKey> it = (Iterator<ForeignKey>)table.getForeignKeyIterator();
- ArrayList<ForeignKeyStub> al = new ArrayList<ForeignKeyStub>();
- while (it.hasNext()) {
- al.add(new ForeignKeyStub(it.next()));
- }
- return al.iterator();
- }
-
- public String getCatalog() {
- return table.getCatalog();
- }
-
- public String getSchema() {
- return table.getSchema();
- }
-
- public DependantValueStub getIdentifierValue() {
- return new DependantValueStub(table.getIdentifierValue());
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<ColumnStub> getColumnIterator() {
- Iterator<Column> it = (Iterator<Column>)table.getColumnIterator();
- ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
- while (it.hasNext()) {
- al.add(new ColumnStub(it.next()));
- }
- return al.iterator();
- }
-
- public String getComment() {
- return table.getComment();
- }
-
- public String getRowId() {
- return table.getRowId();
- }
-
- public String getSubselect() {
- return table.getSubselect();
- }
-
- public boolean hasDenormalizedTables() {
- return table.hasDenormalizedTables();
- }
-
- public boolean isAbstract() {
- return table.isAbstract();
- }
-
- public boolean isAbstractUnionTable() {
- return table.isAbstractUnionTable();
- }
-
- public boolean isPhysicalTable() {
- return table.isPhysicalTable();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ToOneStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ToOneStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,36 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.FetchMode;
-import org.hibernate.mapping.ToOne;
-
-public class ToOneStub extends SimpleValueStub {
- protected ToOne toOne;
-
- protected ToOneStub(Object toOne) {
- super(toOne);
- this.toOne = (ToOne)toOne;
- }
-
- public void setReferencedEntityName(String referencedEntityName) {
- toOne.setReferencedEntityName(referencedEntityName);
- }
-
- public void setReferencedPropertyName(String name) {
- toOne.setReferencedPropertyName(name);
- }
-
- public void setFetchMode(FetchModeStub fetchMode) {
- if (FetchModeStub.DEFAULT.equals(fetchMode)) {
- toOne.setFetchMode(FetchMode.DEFAULT);
- } else if (FetchModeStub.SELECT.equals(fetchMode)) {
- toOne.setFetchMode(FetchMode.SELECT);
- } else if (FetchModeStub.JOIN.equals(fetchMode)) {
- toOne.setFetchMode(FetchMode.JOIN);
- } else if (FetchModeStub.SUBSELECT.equals(fetchMode)) {
- }
- }
-
- public boolean isEmbedded() {
- return toOne.isEmbedded();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TypeStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TypeStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,36 +0,0 @@
-package org.hibernate.console.stubs;
-
-import org.hibernate.type.Type;
-
-public abstract class TypeStub {
- protected Type type;
-
- protected TypeStub(Object type) {
- this.type = (Type)type;
- }
-
- @SuppressWarnings("unchecked")
- public Class getReturnedClass() {
- return type.getReturnedClass();
- }
-
- public boolean isCollectionType() {
- return type.isCollectionType();
- }
-
- public boolean isEntityType() {
- return type.isEntityType();
- }
-
- public boolean isAnyType() {
- return type.isAnyType();
- }
-
- public boolean isComponentType() {
- return type.isComponentType();
- }
-
- public String getName() {
- return type.getName();
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TypeStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TypeStubFactory.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/TypeStubFactory.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,34 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.lang.reflect.Type;
-
-public class TypeStubFactory {
- @SuppressWarnings("unchecked")
- public static TypeStub createTypeStub(Object value) {
- final Class cl = value.getClass();
- if (isClassOrOffspring(cl, "org.hibernate.type.CollectionType")) { //$NON-NLS-1$
- return new CollectionTypeStub(value);
- //} else if (0 == "org.hibernate.type.Type".compareTo(cl.getName())) { //$NON-NLS-1$
- // return new TypeStub(value);
- } else if (isClassOrOffspring(cl, "org.hibernate.type.EntityType")) { //$NON-NLS-1$
- return new EntityTypeStub(value);
- } else if (isClassOrOffspring(cl, "org.hibernate.type.NullableType")) { //$NON-NLS-1$
- return new NullableTypeStub(value);
- }
- return new AbstractTypeStub(value);
- }
-
- protected static boolean isClassOrOffspring(final Class<?> cl, final String name) {
- if (cl == null || name == null) {
- return false;
- }
- if (0 == name.compareTo(cl.getName())) {
- return true;
- }
- Type type = cl.getGenericSuperclass();
- if (type instanceof Class<?>) {
- return isClassOrOffspring((Class<?>)type, name);
- }
- return false;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,39 +0,0 @@
-package org.hibernate.console.stubs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.hibernate.mapping.Column;
-import org.hibernate.mapping.Value;
-
-public abstract class ValueStub {
- protected Value value;
-
- protected ValueStub(Object value) {
- this.value = (Value)value;
- }
-
- public TableStub getTable() {
- return new TableStub(value.getTable());
- }
-
- public boolean isSimpleValue() {
- return value.isSimpleValue();
- }
-
- public TypeStub getType() {
- return TypeStubFactory.createTypeStub(value.getType());
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<ColumnStub> getColumnIterator() {
- Iterator<Column> it = (Iterator<Column>)value.getColumnIterator();
- ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
- while (it.hasNext()) {
- al.add(new ColumnStub(it.next()));
- }
- return al.iterator();
- }
-
- public abstract Object accept(ValueVisitorStub visitor);
-};
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueStubFactory.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueStubFactory.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,46 +0,0 @@
-package org.hibernate.console.stubs;
-
-public class ValueStubFactory {
- @SuppressWarnings("unchecked")
- public static ValueStub createValueStub(Object value) {
- final Class cl = value.getClass();
- if (0 == "org.hibernate.mapping.Bag".compareTo(cl.getName())) { //$NON-NLS-1$
- return new BagStub(value);
- //} else if (0 == "org.hibernate.mapping.IdentifierCollection".compareTo(cl.getName())) { //$NON-NLS-1$
- // return new IdentifierCollectionStub(value);
- } else if (0 == "org.hibernate.mapping.IdentifierBag".compareTo(cl.getName())) { //$NON-NLS-1$
- return new IdentifierBagStub(value);
- //} else if (0 == "org.hibernate.mapping.IndexedCollection".compareTo(cl.getName())) { //$NON-NLS-1$
- // return new IndexedCollectionStub(value);
- } else if (0 == "org.hibernate.mapping.List".compareTo(cl.getName())) { //$NON-NLS-1$
- return new ListStub(value);
- } else if (0 == "org.hibernate.mapping.Array".compareTo(cl.getName())) { //$NON-NLS-1$
- return new ArrayStub(value);
- } else if (0 == "org.hibernate.mapping.PrimitiveArray".compareTo(cl.getName())) { //$NON-NLS-1$
- return new PrimitiveArrayStub(value);
- } else if (0 == "org.hibernate.mapping.Map".compareTo(cl.getName())) { //$NON-NLS-1$
- return new MapStub(value);
- } else if (0 == "org.hibernate.mapping.Set".compareTo(cl.getName())) { //$NON-NLS-1$
- return new SetStub(value);
- } else if (0 == "org.hibernate.mapping.OneToMany".compareTo(cl.getName())) { //$NON-NLS-1$
- return new OneToManyStub(value);
- //} else if (0 == "org.hibernate.mapping.KeyValue".compareTo(cl.getName())) { //$NON-NLS-1$
- // return new KeyValueStub(value);
- } else if (0 == "org.hibernate.mapping.SimpleValue".compareTo(cl.getName())) { //$NON-NLS-1$
- return new SimpleValueStub(value);
- } else if (0 == "org.hibernate.mapping.Any".compareTo(cl.getName())) { //$NON-NLS-1$
- return new AnyStub(value);
- } else if (0 == "org.hibernate.mapping.Component".compareTo(cl.getName())) { //$NON-NLS-1$
- return new ComponentStub(value);
- } else if (0 == "org.hibernate.mapping.DependantValue".compareTo(cl.getName())) { //$NON-NLS-1$
- return new DependantValueStub(value);
- } else if (0 == "org.hibernate.mapping.ToOne".compareTo(cl.getName())) { //$NON-NLS-1$
- return new ToOneStub(value);
- } else if (0 == "org.hibernate.mapping.ManyToOne".compareTo(cl.getName())) { //$NON-NLS-1$
- return new ManyToOneStub(value);
- } else if (0 == "org.hibernate.mapping.OneToOne".compareTo(cl.getName())) { //$NON-NLS-1$
- return new OneToOneStub(value);
- }
- return null;
- }
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueVisitorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueVisitorStub.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/ValueVisitorStub.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,19 +0,0 @@
-package org.hibernate.console.stubs;
-
-// look at org.hibernate.mapping.ValueVisitor
-public interface ValueVisitorStub {
- Object accept(BagStub bag);
- Object accept(IdentifierBagStub bag);
- Object accept(ListStub list);
- Object accept(PrimitiveArrayStub primitiveArray);
- Object accept(ArrayStub list);
- Object accept(MapStub map);
- Object accept(OneToManyStub many);
- Object accept(SetStub set);
- Object accept(AnyStub any);
- Object accept(SimpleValueStub value);
- Object accept(DependantValueStub value);
- Object accept(ComponentStub component);
- Object accept(ManyToOneStub mto);
- Object accept(OneToOneStub oto);
-}
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -1,62 +0,0 @@
-package org.hibernate.eclipse.logging;
-
-import java.util.Hashtable;
-import java.util.Stack;
-
-/**
- * CurrentContext is here to have one place where we can keep track on the
- * "current" console configuration to allow logging to be seperated per config.
- *
- */
-
-public class CurrentContext {
-
- static Hashtable<Thread, Stack<Object>> map = new Hashtable<Thread, Stack<Object>>();
-
- private CurrentContext() {
- }
-
- public static int getDepth() {
- Stack<Object> stack = map.get( Thread.currentThread() );
- if ( stack == null )
- return 0;
- else
- return stack.size();
- }
-
- public static Object pop() {
- Thread key = Thread.currentThread();
- Stack<Object> stack = map.get( key );
- if ( stack != null && !stack.isEmpty() )
- return (stack.pop() );
- else
- return null;
- }
-
- public static Object peek() {
- Thread key = Thread.currentThread();
- Stack<Object> stack = map.get( key );
- if ( stack != null && !stack.isEmpty() )
- return stack.peek();
- else
- return null;
- }
-
- public static void push(Object message) {
- Thread key = Thread.currentThread();
- Stack<Object> stack = map.get( key );
-
- if ( stack == null ) {
- stack = new Stack<Object>();
- map.put( key, stack );
- stack.push( message );
- }
- else {
- stack.push( message );
- }
- }
-
- static public void remove() {
- map.remove( Thread.currentThread() );
- }
-}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginFileAppender.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginFileAppender.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginFileAppender.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -27,7 +27,7 @@
import org.apache.log4j.RollingFileAppender;
import org.apache.log4j.spi.LoggingEvent;
import org.eclipse.core.runtime.IPath;
-import org.hibernate.console.ConsoleMessages;
+import org.hibernate.mediator.Messages;
/**
* PluginFileAppender
@@ -95,7 +95,7 @@
* and call activateOptions
* @param stateLocation IPath containing the plug-in state location
*/
- void setStateLocation(IPath stateLocation) {
+ public void setStateLocation(IPath stateLocation) {
this.stateLocation = stateLocation;
if (this.stateLocation != null && this.activateOptionsPending) {
this.activateOptionsPending = false;
@@ -122,7 +122,7 @@
*/
public void setFile(String fileName,boolean append,boolean bufferedIO,int bufferSize) throws IOException {
if (this.stateLocation == null)
- throw new IOException(ConsoleMessages.PluginFileAppender_missing_plugin_state_location);
+ throw new IOException(Messages.PluginFileAppender_missing_plugin_state_location);
fileName = (this.translatePath) ? getTranslatedFileName(fileName) : fileName;
super.setFile(fileName,append,bufferedIO,bufferSize);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogAppender.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -23,8 +23,6 @@
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.spi.ErrorCode;
@@ -34,6 +32,7 @@
import org.eclipse.ui.console.MessageConsoleStream;
import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.mediator.logging.CurrentContext;
/**
* PluginLogAppender
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogListener.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogListener.java 2010-03-29 16:26:55 UTC (rev 21118)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogListener.java 2010-03-29 16:32:11 UTC (rev 21119)
@@ -33,7 +33,7 @@
* and translating plug-in log requests to Logger events.
* @author Manoel Marques
*/
-class PluginLogListener implements ILogListener {
+public class PluginLogListener implements ILogListener {
private ILog log;
private Logger logger;
@@ -44,7 +44,7 @@
* @param plugin the plug-in object
* @param logger logger instance
*/
- PluginLogListener(ILog log,Logger logger) {
+ public PluginLogListener(ILog log,Logger logger) {
this.log = log;
this.logger = logger;
log.addLogListener(this);
@@ -53,7 +53,7 @@
/**
* Removes itself from the plug-in log, reset instance variables.
*/
- void dispose() {
+ public void dispose() {
if (this.log != null) {
this.log.removeLogListener(this);
this.log = null;
@@ -80,14 +80,11 @@
Level level = Level.DEBUG;
if (severity == IStatus.ERROR)
level = Level.ERROR;
- else
- if (severity == IStatus.WARNING)
+ else if (severity == IStatus.WARNING)
level = Level.WARN;
- else
- if (severity == IStatus.INFO)
+ else if (severity == IStatus.INFO)
level = Level.INFO;
- else
- if (severity == IStatus.CANCEL)
+ else if (severity == IStatus.CANCEL)
level = Level.FATAL;
plugin = formatText(plugin);
14 years, 11 months
JBoss Tools SVN: r21118 - in trunk/jsf/tests/org.jboss.tools.jsf.test: projects/JSFKickStartOldFormat/WebContent/pages and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-03-29 12:26:55 -0400 (Mon, 29 Mar 2010)
New Revision: 21118
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/hello.jsp
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/inputUserName.jsp
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartProject/
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4990
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/hello.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/hello.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/hello.jsp 2010-03-29 16:26:55 UTC (rev 21118)
@@ -0,0 +1,20 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<f:loadBundle var="Message" basename="demo.Messages" />
+
+<html>
+ <head>
+ <title>Hello!</title>
+ </head>
+
+ <body>
+ <f:view>
+ <h3>
+ <h:outputText value="#{Message.hello_message}" />,
+ <h:outputText value="#{user.name}" />!
+ </h3>
+ </f:view>
+ </body>
+
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/hello.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/inputUserName.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/inputUserName.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/inputUserName.jsp 2010-03-29 16:26:55 UTC (rev 21118)
@@ -0,0 +1,28 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<f:loadBundle var="Message" basename="demo.Messages"/>
+
+<html>
+ <head>
+ <title>Input User Name Page</title>
+ </head>
+ <body>
+
+ <f:view>
+ <h1><h:outputText value="#{Message.header}"/></h1>
+
+ <h:messages style="color: red"/>
+
+ <h:form id="greetingForm">
+ <h:outputText value="#{Message.prompt_message}"/>
+ <h:inputText value="#{user.name}" required="true">
+ <f:validateLength maximum="30" minimum="3"/>
+ </h:inputText>
+
+ <h:commandButton action="hello" value="Say Hello!" />
+
+ </h:form>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/inputUserName.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-03-29 15:58:02 UTC (rev 21117)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-03-29 16:26:55 UTC (rev 21118)
@@ -32,8 +32,8 @@
suite.addTest(new ProjectImportTestSetup(new TestSuite(ELVariableRefactoringTest.class),
"org.jboss.tools.jsf.test",
- new String[]{"projects/JSFKickStartProject"},
- new String[]{"JSFKickStartProject"}));
+ new String[]{"projects/JSFKickStartOldFormat"},
+ new String[]{"JSFKickStartOldFormat"}));
return suite;
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java 2010-03-29 15:58:02 UTC (rev 21117)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/ELVariableRefactoringTest.java 2010-03-29 16:26:55 UTC (rev 21118)
@@ -12,7 +12,7 @@
import org.jboss.tools.tests.AbstractRefactorTest;
public class ELVariableRefactoringTest extends AbstractRefactorTest {
- static String projectName = "JSFKickStartProject";
+ static String projectName = "JSFKickStartOldFormat";
static IProject project;
public ELVariableRefactoringTest(){
@@ -33,7 +33,7 @@
list.add(structure);
structure = new TestChangeStructure(project, "/WebContent/WEB-INF/faces-config.xml");
- change = new TestTextChange(409, 8, "customer");
+ change = new TestTextChange(1815, 8, "customer");
structure.addTextChange(change);
list.add(structure);
14 years, 11 months
JBoss Tools SVN: r21117 - in branches/hibernatetools-multiversion/hibernatetools/plugins: org.hibernate.mediator and 15 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-03-29 11:58:02 -0400 (Mon, 29 Mar 2010)
New Revision: 21117
Added:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.classpath
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.cvsignore
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.project
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/META-INF/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/META-INF/MANIFEST.MF
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.html
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.ini
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.mappings
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.properties
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/build.properties
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/hibernate_icon.gif
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/ejb3-persistence.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-annotations.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-commons-annotations.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-entitymanager.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-validator.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/bsh-core-2.0b4.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/antlr-2.7.6.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/asm-attrs.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/asm.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/c3p0-0.9.1.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/cglib-2.2.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/commons-collections-3.1.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/commons-logging-1.0.4.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/concurrent-1.3.2.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/connector.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/dom4j-1.6.1.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/ehcache-1.2.3.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/hibernate-jmx.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/hibernate3.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jaas.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/javassist.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-cache.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-common.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-jmx.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-system.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jdbc2_0-stdext.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jgroups-2.2.8.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jta.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/log4j-1.2.15.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/oscache-2.1.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/proxool-0.8.3.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/slf4j-api-1.5.8.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/slf4j-log4j12-1.5.8.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/swarmcache-1.0rc2.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/freemarker.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/hibernate-tools.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/jtidy-r8-20060801.jar
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/plugin.properties
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/ConsoleConfigClassLoader.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/ConsoleQueryParameter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/FakeDelegatingDriver.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/FakeTransactionManagerLookup.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/MediatorPlugin.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/Messages.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/Messages.properties
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/QueryInputModel.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/DefaultExecutionContext.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/ExecutionContext.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/ExecutionContextHolder.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/logging/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/logging/CurrentContext.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/preferences/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/preferences/ConsoleConfigurationPreferences.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AnyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/BagStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FetchModeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConsoleRuntimeException.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MapStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SetStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueVisitorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/tools/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/CollectionHelper.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/HqlBaseLexerStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/OpenMappingUtilsEjb3.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ParserHelper.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ReflectHelper.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/StringHelper.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/XMLHelper.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/CollectionPropertySource.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/ELTransformer.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/Formatter.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/QLFormatHelper.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.classpath
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.classpath (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.classpath 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/hibernate/asm.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/asm-attrs.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate/dom4j-1.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/jboss-cache.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/jboss-common.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/jboss-jmx.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/jboss-system.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/jdbc2_0-stdext.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/jta.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/jaas.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/oscache-2.1.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/proxool-0.8.3.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/swarmcache-1.0rc2.jar"/>
+ <classpathentry kind="lib" path="lib/annotations/hibernate-annotations.jar" sourcepath="D:/Temp/_hibernate/hibernate-annotations-3.4.0.GA-sources.jar "/>
+ <classpathentry kind="lib" path="lib/hibernate/jgroups-2.2.8.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/antlr-2.7.6.jar"/>
+ <classpathentry kind="lib" path="lib/annotations/hibernate-entitymanager.jar" sourcepath="D:/Temp/_hibernate/hibernate-entitymanager-3.4.0.GA-sources.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/javassist.jar"/>
+ <classpathentry kind="lib" path="lib/annotations/hibernate-validator.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate/log4j-1.2.15.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/hibernate-jmx.jar" sourcepath="D:/Temp/_hibernate/hibernate-jmx-3.3.2.GA-sources.jar "/>
+ <classpathentry kind="lib" path="lib/hibernate/commons-collections-3.1.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/slf4j-api-1.5.8.jar" sourcepath="D:/Temp/_hibernate/slf4j-api-1.5.8-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate/cglib-2.2.jar" sourcepath="D:/Temp/_hibernate/cglib-src-2.2.jar"/>
+ <classpathentry kind="lib" path="lib/annotations/hibernate-commons-annotations.jar" sourcepath="D:/Temp/_hibernate/hibernate-commons-annotations-3.1.0.GA-sources.jar "/>
+ <classpathentry kind="lib" path="lib/annotations/ejb3-persistence.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/c3p0-0.9.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate/commons-logging-1.0.4.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/concurrent-1.3.2.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/connector.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/ehcache-1.2.3.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/slf4j-log4j12-1.5.8.jar"/>
+ <classpathentry kind="lib" path="lib/tools/freemarker.jar"/>
+ <classpathentry kind="lib" path="lib/tools/hibernate-tools.jar" sourcepath="C:/RHDS/hibernate/branches/Branch_3_2/HibernateExt_without_changes"/>
+ <classpathentry kind="lib" path="lib/tools/jtidy-r8-20060801.jar"/>
+ <classpathentry kind="lib" path="lib/hibernate/hibernate3.jar" sourcepath="D:/Temp/_hibernate/hibernate-core-3.3.2.GA-sources.jar "/>
+ <classpathentry kind="lib" path="lib/bsh-core-2.0b4.jar"/>
+ <classpathentry kind="output" path="build/eclipse"/>
+</classpath>
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.cvsignore
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.cvsignore (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.cvsignore 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,2 @@
+build
+.settings
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.project
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.project (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/.project 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.hibernate.mediator</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/META-INF/MANIFEST.MF
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/META-INF/MANIFEST.MF (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/META-INF/MANIFEST.MF 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,75 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.hibernate.mediator;singleton:=true
+Bundle-Version: 3.3.0.qualifier
+Bundle-ClassPath: org.hibernate.mediator.jar,
+ lib/hibernate/asm.jar,
+ lib/hibernate/asm-attrs.jar,
+ lib/hibernate/commons-collections-2.1.1.jar,
+ lib/hibernate/commons-logging-1.0.4.jar,
+ lib/hibernate/concurrent-1.3.2.jar,
+ lib/hibernate/connector.jar,
+ lib/hibernate/dom4j-1.6.1.jar,
+ lib/hibernate/hibernate3.jar,
+ lib/hibernate/jboss-cache.jar,
+ lib/hibernate/jboss-common.jar,
+ lib/hibernate/jboss-jmx.jar,
+ lib/hibernate/jboss-system.jar,
+ lib/hibernate/jdbc2_0-stdext.jar,
+ lib/hibernate/jta.jar,
+ lib/hibernate/jaas.jar,
+ lib/hibernate/oscache-2.1.jar,
+ lib/hibernate/proxool-0.8.3.jar,
+ lib/hibernate/swarmcache-1.0rc2.jar,
+ lib/tools/hibernate-tools.jar,
+ lib/tools/bsh-2.0b1.jar,
+ lib/tools/freemarker.jar,
+ lib/bsh-core-2.0b4.jar,
+ lib/annotations/ejb3-persistence.jar,
+ lib/annotations/hibernate-annotations.jar,
+ lib/hibernate/cglib-2.1.3.jar,
+ lib/hibernate/jgroups-2.2.8.jar,
+ lib/hibernate/antlr-2.7.6.jar,
+ lib/tools/jtidy-r8-20060801.jar,
+ lib/annotations/hibernate-entitymanager.jar,
+ lib/hibernate/javassist.jar,
+ lib/hibernate/ehcache-1.2.3.jar,
+ lib/hibernate/c3p0-0.9.1.jar,
+ lib/annotations/hibernate-commons-annotations.jar,
+ lib/annotations/hibernate-validator.jar,
+ lib/annotations/hibernate-search.jar,
+ lib/annotations/lucene-core-2.2.0.jar,
+ lib/hibernate/log4j-1.2.15.jar,
+ lib/hibernate/cglib-2.2.jar,
+ lib/hibernate/commons-collections-3.1.jar,
+ lib/hibernate/hibernate-jmx.jar,
+ lib/hibernate/slf4j-api-1.5.8.jar,
+ lib/hibernate/slf4j-log4j12-1.5.8.jar
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Export-Package: org.hibernate.mediator,
+ org.hibernate.mediator.execution,
+ org.hibernate.mediator.logging,
+ org.hibernate.mediator.preferences,
+ org.hibernate.mediator.stubs,
+ org.hibernate.mediator.stubs.util,
+ org.hibernate.mediator.util,
+ org.apache.log4j,
+ org.apache.log4j.helpers,
+ org.apache.log4j.spi,
+ org.apache.commons.logging,
+ org.dom4j,
+ org.dom4j.io,
+ net.sf.cglib.core,
+ net.sf.cglib.proxy,
+ net.sf.cglib.reflect
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui.console,
+ org.eclipse.ui.views,
+ org.eclipse.jface,
+ org.eclipse.jdt.apt.core,
+ org.eclipse.datatools.connectivity
+Bundle-ActivationPolicy: lazy
+Eclipse-BuddyPolicy: registered
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.html
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.html (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.html 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Hibernate Tools</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>Hibernate Tools</h1>
+
+<p>
+This plugin is part of the Hibernate Tools developed by the <a href="http://www.hibernate.org">Hibernate Team</a> and <a href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a href="http://tools.hibernate.org">tools.hibernate.org</a>
+and <a href="http://www.jboss.org/tools">JBoss Tools project page</a></p>
+
+<p>
+This software is distributed under the terms of the FSF Lesser Gnu
+Public License (see <a href="http://www.gnu.org/copyleft/lesser.txt">LGPL</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.ini
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.ini (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.ini 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=hibernate_icon.gif
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
+
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.mappings
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.mappings (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.mappings 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.properties
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.properties (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/about.properties 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,2 @@
+blurb=Hibernate Tools for Eclipse\n\nVersion\: {featureVersion}\n\n(c) Copyright JBoss by Red Hat, contributors and others 2004 - 2010. All rights reserved.\nVisit http\://tools.hibernate.org
+
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/build.properties
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/build.properties (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/build.properties 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,30 @@
+bin.includes = plugin.xml,\
+ org.hibernate.mediator.jar,\
+ lib/,\
+ META-INF/,\
+ hibernate-log4j.properties,\
+ about.html,\
+ lib/tools/jtidy-r8-20060801.jar,\
+ lib/annotations/hibernate-entitymanager.jar,\
+ lib/hibernate/javassist.jar,\
+ lib/hibernate/ehcache-1.2.3.jar,\
+ lib/hibernate/c3p0-0.9.1.jar,\
+ lib/annotations/hibernate-commons-annotations.jar,\
+ lib/annotations/hibernate-validator.jar,\
+ lib/hibernate/log4j-1.2.15.jar,\
+ lib/hibernate/slf4j-api-1.5.8.jar,\
+ lib/hibernate/slf4j-log4j12-1.5.8.jar,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ hibernate_icon.gif,\
+ plugin.properties,\
+ lib/hibernate/cglib-2.2.jar,\
+ lib/hibernate/commons-collections-3.1.jar,\
+ lib/hibernate/hibernate-jmx.jar
+jars.compile.order = org.hibernate.mediator.jar
+source.org.hibernate.mediator.jar = src/
+output.org.hibernate.mediator.jar = bin/
+src.includes = src/,\
+ about.html
+bin.excludes = lib/.cvsignore
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/hibernate_icon.gif
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/hibernate_icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/ejb3-persistence.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/ejb3-persistence.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-annotations.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-annotations.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-commons-annotations.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-commons-annotations.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-entitymanager.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-entitymanager.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-validator.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/annotations/hibernate-validator.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/bsh-core-2.0b4.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/bsh-core-2.0b4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/antlr-2.7.6.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/antlr-2.7.6.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/asm-attrs.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/asm-attrs.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/asm.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/asm.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/c3p0-0.9.1.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/c3p0-0.9.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/cglib-2.2.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/cglib-2.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/commons-collections-3.1.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/commons-collections-3.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/commons-logging-1.0.4.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/commons-logging-1.0.4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/concurrent-1.3.2.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/concurrent-1.3.2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/connector.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/connector.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/dom4j-1.6.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/ehcache-1.2.3.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/ehcache-1.2.3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/hibernate-jmx.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/hibernate-jmx.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/hibernate3.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/hibernate3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jaas.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jaas.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/javassist.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/javassist.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-cache.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-cache.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-common.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-common.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-jmx.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-jmx.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-system.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jboss-system.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jdbc2_0-stdext.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jdbc2_0-stdext.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jgroups-2.2.8.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jgroups-2.2.8.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jta.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/jta.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/log4j-1.2.15.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/log4j-1.2.15.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/oscache-2.1.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/oscache-2.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/proxool-0.8.3.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/proxool-0.8.3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/slf4j-api-1.5.8.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/slf4j-api-1.5.8.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/slf4j-log4j12-1.5.8.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/slf4j-log4j12-1.5.8.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/swarmcache-1.0rc2.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/hibernate/swarmcache-1.0rc2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/freemarker.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/freemarker.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/hibernate-tools.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/hibernate-tools.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/jtidy-r8-20060801.jar
===================================================================
(Binary files differ)
Property changes on: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/lib/tools/jtidy-r8-20060801.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/plugin.properties
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/plugin.properties (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/plugin.properties 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,3 @@
+#Properties file for org.hibernate.mediator
+Bundle-Vendor.0 = JBoss by Red Hat
+Bundle-Name.0 = Hibernate Tools
\ No newline at end of file
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/ConsoleConfigClassLoader.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/ConsoleConfigClassLoader.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/ConsoleConfigClassLoader.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,286 @@
+/*******************************************************************************
+ * Copyright (c) 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.mediator;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Vector;
+import java.util.jar.JarFile;
+
+import org.hibernate.mediator.stubs.util.ReflectHelper;
+
+/**
+ * Workaround for jdk disgrace with open jar files & native libs,
+ * which is a reason of locked, "undelete" files.
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class ConsoleConfigClassLoader extends URLClassLoader {
+
+ protected HashSet<String> setJarFileNames2Close = new HashSet<String>();
+
+ public ConsoleConfigClassLoader(URL[] urls, ClassLoader parent) {
+ super(urls, parent);
+ }
+
+ public void close() {
+ setJarFileNames2Close.clear();
+ closeClassLoader(this);
+ finalizeNativeLibs(this);
+ cleanupJarFileFactory();
+ }
+
+ /**
+ * cleanup jar file factory cache
+ */
+ @SuppressWarnings({ "nls", "unchecked" })
+ public boolean cleanupJarFileFactory()
+ {
+ boolean res = false;
+ Class classJarURLConnection = null;
+ try {
+ classJarURLConnection = ReflectHelper.classForName("sun.net.www.protocol.jar.JarURLConnection");
+ } catch (ClassNotFoundException e) {
+ //ignore
+ }
+ if (classJarURLConnection == null) {
+ return res;
+ }
+ Field f = null;
+ try {
+ f = classJarURLConnection.getDeclaredField("factory");
+ } catch (NoSuchFieldException e) {
+ //ignore
+ }
+ if (f == null) {
+ return res;
+ }
+ f.setAccessible(true);
+ Object obj = null;
+ try {
+ obj = f.get(null);
+ } catch (IllegalAccessException e) {
+ //ignore
+ }
+ if (obj == null) {
+ return res;
+ }
+ Class classJarFileFactory = obj.getClass();
+ //
+ HashMap fileCache = null;
+ try {
+ f = classJarFileFactory.getDeclaredField("fileCache");
+ f.setAccessible(true);
+ obj = f.get(null);
+ if (obj instanceof HashMap) {
+ fileCache = (HashMap)obj;
+ }
+ } catch (NoSuchFieldException e) {
+ } catch (IllegalAccessException e) {
+ //ignore
+ }
+ HashMap urlCache = null;
+ try {
+ f = classJarFileFactory.getDeclaredField("urlCache");
+ f.setAccessible(true);
+ obj = f.get(null);
+ if (obj instanceof HashMap) {
+ urlCache = (HashMap)obj;
+ }
+ } catch (NoSuchFieldException e) {
+ } catch (IllegalAccessException e) {
+ //ignore
+ }
+ if (urlCache != null) {
+ HashMap urlCacheTmp = (HashMap)urlCache.clone();
+ Iterator it = urlCacheTmp.keySet().iterator();
+ while (it.hasNext()) {
+ obj = it.next();
+ if (!(obj instanceof JarFile)) {
+ continue;
+ }
+ JarFile jarFile = (JarFile)obj;
+ if (setJarFileNames2Close.contains(jarFile.getName())) {
+ try {
+ jarFile.close();
+ } catch (IOException e) {
+ //ignore
+ }
+ if (fileCache != null) {
+ fileCache.remove(urlCache.get(jarFile));
+ }
+ urlCache.remove(jarFile);
+ }
+ }
+ res = true;
+ } else if (fileCache != null) {
+ // urlCache := null
+ HashMap fileCacheTmp = (HashMap)fileCache.clone();
+ Iterator it = fileCacheTmp.keySet().iterator();
+ while (it.hasNext()) {
+ Object key = it.next();
+ obj = fileCache.get(key);
+ if (!(obj instanceof JarFile)) {
+ continue;
+ }
+ JarFile jarFile = (JarFile)obj;
+ if (setJarFileNames2Close.contains(jarFile.getName())) {
+ try {
+ jarFile.close();
+ } catch (IOException e) {
+ //ignore
+ }
+ fileCache.remove(key);
+ }
+ }
+ res = true;
+ }
+ setJarFileNames2Close.clear();
+ return res;
+ }
+
+ /**
+ * close jar files of cl
+ * @param cl
+ * @return
+ */
+ @SuppressWarnings( { "nls", "unchecked" })
+ public boolean closeClassLoader(ClassLoader cl) {
+ boolean res = false;
+ if (cl == null) {
+ return res;
+ }
+ Class classURLClassLoader = URLClassLoader.class;
+ Field f = null;
+ try {
+ f = classURLClassLoader.getDeclaredField("ucp");
+ } catch (NoSuchFieldException e1) {
+ //ignore
+ }
+ if (f != null) {
+ f.setAccessible(true);
+ Object obj = null;
+ try {
+ obj = f.get(cl);
+ } catch (IllegalAccessException e1) {
+ //ignore
+ }
+ if (obj != null) {
+ final Object ucp = obj;
+ f = null;
+ try {
+ f = ucp.getClass().getDeclaredField("loaders");
+ } catch (NoSuchFieldException e1) {
+ //ignore
+ }
+ if (f != null) {
+ f.setAccessible(true);
+ ArrayList loaders = null;
+ try {
+ loaders = (ArrayList) f.get(ucp);
+ res = true;
+ } catch (IllegalAccessException e1) {
+ //ignore
+ }
+ for (int i = 0; loaders != null && i < loaders.size(); i++) {
+ obj = loaders.get(i);
+ f = null;
+ try {
+ f = obj.getClass().getDeclaredField("jar");
+ } catch (NoSuchFieldException e) {
+ //ignore
+ }
+ if (f != null) {
+ f.setAccessible(true);
+ try {
+ obj = f.get(obj);
+ } catch (IllegalAccessException e1) {
+ // ignore
+ }
+ if (obj instanceof JarFile) {
+ final JarFile jarFile = (JarFile)obj;
+ setJarFileNames2Close.add(jarFile.getName());
+ //try {
+ // jarFile.getManifest().clear();
+ //} catch (IOException e) {
+ // // ignore
+ //}
+ try {
+ jarFile.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return res;
+ }
+
+ /**
+ * finalize native libraries
+ * @param cl
+ * @return
+ */
+ @SuppressWarnings({ "nls", "unchecked" })
+ public boolean finalizeNativeLibs(ClassLoader cl) {
+ boolean res = false;
+ Class classClassLoader = ClassLoader.class;
+ java.lang.reflect.Field nativeLibraries = null;
+ try {
+ nativeLibraries = classClassLoader.getDeclaredField("nativeLibraries");
+ } catch (NoSuchFieldException e1) {
+ //ignore
+ }
+ if (nativeLibraries == null) {
+ return res;
+ }
+ nativeLibraries.setAccessible(true);
+ Object obj = null;
+ try {
+ obj = nativeLibraries.get(cl);
+ } catch (IllegalAccessException e1) {
+ //ignore
+ }
+ if (!(obj instanceof Vector)) {
+ return res;
+ }
+ res = true;
+ Vector java_lang_ClassLoader_NativeLibrary = (Vector)obj;
+ for (Object lib : java_lang_ClassLoader_NativeLibrary) {
+ java.lang.reflect.Method finalize = null;
+ try {
+ finalize = lib.getClass().getDeclaredMethod("finalize", new Class[0]);
+ } catch (NoSuchMethodException e) {
+ //ignore
+ }
+ if (finalize != null) {
+ finalize.setAccessible(true);
+ try {
+ finalize.invoke(lib, new Object[0]);
+ } catch (IllegalAccessException e) {
+ } catch (InvocationTargetException e) {
+ //ignore
+ }
+ }
+ }
+ return res;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/ConsoleQueryParameter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/ConsoleQueryParameter.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/ConsoleQueryParameter.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Currency;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.TimeZone;
+
+import org.hibernate.mediator.stubs.HibernateStub;
+import org.hibernate.mediator.stubs.NullableTypeStub;
+import org.hibernate.mediator.stubs.TableStub;
+import org.hibernate.mediator.stubs.TypeStub;
+
+
+public class ConsoleQueryParameter {
+
+ static private final Object NULL_MARKER = null; //new Object() { public String toString() { return "[null]"; } };
+
+ static final Map<TypeStub, String> typeFormats = new HashMap<TypeStub, String>();
+ static {
+ addTypeFormat(HibernateStub.BOOLEAN, Boolean.TRUE );
+ addTypeFormat(HibernateStub.BYTE, Byte.valueOf((byte) 42));
+ addTypeFormat(HibernateStub.BIG_INTEGER, BigInteger.valueOf(42));
+ addTypeFormat(HibernateStub.SHORT, Short.valueOf((short) 42));
+ addTypeFormat(HibernateStub.CALENDAR, new GregorianCalendar());
+ addTypeFormat(HibernateStub.CALENDAR_DATE, new GregorianCalendar());
+ addTypeFormat(HibernateStub.INTEGER, Integer.valueOf(42));
+ addTypeFormat(HibernateStub.INTEGER, Integer.valueOf(42));
+ addTypeFormat(HibernateStub.BIG_DECIMAL, new BigDecimal(42.0));
+ addTypeFormat(HibernateStub.CHARACTER, Character.valueOf('h'));
+ addTypeFormat(HibernateStub.CLASS, TableStub.class);
+ addTypeFormat(HibernateStub.CURRENCY, Currency.getInstance(Locale.getDefault()));
+ addTypeFormat(HibernateStub.DATE, new Date());
+ addTypeFormat(HibernateStub.DOUBLE, Double.valueOf(42.42));
+ addTypeFormat(HibernateStub.FLOAT, Float.valueOf((float)42.42));
+ addTypeFormat(HibernateStub.LOCALE, Locale.getDefault());
+ addTypeFormat(HibernateStub.LONG, Long.valueOf(42));
+ addTypeFormat(HibernateStub.STRING, "a string"); //$NON-NLS-1$
+ addTypeFormat(HibernateStub.TEXT, "a text"); //$NON-NLS-1$
+ addTypeFormat(HibernateStub.TIME, new Date());
+ addTypeFormat(HibernateStub.TIMESTAMP, new Date());
+ addTypeFormat(HibernateStub.TIMEZONE, TimeZone.getDefault());
+ addTypeFormat(HibernateStub.TRUE_FALSE, Boolean.TRUE);
+ addTypeFormat(HibernateStub.YES_NO, Boolean.TRUE);
+ }
+
+
+ private static void addTypeFormat(NullableTypeStub nullableType, Object value) {
+ typeFormats.put(nullableType, nullableType.toString(value));
+ }
+ String name;
+ NullableTypeStub type;
+ Object value;
+
+ public ConsoleQueryParameter(ConsoleQueryParameter cqp) {
+ name = cqp.name;
+ type = cqp.type;
+ value = cqp.value;
+ }
+
+ public ConsoleQueryParameter() {
+
+ }
+
+ public ConsoleQueryParameter(String name, NullableTypeStub type, Object value) {
+ this.name = name;
+ this.type = type;
+ this.value = value;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public NullableTypeStub getType() {
+ return type;
+ }
+
+ public void setType(NullableTypeStub type) {
+ this.type = type;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ //if(value == null) { throw new IllegalArgumentException("Value must not be set to null"); }
+ this.value = value;
+ }
+
+ public String getValueAsString() {
+ if(isNull()) return ""; //$NON-NLS-1$
+ return type.toString(getValue());
+ }
+
+ public void setValueFromString(String value) {
+ try {
+ Object object = type.fromStringValue(value);
+ setValue(object);
+ } catch(Exception he) {
+ setNull();
+ }
+ }
+
+
+ public String getDefaultFormat() {
+ if(type!=null) {
+ Object object = typeFormats.get(type);
+ if(object!=null) {
+ return object.toString();
+ }
+ }
+ return "<unknown>"; //$NON-NLS-1$
+ }
+
+ public static Set<TypeStub> getPossibleTypes() {
+ return typeFormats.keySet();
+ }
+
+ public void setNull() {
+ setValue( NULL_MARKER );
+ }
+
+ public boolean isNull() {
+ return getValue()==NULL_MARKER;
+ }
+
+ public Object getValueForQuery() {
+ if(isNull()) {
+ return null;
+ } else {
+ return getValue();
+ }
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/FakeDelegatingDriver.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/FakeDelegatingDriver.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/FakeDelegatingDriver.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator;
+
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverPropertyInfo;
+import java.sql.SQLException;
+import java.util.Properties;
+
+public class FakeDelegatingDriver implements Driver {
+ private Driver driver;
+
+ public FakeDelegatingDriver(Driver d) {
+ this.driver = d;
+ }
+ public boolean acceptsURL(String u) throws SQLException {
+ return this.driver.acceptsURL(u);
+ }
+ public Connection connect(String u, Properties p) throws SQLException {
+ return this.driver.connect(u, p);
+ }
+ public int getMajorVersion() {
+ return this.driver.getMajorVersion();
+ }
+ public int getMinorVersion() {
+ return this.driver.getMinorVersion();
+ }
+ public DriverPropertyInfo[] getPropertyInfo(String u, Properties p)
+ throws SQLException {
+ return this.driver.getPropertyInfo(u, p);
+ }
+ public boolean jdbcCompliant() {
+ return this.driver.jdbcCompliant();
+ }
+}
\ No newline at end of file
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/FakeTransactionManagerLookup.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/FakeTransactionManagerLookup.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/FakeTransactionManagerLookup.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,238 @@
+package org.hibernate.mediator;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+
+// TODO: replace these imports
+import org.hibernate.HibernateException;
+import org.hibernate.connection.ConnectionProvider;
+import org.hibernate.connection.ConnectionProviderFactory;
+import org.hibernate.transaction.TransactionManagerLookup;
+
+// TODO: ConfigurationStubFactory use this class via string name
+public class FakeTransactionManagerLookup implements TransactionManagerLookup {
+
+ public TransactionManager getTransactionManager(Properties props)
+ throws HibernateException {
+ if ( FakeTransactionManager.INSTANCE == null ) {
+ FakeTransactionManager.INSTANCE = new FakeTransactionManager(props);
+ }
+ return FakeTransactionManager.INSTANCE;
+ }
+
+ public String getUserTransactionName() {
+ return null; //throw new UnsupportedOperationException();
+ }
+
+ public Object getTransactionIdentifier(Transaction transaction) {
+ return transaction;
+ }
+
+}
+
+class FakeTransactionManager implements TransactionManager {
+
+ public static FakeTransactionManager INSTANCE;
+
+ private FakeTransaction current;
+ ConnectionProvider connections;
+
+ public FakeTransactionManager(Properties props) {
+ connections = ConnectionProviderFactory.newConnectionProvider();
+ }
+
+ public void begin() throws NotSupportedException, SystemException {
+ current = new FakeTransaction(this);
+ current.begin();
+ }
+
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException {
+ if(current!=null) current.commit();
+ }
+
+
+ public int getStatus() throws SystemException {
+ if(current!=null) {
+ return current.getStatus();
+ } else {
+ return Status.STATUS_NO_TRANSACTION;
+ }
+ }
+
+ public Transaction getTransaction() throws SystemException {
+ return current;
+ }
+
+ public void resume(Transaction tx) throws InvalidTransactionException,
+ IllegalStateException, SystemException {
+ current = (FakeTransaction) tx;
+ }
+
+ public void rollback() throws IllegalStateException, SecurityException,
+ SystemException {
+ if(current!=null) current.rollback();
+ }
+
+ public void setRollbackOnly() throws IllegalStateException, SystemException {
+ if(current!=null) current.setRollbackOnly();
+ }
+
+ public void setTransactionTimeout(int t) throws SystemException {
+ }
+
+ public Transaction suspend() throws SystemException {
+ Transaction result = current;
+ current = null;
+ return result;
+ }
+
+ public FakeTransaction getCurrent() {
+ return current;
+ }
+
+ void endCurrent(FakeTransaction tx) {
+ if (current==tx) current=null;
+ }
+
+}
+
+class FakeTransaction implements Transaction {
+
+ int status;
+ private Connection connection;
+ List<Synchronization> synchronizations = new ArrayList<Synchronization>();
+ private FakeTransactionManager transactionManager;
+
+ FakeTransaction(FakeTransactionManager transactionManager) {
+ status = Status.STATUS_NO_TRANSACTION;
+ this.transactionManager = transactionManager;
+ }
+
+ public void begin() throws SystemException {
+ try {
+ connection = transactionManager.connections.getConnection();
+ }
+ catch (SQLException sqle) {
+
+ sqle.printStackTrace();
+ throw new SystemException(sqle.toString());
+ }
+ status = Status.STATUS_ACTIVE;
+ }
+
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException {
+
+ if (status == Status.STATUS_MARKED_ROLLBACK) {
+ rollback();
+ }
+ else {
+ status = Status.STATUS_PREPARING;
+
+ for (Synchronization s : synchronizations) {
+ s.beforeCompletion();
+ }
+
+ status = Status.STATUS_COMMITTING;
+
+ try {
+ connection.commit();
+ connection.close();
+ }
+ catch (SQLException sqle) {
+ status = Status.STATUS_UNKNOWN;
+ throw new SystemException();
+ }
+
+ status = Status.STATUS_COMMITTED;
+
+ for (Synchronization s : synchronizations) {
+ s.afterCompletion(status);
+ }
+
+ //status = Status.STATUS_NO_TRANSACTION;
+ transactionManager.endCurrent(this);
+ }
+
+ }
+
+ public boolean delistResource(XAResource arg0, int arg1)
+ throws IllegalStateException, SystemException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean enlistResource(XAResource arg0) throws RollbackException,
+ IllegalStateException, SystemException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public int getStatus() throws SystemException {
+ return status;
+ }
+
+ public void registerSynchronization(Synchronization sync)
+ throws RollbackException, IllegalStateException, SystemException {
+ synchronizations.add(sync);
+ }
+
+ public void rollback() throws IllegalStateException, SystemException {
+
+ status = Status.STATUS_ROLLING_BACK;
+
+// Synch.beforeCompletion() should *not* be called for rollbacks
+// for ( int i=0; i<synchronizations.size(); i++ ) {
+// Synchronization s = (Synchronization) synchronizations.get(i);
+// s.beforeCompletion();
+// }
+
+ status = Status.STATUS_ROLLEDBACK;
+
+ try {
+ connection.rollback();
+ connection.close();
+ }
+ catch (SQLException sqle) {
+ status = Status.STATUS_UNKNOWN;
+ throw new SystemException();
+ }
+
+ for (Synchronization s : synchronizations) {
+ s.afterCompletion(status);
+ }
+
+ //status = Status.STATUS_NO_TRANSACTION;
+ transactionManager.endCurrent(this);
+ }
+
+ public void setRollbackOnly() throws IllegalStateException, SystemException {
+ status = Status.STATUS_MARKED_ROLLBACK;
+ }
+
+ void setConnection(Connection connection) {
+ this.connection = connection;
+ }
+
+ public Connection getConnection() {
+ return connection;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/MediatorPlugin.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/MediatorPlugin.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/MediatorPlugin.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.mediator;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class MediatorPlugin extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.hibernate.mediator"; //$NON-NLS-1$
+
+ // The shared instance
+ private static MediatorPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public MediatorPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ setPlugin(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ setPlugin(null);
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static MediatorPlugin getDefault() {
+ return plugin;
+ }
+
+ private static void setPlugin(MediatorPlugin plugin) {
+ MediatorPlugin.plugin = plugin;
+ }
+
+ /**
+ * Log message
+ *
+ */
+ private static void log(int severity, String message, Throwable e) {
+ getDefault().getLog().log(new Status(severity, PLUGIN_ID, message, e));
+ }
+
+ /**
+ * Short exception log
+ *
+ */
+ public static void logException(Throwable e) {
+ log(IStatus.ERROR, e.getMessage(), e);
+ }
+
+ /**
+ * Short error log call
+ *
+ */
+ public static void logError(String message) {
+ log(IStatus.ERROR, message, null);
+ }
+
+ /**
+ * Short warning log call
+ *
+ */
+ public static void logWarning(String message) {
+ log(IStatus.WARNING, message, null);
+ }
+
+ /**
+ * Short information log call
+ *
+ */
+ public static void logInfo(String message) {
+ log(IStatus.INFO, message, null);
+ }
+
+
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/Messages.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/Messages.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/Messages.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,47 @@
+package org.hibernate.mediator;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.hibernate.mediator.Messages"; //$NON-NLS-1$
+ public static String ConsoleConfiguration_connection_profile_not_found;
+ public static String ConsoleConfiguration_could_not_access;
+ public static String ConsoleConfiguration_could_not_configure_entity_resolver;
+ public static String ConsoleConfiguration_could_not_configure_naming_strategy;
+ public static String ConsoleConfiguration_could_not_create_jpa_based_configuration;
+ public static String ConsoleConfiguration_could_not_load_annotationconfiguration;
+ public static String ConsoleConfiguration_could_not_load_jpa_configuration;
+ public static String ConsoleConfiguration_could_not_parse_configuration;
+ //public static String ConsoleConfiguration_factory_not_closed_before_build_new_factory;
+ public static String ConsoleConfiguration_invalid_configuration;
+ public static String ConsoleConfiguration_persistence_unit_not_found;
+ public static String ConsoleConfiguration_problems_while_loading_database_driverclass;
+ //public static String JavaPage_no_info;
+ public static String JavaPage_not_allowed;
+ //public static String KnownConfigurations_could_not_write_state;
+ //public static String KnownConfigurations_hibernate_log;
+ //public static String KnownConfigurations_unknown;
+ public static String DefaultExecutionContext_existing_classloader;
+ //public static String ClassNode_uninitialized_proxy;
+ //public static String ConfigurationNode_mapped_entities;
+ //public static String NodeFactory_unknown;
+ //public static String PersistentCollectionNode_could_not_access_property_value;
+ //public static String AbstractConsoleConfigurationPreferences_could_not_load_prop_file;
+ //public static String AbstractConsoleConfigurationPreferences_name_not_null_or_empty;
+ //public static String AbstractConsoleConfigurationPreferences_unknown;
+ //public static String StandAloneConsoleConfigurationPreferences_could_not_resolve_classpaths;
+ //public static String StandAloneConsoleConfigurationPreferences_errors_while_parsing;
+ public static String PluginFileAppender_missing_plugin_state_location;
+ //public static String PluginLogAppender_missing_layout_for_appender;
+ public static String EntityPropertySource_identifier;
+ public static String EntityPropertySource_properties;
+ public static String DynamicSQLPreviewView_caused_by;
+ public static String DynamicSQLPreviewView_manipulation_of;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/Messages.properties
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/Messages.properties (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/Messages.properties 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,33 @@
+ConsoleConfiguration_could_not_access=Could not access
+ConsoleConfiguration_could_not_configure_entity_resolver=Could not configure entity resolver
+ConsoleConfiguration_could_not_configure_naming_strategy=Could not configure naming strategy
+ConsoleConfiguration_could_not_create_jpa_based_configuration=Could not create JPA based Configuration
+ConsoleConfiguration_could_not_load_annotationconfiguration=Could not load AnnotationConfiguration
+ConsoleConfiguration_could_not_load_jpa_configuration=Could not load JPA Configuration
+ConsoleConfiguration_could_not_parse_configuration=Could not parse configuration:
+ConsoleConfiguration_factory_not_closed_before_build_new_factory=Factory were not closed before attempting to built a new factory.
+ConsoleConfiguration_invalid_configuration=invalid configuration
+ConsoleConfiguration_persistence_unit_not_found=Persistence unit not found: ''{0}''.
+ConsoleConfiguration_problems_while_loading_database_driverclass=Problems while loading database driverclass ({0})
+JavaPage_no_info=<no info>
+JavaPage_not_allowed=System.exit not allowed\!
+KnownConfigurations_could_not_write_state=Could not write state
+KnownConfigurations_hibernate_log=Hibernate Log -
+KnownConfigurations_unknown=<unknown>
+DefaultExecutionContext_existing_classloader=Existing classloader is not equal to the previously installed classloader\! Existing={0} Previous={1}
+ClassNode_uninitialized_proxy=(uninitialized proxy)
+ConfigurationNode_mapped_entities=Mapped entities
+NodeFactory_unknown=Unknown ->
+PersistentCollectionNode_could_not_access_property_value=Could not access property value
+AbstractConsoleConfigurationPreferences_could_not_load_prop_file=Could not load property file
+AbstractConsoleConfigurationPreferences_name_not_null_or_empty=Name cannot be null or empty
+AbstractConsoleConfigurationPreferences_unknown=<unknown>
+StandAloneConsoleConfigurationPreferences_could_not_resolve_classpaths=Could not resolve classpaths
+StandAloneConsoleConfigurationPreferences_errors_while_parsing=Errors while parsing
+PluginFileAppender_missing_plugin_state_location=Missing Plugin State Location.
+PluginLogAppender_missing_layout_for_appender=Missing layout for appender
+ConsoleConfiguration_connection_profile_not_found=Connection profile not found: ''{0}''.
+EntityPropertySource_identifier=Identifier
+EntityPropertySource_properties=Properties
+DynamicSQLPreviewView_caused_by=\nCaused by:\n
+DynamicSQLPreviewView_manipulation_of=Manipulation of
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/QueryInputModel.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/QueryInputModel.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/QueryInputModel.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Observable;
+import java.util.Set;
+
+import org.hibernate.mediator.stubs.HibernateStub;
+
+/**
+ * Class for managing misc parameters and other inputs to a Query, Criteria etc.
+ *
+ * Currently only holds parameters.
+ *
+ * @author Max Rydahl Andersen
+ *
+ */
+public class QueryInputModel extends Observable {
+
+ List<ConsoleQueryParameter> parameters;
+ boolean ignoreParameters = false;
+
+ private Integer maxResults;
+
+ public QueryInputModel() {
+ parameters = new ArrayList<ConsoleQueryParameter>();
+ }
+
+ public int getParameterCount() {
+ return parameters.size();
+ }
+
+ public ConsoleQueryParameter[] getQueryParameters() {
+ return parameters.toArray(new ConsoleQueryParameter[parameters.size()]);
+ }
+
+ /** return a copy of the parameters currently in this model */
+ public ConsoleQueryParameter[] getQueryParametersForQuery() {
+ //pass 0-size array to guarantee Collection.toArray(T[]) will return new Array instance
+ return ignoreParameters ? new ConsoleQueryParameter[0]
+ : parameters.toArray(new ConsoleQueryParameter[0]);
+ }
+
+ public QueryInputModel getCopyForQuery() {
+ QueryInputModel result = new QueryInputModel();
+
+ ConsoleQueryParameter[] queryParametersForQuery = getQueryParametersForQuery();
+ result.parameters = Arrays.asList( queryParametersForQuery );
+
+ result.maxResults = getMaxResults();
+ result.ignoreParameters = ignoreParameters;
+
+ return result;
+ }
+
+ public void addParameter(ConsoleQueryParameter cqp) {
+ parameters.add(cqp);
+ setChanged();
+ notifyObservers("addParameter"); //$NON-NLS-1$
+ }
+
+ public void removeParameter(ConsoleQueryParameter cqp) {
+ parameters.remove(cqp);
+ setChanged();
+ notifyObservers("removeParameter"); //$NON-NLS-1$
+ }
+
+ public void moveUp(ConsoleQueryParameter cqp) {
+ move(cqp, 1, parameters);
+ }
+
+ public void moveDown(ConsoleQueryParameter cqp) {
+ move(cqp, 1, parameters);
+ }
+
+ protected <T> void move(T tf, int shift, List<T> list) {
+ int i = list.indexOf(tf);
+
+ if(i>=0) {
+ if(i+shift<list.size() && i+shift>=0) {
+ list.remove(i);
+ list.add(i+shift, tf);
+ }
+ }
+ setChanged();
+ notifyObservers("move"); //$NON-NLS-1$
+ }
+
+ /** create a parameter which does not collide with any other parameter */
+ public ConsoleQueryParameter createUniqueParameter(String paramName) {
+ if(parameters.isEmpty()) {
+ return new ConsoleQueryParameter(paramName, HibernateStub.STRING, ""); //$NON-NLS-1$
+ } else {
+ ConsoleQueryParameter cqp = parameters.get(parameters.size()-1);
+ ConsoleQueryParameter c = new ConsoleQueryParameter(cqp);
+ c.setName(makeUnique(parameters.iterator(), paramName));
+ return c;
+ }
+ }
+
+ private static String makeUnique(Iterator<ConsoleQueryParameter> items, String originalPropertyName) {
+ int cnt = 0;
+ String propertyName = originalPropertyName;
+ Set<String> uniqueNames = new HashSet<String>();
+
+ while ( items.hasNext() ) {
+ ConsoleQueryParameter element = items.next();
+ uniqueNames.add( element.getName() );
+ }
+
+ while( uniqueNames.contains(propertyName) ) {
+ cnt++;
+ propertyName = originalPropertyName + "-" + cnt; //$NON-NLS-1$
+ }
+
+ return propertyName;
+ }
+
+
+ public void setIgnoreParameters(boolean ignoreParameters) {
+ this.ignoreParameters = ignoreParameters;
+ setChanged();
+ notifyObservers();
+ }
+
+ public boolean ignoreParameters() {
+ return ignoreParameters;
+ }
+
+ public void clear() {
+ parameters.clear();
+ setChanged();
+ notifyObservers("clear"); //$NON-NLS-1$
+ }
+
+ public void setMaxResults(Integer maxResults) {
+ this.maxResults = maxResults;
+ }
+
+ public Integer getMaxResults() {
+ return maxResults;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/DefaultExecutionContext.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/DefaultExecutionContext.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/DefaultExecutionContext.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator.execution;
+
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.logging.CurrentContext;
+
+public class DefaultExecutionContext implements ExecutionContext {
+
+ final private ClassLoader configurationClassLoader;
+ private volatile int installs;
+ private Map<Thread, ClassLoader> previousLoaders = new WeakHashMap<Thread, ClassLoader>();
+
+ final String key;
+
+ public DefaultExecutionContext(String key, ClassLoader loader) {
+ configurationClassLoader = loader;
+ this.key = key;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hibernate.mediator.ExecutionContext#installLoader()
+ */
+ public synchronized void installLoader() {
+ installs++;
+ if(configurationClassLoader!=null && Thread.currentThread().getContextClassLoader() != configurationClassLoader) {
+ previousLoaders.put(Thread.currentThread(), Thread.currentThread().getContextClassLoader() );
+ Thread.currentThread().setContextClassLoader(configurationClassLoader);
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hibernate.mediator.ExecutionContext#execute(org.hibernate.mediator.ExecutionContext.Command)
+ */
+ public synchronized Object execute(Command c) {
+ try {
+ CurrentContext.push( key );
+ installLoader();
+ return c.execute();
+ }
+ finally {
+ uninstallLoader();
+ CurrentContext.pop();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.hibernate.console.IExecutionContext#uninstallLoader()
+ */
+ public synchronized void uninstallLoader() {
+ installs--; // TODO: make more safe (synchronized) bookkeeping of the classloader installation.
+
+ if(installs==0) {
+ ClassLoader cl = previousLoaders.get(Thread.currentThread() );
+ if(configurationClassLoader!=null && Thread.currentThread().getContextClassLoader() != configurationClassLoader) {
+ String out = NLS.bind(Messages.DefaultExecutionContext_existing_classloader, Thread.currentThread().getContextClassLoader(), configurationClassLoader);
+ throw new IllegalStateException(out);
+ }
+
+ if(cl!=null) {
+ previousLoaders.remove(Thread.currentThread() );
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/ExecutionContext.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/ExecutionContext.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/ExecutionContext.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator.execution;
+
+public interface ExecutionContext {
+
+ public interface Command {
+ public Object execute();
+ }
+
+ public abstract void installLoader();
+
+ public abstract Object execute(Command c);
+
+ public abstract void uninstallLoader();
+
+}
\ No newline at end of file
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/ExecutionContextHolder.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/ExecutionContextHolder.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/execution/ExecutionContextHolder.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator.execution;
+
+public interface ExecutionContextHolder {
+ public ExecutionContext getExecutionContext();
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/logging/CurrentContext.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/logging/CurrentContext.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/logging/CurrentContext.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,62 @@
+package org.hibernate.mediator.logging;
+
+import java.util.Hashtable;
+import java.util.Stack;
+
+/**
+ * CurrentContext is here to have one place where we can keep track on the
+ * "current" console configuration to allow logging to be seperated per config.
+ *
+ */
+
+public class CurrentContext {
+
+ static Hashtable<Thread, Stack<Object>> map = new Hashtable<Thread, Stack<Object>>();
+
+ private CurrentContext() {
+ }
+
+ public static int getDepth() {
+ Stack<Object> stack = map.get( Thread.currentThread() );
+ if ( stack == null )
+ return 0;
+ else
+ return stack.size();
+ }
+
+ public static Object pop() {
+ Thread key = Thread.currentThread();
+ Stack<Object> stack = map.get( key );
+ if ( stack != null && !stack.isEmpty() )
+ return (stack.pop() );
+ else
+ return null;
+ }
+
+ public static Object peek() {
+ Thread key = Thread.currentThread();
+ Stack<Object> stack = map.get( key );
+ if ( stack != null && !stack.isEmpty() )
+ return stack.peek();
+ else
+ return null;
+ }
+
+ public static void push(Object message) {
+ Thread key = Thread.currentThread();
+ Stack<Object> stack = map.get( key );
+
+ if ( stack == null ) {
+ stack = new Stack<Object>();
+ map.put( key, stack );
+ stack.push( message );
+ }
+ else {
+ stack.push( message );
+ }
+ }
+
+ static public void remove() {
+ map.remove( Thread.currentThread() );
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/preferences/ConsoleConfigurationPreferences.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/preferences/ConsoleConfigurationPreferences.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/preferences/ConsoleConfigurationPreferences.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,137 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator.preferences;
+
+import java.io.File;
+import java.io.Serializable;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.w3c.dom.Element;
+
+/**
+ * @author max
+ *
+ */
+public interface ConsoleConfigurationPreferences {
+
+ static final String PATH_TAG = "path"; //$NON-NLS-1$
+ static final String CLASSPATH_TAG = "classpath"; //$NON-NLS-1$
+ static final String MAPPING_TAG = "mapping"; //$NON-NLS-1$
+ static final String MAPPINGS_TAG = "mappings"; //$NON-NLS-1$
+ static final String HIBERNATE_PROPERTIES_TAG = "hibernate-properties"; //$NON-NLS-1$
+ static final String LOCATION_ATTRIB = "location"; //$NON-NLS-1$
+ static final String HIBERNATE_CONFIG_XML_TAG = "hibernate-config-xml"; //$NON-NLS-1$
+ static final String NAME_ATTRIB = "name"; //$NON-NLS-1$
+ static final String CONFIGURATION_TAG = "configuration"; //$NON-NLS-1$
+ static final String ANNOTATIONS_ATTRIB = "annotations"; //$NON-NLS-1$
+ static final String ENTITYRESOLVER_ATTRIB = "entityresolver"; //$NON-NLS-1$
+ static final String CONFIGURATION_MODE_ATTRIB = "configuration-factory"; //$NON-NLS-1$
+
+ // TODO: we should move this to some classhandler
+ static public class ConfigurationMode implements Serializable {
+
+ private static final long serialVersionUID = 1734677008665190162L;
+
+ private static final Map<String, ConfigurationMode> INSTANCES = new HashMap<String, ConfigurationMode>();
+
+ public static final ConfigurationMode CORE = new ConfigurationMode( "CORE" ); //$NON-NLS-1$
+ public static final ConfigurationMode ANNOTATIONS = new ConfigurationMode( "ANNOTATIONS" ); //$NON-NLS-1$
+ public static final ConfigurationMode JPA = new ConfigurationMode( "JPA" ); //$NON-NLS-1$
+
+ static {
+ INSTANCES.put( CORE.name, CORE );
+ INSTANCES.put( ANNOTATIONS.name, ANNOTATIONS );
+ INSTANCES.put( JPA.name, JPA );
+ }
+
+ private final String name;
+
+ public ConfigurationMode(String name) {
+ this.name = name;
+ }
+
+ public String toString() {
+ return name;
+ }
+
+ private Object readResolve() {
+ return INSTANCES.get( name );
+ }
+
+ public static ConfigurationMode parse(String name) {
+ ConfigurationMode rtn = INSTANCES.get( name );
+ if ( rtn == null ) {
+ // default is POJO
+ rtn = CORE;
+ }
+ return rtn;
+ }
+
+ public static String[] values(){
+ return INSTANCES.keySet().toArray(new String[INSTANCES.size()]);
+ }
+ }
+
+
+ public abstract ConfigurationMode getConfigurationMode();
+
+ public abstract String getName();
+
+ /**
+ * @return return non-null array of URLs for a customclasspath
+ */
+ public abstract URL[] getCustomClassPathURLS();
+
+ /**
+ * @return return non-null array of URLs for mapping files
+ */
+ public abstract File[] getMappingFiles();
+
+ public abstract Properties getProperties();
+
+ public abstract File getConfigXMLFile();
+
+ public abstract File getPropertyFile();
+
+ public abstract void writeStateTo(Element node);
+
+ public abstract void readStateFrom(Element element);
+
+ public abstract void setName(String name);
+
+ public abstract String getEntityResolverName();
+
+ public abstract String getPersistenceUnitName();
+
+ public abstract String getNamingStrategy();
+
+ /**
+ *
+ * @return null if ConnectionProfile was not specified
+ */
+ public abstract String getConnectionProfileName();
+
+ public abstract String getDialectName();
+}
\ No newline at end of file
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,12 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.AbstractType;
+
+public class AbstractTypeStub extends TypeStub {
+ protected AbstractType abstractType;
+
+ protected AbstractTypeStub(Object abstractType) {
+ super(abstractType);
+ this.abstractType = (AbstractType)abstractType;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AnyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AnyStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AnyStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,13 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.Any;
+
+public class AnyStub extends SimpleValueStub {
+ protected Any any;
+
+ protected AnyStub(Object any) {
+ super(any);
+ this.any = (Any)any;
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,36 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.Array;
+
+public class ArrayStub extends ListStub {
+ protected Array array;
+
+ protected ArrayStub(Object array) {
+ super(array);
+ this.array = (Array)array;
+ }
+
+ public static ArrayStub newInstance(PersistentClassStub owner) {
+ return new ArrayStub(new Array(owner.persistentClass));
+ }
+
+ public void setElement(ValueStub element) {
+ array.setElement(element.value);
+ }
+
+ public void setCollectionTable(TableStub table) {
+ array.setCollectionTable(table.table);
+ }
+
+ public void setElementClassName(String elementClassName) {
+ array.setElementClassName(elementClassName);
+ }
+
+ public void setIndex(ValueStub index) {
+ array.setIndex(index.value);
+ }
+
+ public String getElementClassName() {
+ return array.getElementClassName();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,28 @@
+package org.hibernate.mediator.stubs;
+
+import java.io.File;
+
+import org.hibernate.tool.hbm2x.ArtifactCollector;
+
+public class ArtifactCollectorStub {
+
+ protected ArtifactCollector artifactCollector;
+
+ protected ArtifactCollectorStub(Object artifactCollector) {
+ this.artifactCollector = (ArtifactCollector)artifactCollector;
+ }
+
+ public static ArtifactCollectorStub newInstance() {
+ return new ArtifactCollectorStub(new ArtifactCollector());
+ }
+
+ public File[] getFiles(String string) {
+ return null;
+ }
+
+ public void formatFiles() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/BagStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/BagStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/BagStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.Bag;
+
+public class BagStub extends CollectionStub {
+ protected Bag bag;
+
+ protected BagStub(Object bag) {
+ super(bag);
+ this.bag = (Bag)bag;
+ }
+
+ public static BagStub newInstance(PersistentClassStub owner) {
+ return new BagStub(new Bag(owner.persistentClass));
+ }
+
+ @Override
+ public Object accept(ValueVisitorStub visitor) {
+ return visitor.accept(this);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,23 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.tool.hbm2x.Cfg2HbmTool;
+
+public class Cfg2HbmToolStub {
+ protected Cfg2HbmTool cfg2HbmTool;
+
+ protected Cfg2HbmToolStub(Object cfg2HbmTool) {
+ this.cfg2HbmTool = (Cfg2HbmTool)cfg2HbmTool;
+ }
+
+ public static Cfg2HbmToolStub newInstance() {
+ return new Cfg2HbmToolStub(new Cfg2HbmTool());
+ }
+
+ public String getTag(PersistentClassStub persistentClass) {
+ return cfg2HbmTool.getTag(persistentClass.persistentClass);
+ }
+
+ public String getTag(PropertyStub property) {
+ return cfg2HbmTool.getTag(property.property);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,46 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.metadata.ClassMetadata;
+import org.hibernate.type.Type;
+
+public class ClassMetadataStub {
+ protected ClassMetadata classMetadata;
+
+ protected ClassMetadataStub(Object classMetadata) {
+ this.classMetadata = (ClassMetadata)classMetadata;
+ }
+
+ public String[] getPropertyNames() {
+ return classMetadata.getPropertyNames();
+ }
+
+ public TypeStub[] getPropertyTypes() {
+ Type[] types = classMetadata.getPropertyTypes();
+ TypeStub[] res = new TypeStub[types.length];
+ for (int i = 0; i < types.length; i++) {
+ res[i] = TypeStubFactory.createTypeStub(types[i]);
+ }
+ return res;
+ }
+
+ public String getIdentifierPropertyName() {
+ return classMetadata.getIdentifierPropertyName();
+ }
+
+ public Object getPropertyValue(Object baseObject, String name, EntityModeStub pojo) {
+ return classMetadata.getPropertyValue(baseObject, name, pojo.entityMode);
+ }
+
+ public String getEntityName() {
+ return classMetadata.getEntityName();
+ }
+
+ public TypeStub getIdentifierType() {
+ return TypeStubFactory.createTypeStub(classMetadata.getIdentifierType());
+ }
+
+ public Class<?> getMappedClass(EntityModeStub pojo) {
+ return classMetadata.getMappedClass(pojo.entityMode);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,15 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.metadata.CollectionMetadata;
+
+public class CollectionMetadataStub {
+ protected CollectionMetadata collectionMetadata;
+
+ protected CollectionMetadataStub(Object collectionMetadata) {
+ this.collectionMetadata = (CollectionMetadata)collectionMetadata;
+ }
+
+ public TypeStub getElementType() {
+ return TypeStubFactory.createTypeStub(collectionMetadata.getElementType());
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,65 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.FetchMode;
+import org.hibernate.mapping.Collection;
+
+public abstract class CollectionStub extends ValueStub {
+
+ protected Collection collection;
+
+ protected CollectionStub(Object collection) {
+ super(collection);
+ this.collection = (Collection)collection;
+ }
+
+ public void setCollectionTable(TableStub table) {
+ collection.setCollectionTable(table.table);
+ }
+
+ public void setKey(KeyValueStub key) {
+ collection.setKey(key.keyValue);
+ }
+
+ public void setLazy(boolean lazy) {
+ collection.setLazy(lazy);
+ }
+
+ public void setRole(String role) {
+ collection.setRole(role);
+ }
+
+ public void setElement(ValueStub element) {
+ collection.setElement(element.value);
+ }
+
+ public void setFetchMode(FetchModeStub fetchMode) {
+ if (FetchModeStub.DEFAULT.equals(fetchMode)) {
+ collection.setFetchMode(FetchMode.DEFAULT);
+ } else if (FetchModeStub.SELECT.equals(fetchMode)) {
+ collection.setFetchMode(FetchMode.SELECT);
+ } else if (FetchModeStub.JOIN.equals(fetchMode)) {
+ collection.setFetchMode(FetchMode.JOIN);
+ } else if (FetchModeStub.SUBSELECT.equals(fetchMode)) {
+ }
+ }
+
+ public ValueStub getElement() {
+ return ValueStubFactory.createValueStub(collection.getElement());
+ }
+
+ public TableStub getCollectionTable() {
+ return new TableStub(collection.getCollectionTable());
+ }
+
+ public KeyValueStub getKey() {
+ return (KeyValueStub)ValueStubFactory.createValueStub(collection.getKey());
+ }
+
+ public boolean isOneToMany() {
+ return collection.isOneToMany();
+ }
+
+ public boolean isInverse() {
+ return collection.isInverse();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,22 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.CollectionType;
+
+public class CollectionTypeStub extends AbstractTypeStub {
+
+ protected CollectionType collectionType;
+
+ protected CollectionTypeStub(Object collectionType) {
+ super(collectionType);
+ this.collectionType = (CollectionType)collectionType;
+ }
+
+ public String getRole() {
+ return collectionType.getRole();
+ }
+
+ public boolean isArrayType() {
+ return collectionType.isArrayType();
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,68 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.Column;
+
+public class ColumnStub {
+ public static final int DEFAULT_LENGTH = 255;
+ public static final int DEFAULT_PRECISION = 19;
+ public static final int DEFAULT_SCALE = 2;
+
+ protected Column column;
+
+ protected ColumnStub(Object column) {
+ this.column = (Column)column;
+ }
+
+ public static ColumnStub newInstance() {
+ return new ColumnStub(new Column());
+ }
+
+ public static ColumnStub newInstance(String columnName) {
+ return new ColumnStub(new Column(columnName));
+ }
+
+ public String getSqlType() {
+ return column.getSqlType();
+ }
+
+ public void setSqlType(String sqlType) {
+ column.setSqlType(sqlType);
+ }
+
+ public String getSqlType(DialectStub dialect, MappingStub mapping) {
+ return column.getSqlType(dialect.dialect, mapping.mapping);
+ }
+
+ public ValueStub getValue() {
+ return ValueStubFactory.createValueStub(column.getValue());
+ }
+
+ public String getName() {
+ return column.getName();
+ }
+
+ public boolean isNullable() {
+ return column.isNullable();
+ }
+
+ public boolean isUnique() {
+ return column.isUnique();
+ }
+
+ public Integer getSqlTypeCode() {
+ return column.getSqlTypeCode();
+ }
+
+ public int getLength() {
+ return column.getLength();
+ }
+
+ public int getPrecision() {
+ return column.getPrecision();
+ }
+
+ public int getScale() {
+ return column.getScale();
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,42 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.hibernate.mapping.Component;
+import org.hibernate.mapping.Property;
+
+public class ComponentStub extends SimpleValueStub {
+ protected Component component;
+
+ protected ComponentStub(Object component) {
+ super(component);
+ this.component = (Component)component;
+ }
+
+ public String getComponentClassName() {
+ return component.getComponentClassName();
+ }
+
+ public PersistentClassStub getOwner() {
+ return PersistentClassStubFactory.createPersistentClassStub(component.getOwner());
+ }
+
+ public String getParentProperty() {
+ return component.getParentProperty();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<PropertyStub> getPropertyIterator() {
+ Iterator<Property> it = (Iterator<Property>)component.getPropertyIterator();
+ ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
+ while (it.hasNext()) {
+ al.add(new PropertyStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ public boolean isEmbedded() {
+ return component.isEmbedded();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,196 @@
+package org.hibernate.mediator.stubs;
+
+import java.io.File;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.FakeDelegatingDriver;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
+import org.hibernate.tool.hbm2ddl.SchemaExport;
+import org.hibernate.tool.ide.completion.HQLCodeAssist;
+import org.xml.sax.EntityResolver;
+
+public class ConfigurationStub {
+
+ private Map<String, FakeDelegatingDriver> fakeDrivers = new HashMap<String, FakeDelegatingDriver>();
+
+ // configuration != null - by default
+ protected Configuration configuration;
+
+ protected ConfigurationStub(Configuration configuration) {
+ //Class.forName(className)
+ //Method ReflectionUtils.findPublicMethod(Class declaringClass, "isOpen",
+ // new Class[]());
+ this.configuration = configuration;
+ }
+
+ protected Configuration getConfiguration() {
+ return configuration;
+ }
+
+ public void cleanUp() {
+ Iterator<FakeDelegatingDriver> it = fakeDrivers.values().iterator();
+ while (it.hasNext()) {
+ try {
+ DriverManager.deregisterDriver(it.next());
+ } catch (SQLException e) {
+ // ignore
+ }
+ }
+ fakeDrivers.clear();
+ }
+
+ public void buildMappings() {
+ configuration.buildMappings();
+ }
+
+ // TODO: temporary should be protected and/or SettingsStub?
+ public SettingsStub buildSettings() {
+ return new SettingsStub(configuration.buildSettings());
+ }
+
+ protected SessionFactory buildSessionFactory() {
+ return configuration.buildSessionFactory();
+ }
+
+ public EntityResolver getEntityResolver() {
+ return configuration.getEntityResolver();
+ }
+
+ public IHQLCodeAssistStub getHQLCodeAssist() {
+ return new IHQLCodeAssistStub(new HQLCodeAssist(configuration));
+ }
+
+ // TODO: temporary should be protected and/or NamingStrategyStub?
+ public NamingStrategyStub getNamingStrategy() {
+ return new NamingStrategyStub(configuration.getNamingStrategy());
+ }
+
+ public boolean hasNamingStrategy() {
+ return (configuration.getNamingStrategy() != null);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<PersistentClassStub> getClassMappings() {
+ Iterator<PersistentClass> it = (Iterator<PersistentClass>)configuration.getClassMappings();
+ ArrayList<PersistentClassStub> arr = new ArrayList<PersistentClassStub>();
+ while (it.hasNext()) {
+ arr.add(PersistentClassStubFactory.createPersistentClassStub(it.next()));
+ }
+ return arr.iterator();
+ }
+
+ // TODO: temporary should be protected and/or PersistentClassStub?
+ public PersistentClassStub getClassMapping(String entityName) {
+ return PersistentClassStubFactory.createPersistentClassStub(configuration.getClassMapping(entityName));
+ }
+
+ // TODO: temporary should be protected and/or MappingsStub?
+ public MappingsStub createMappings() {
+ return new MappingsStub(configuration.createMappings());
+ }
+
+ // TODO: temporary should be protected and/or MappingsStub?
+ public MappingStub buildMapping() {
+ return new MappingStub(configuration.buildMapping());
+ }
+
+ public static interface IExporterNewOutputDir {
+ File getNewOutputDir(POJOClassStub element, File outputdir4FileNew);
+ }
+
+ public HibernateMappingExporterStub createHibernateMappingExporter(File folder2Gen, final IExporterNewOutputDir enod) {
+ return new HibernateMappingExporterStub(this, folder2Gen) {
+ @SuppressWarnings("unchecked")
+ protected void exportPOJO(Map additionalContext, POJOClassStub element) {
+ File outputdir4FileOld = getOutputDirectory();
+ File outputdir4FileNew = enod.getNewOutputDir(element, outputdir4FileOld);
+ if (!outputdir4FileNew.exists()) {
+ outputdir4FileNew.mkdirs();
+ }
+ setOutputDirectory(outputdir4FileNew);
+ super.exportPOJO(additionalContext, element);
+ setOutputDirectory(outputdir4FileOld);
+ }
+ };
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<Throwable> doSchemaExport() {
+ SchemaExport export = new SchemaExport(configuration);
+ export.create(false, true);
+ if (!export.getExceptions().isEmpty()) {
+ return (Iterator<Throwable>)export.getExceptions().iterator();
+ }
+ return null;
+ }
+
+ public void updateExporter(ExporterStub exporter) {
+ exporter.setConfiguration(configuration);
+ }
+
+ public Properties getProperties() {
+ return configuration.getProperties();
+ }
+
+ public String getProperty(String propertyName) {
+ return configuration.getProperty(propertyName);
+ }
+
+ /**
+ * DriverManager checks what classloader a class is loaded from thus we register a FakeDriver
+ * that we know is loaded "properly" which delegates all it class to the real driver. By doing
+ * so we can convince DriverManager that we can use any dynamically loaded driver.
+ *
+ * @param driverClassName
+ */
+ @SuppressWarnings("unchecked")
+ protected void registerFakeDriver(String driverClassName) {
+ if (driverClassName != null) {
+ try {
+ Class<Driver> driverClass = ReflectHelper.classForName(driverClassName);
+ if (!fakeDrivers.containsKey(driverClassName)) { // To avoid "double registration"
+ FakeDelegatingDriver fakeDelegatingDriver = new FakeDelegatingDriver(
+ driverClass.newInstance());
+ DriverManager.registerDriver(fakeDelegatingDriver);
+ fakeDrivers.put(driverClassName, fakeDelegatingDriver);
+ }
+ } catch (ClassNotFoundException e) {
+ String out = NLS
+ .bind(
+ Messages.ConsoleConfiguration_problems_while_loading_database_driverclass,
+ driverClassName);
+ throw new HibernateConsoleRuntimeException(out, e);
+ } catch (InstantiationException e) {
+ String out = NLS
+ .bind(
+ Messages.ConsoleConfiguration_problems_while_loading_database_driverclass,
+ driverClassName);
+ throw new HibernateConsoleRuntimeException(out, e);
+ } catch (IllegalAccessException e) {
+ String out = NLS
+ .bind(
+ Messages.ConsoleConfiguration_problems_while_loading_database_driverclass,
+ driverClassName);
+ throw new HibernateConsoleRuntimeException(out, e);
+ } catch (SQLException e) {
+ String out = NLS
+ .bind(
+ Messages.ConsoleConfiguration_problems_while_loading_database_driverclass,
+ driverClassName);
+ throw new HibernateConsoleRuntimeException(out, e);
+ }
+ }
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubFactory.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubFactory.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,412 @@
+package org.hibernate.mediator.stubs;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.dom4j.DocumentException;
+import org.dom4j.Node;
+import org.dom4j.io.DOMWriter;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.HibernateException;
+import org.hibernate.MappingException;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.cfg.JDBCMetaDataConfiguration;
+import org.hibernate.cfg.NamingStrategy;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.resolver.DialectFactory;
+import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.mediator.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
+import org.hibernate.mediator.stubs.util.StringHelper;
+import org.hibernate.util.ConfigHelper;
+import org.hibernate.util.XMLHelper;
+import org.w3c.dom.Document;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+public class ConfigurationStubFactory {
+
+ private ConsoleConfigurationPreferences prefs = null;
+
+ public ConfigurationStubFactory(ConsoleConfigurationPreferences prefs) {
+ this.prefs = prefs;
+ }
+
+ public ConfigurationStub createConfiguration() {
+ ConfigurationStub res = new ConfigurationStub(new Configuration());
+ return res;
+ }
+
+ public ConfigurationStubJDBCMetaData createConfigurationJDBCMetaData() {
+ ConfigurationStubJDBCMetaData res = new ConfigurationStubJDBCMetaData(new JDBCMetaDataConfiguration());
+ return res;
+ }
+
+ public ConfigurationStub createConfiguration(ConfigurationStub cfg, boolean includeMappings) {
+ Configuration localCfg = cfg == null ? null : cfg.getConfiguration();
+ Properties properties = prefs.getProperties();
+ if (properties != null) {
+ // to fix: JBIDE-5839 - setup this property: false is default value
+ // to make hibernate tools diff hibernate versions compatible
+ if (properties.getProperty("hibernate.search.autoregister_listeners") == null) { //$NON-NLS-1$
+ properties.setProperty("hibernate.search.autoregister_listeners", "false"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ // in case the transaction manager is empty then we need to inject a faketm since
+ // hibernate will still try and instantiate it.
+ String str = properties.getProperty("hibernate.transaction.manager_lookup_class"); //$NON-NLS-1$
+ if (str != null && StringHelper.isEmpty(str)) {
+ properties
+ .setProperty(
+ "hibernate.transaction.manager_lookup_class", "org.hibernate.mediator.FakeTransactionManagerLookup"); //$NON-NLS-1$ //$NON-NLS-2$
+ // properties.setProperty( "hibernate.transaction.factory_class", "");
+ }
+ }
+ if (localCfg == null) {
+ localCfg = buildConfiguration(properties, includeMappings);
+ } else {
+ // Properties origProperties = cfg.getProperties();
+ // origProperties.putAll(properties);
+ // cfg.setProperties(origProperties);
+ // TODO: this is actually only for jdbc reveng...
+ // localCfg = configureStandardConfiguration( includeMappings, localCfg, properties );
+ }
+ // non-running databases + i havent been needed until now...
+ // TODO: jpa configuration ?
+ if (includeMappings) {
+ File[] mappingFiles = prefs.getMappingFiles();
+ for (int i = 0; i < mappingFiles.length; i++) {
+ File hbm = mappingFiles[i];
+ localCfg = localCfg.addFile(hbm);
+ }
+ }
+ // TODO: HBX-
+ localCfg.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false"); //$NON-NLS-1$//$NON-NLS-2$
+ localCfg.setProperty(Environment.HBM2DDL_AUTO, "false"); //$NON-NLS-1$
+ ConfigurationStub res = new ConfigurationStub(localCfg);
+ // here both setProperties and configxml have had their chance to tell which databasedriver
+ // is needed.
+ res.registerFakeDriver(localCfg.getProperty(Environment.DRIVER));
+ // autoConfigureDialect(localCfg); Disabled for now since it causes very looong timeouts for
+ return res;
+ }
+
+ private Configuration buildAnnotationConfiguration() throws ClassNotFoundException,
+ InstantiationException, IllegalAccessException {
+ Class<?> clazz = ReflectHelper
+ .classForName("org.hibernate.cfg.AnnotationConfiguration", ConfigurationStubFactory.class); //$NON-NLS-1$
+ Configuration annotationConfig = (Configuration)clazz.newInstance();
+ return annotationConfig;
+ }
+
+ private Configuration buildJPAConfiguration(String persistenceUnit, Properties properties,
+ String entityResolver, boolean includeMappings) {
+ if (StringHelper.isEmpty(persistenceUnit)) {
+ persistenceUnit = null;
+ }
+ try {
+ Map<Object, Object> overrides = new HashMap<Object, Object>();
+ if (properties != null) {
+ overrides.putAll(properties);
+ }
+ if (StringHelper.isNotEmpty(prefs.getNamingStrategy())) {
+ overrides.put("hibernate.ejb.naming_strategy", prefs.getNamingStrategy()); //$NON-NLS-1$
+ }
+ if (StringHelper.isNotEmpty(prefs.getDialectName())) {
+ overrides.put("hibernate.dialect", prefs.getDialectName()); //$NON-NLS-1$
+ }
+ if (!includeMappings) {
+ overrides.put("hibernate.archive.autodetection", "none"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ Class<?> clazz = ReflectHelper.classForName(
+ "org.hibernate.ejb.Ejb3Configuration", ConfigurationStubFactory.class); //$NON-NLS-1$
+ Object ejb3cfg = clazz.newInstance();
+
+ if (StringHelper.isNotEmpty(entityResolver)) {
+ Class<?> resolver = ReflectHelper.classForName(entityResolver, this.getClass());
+ Object object = resolver.newInstance();
+ Method method = clazz.getMethod(
+ "setEntityResolver", new Class[] { EntityResolver.class });//$NON-NLS-1$
+ method.invoke(ejb3cfg, new Object[] { object });
+ }
+
+ Method method = clazz.getMethod("configure", new Class[] { String.class, Map.class }); //$NON-NLS-1$
+ if (method.invoke(ejb3cfg, new Object[] { persistenceUnit, overrides }) == null) {
+ String out = NLS.bind(
+ Messages.ConsoleConfiguration_persistence_unit_not_found,
+ persistenceUnit);
+ throw new HibernateConsoleRuntimeException(out, null);
+ }
+
+ method = clazz.getMethod("getHibernateConfiguration", new Class[0]);//$NON-NLS-1$
+ Object obj = method.invoke(ejb3cfg, (Object[]) null);
+ Configuration invoke = (Configuration)obj;
+ invoke = configureConnectionProfile(invoke);
+
+ return invoke;
+ } catch (HibernateConsoleRuntimeException he) {
+ throw he;
+ } catch (Exception e) {
+ throw new HibernateConsoleRuntimeException(
+ Messages.ConsoleConfiguration_could_not_create_jpa_based_configuration,
+ e);
+ }
+ }
+
+ private Configuration buildConfiguration(Properties properties, boolean includeMappings) {
+ Configuration localCfg = null;
+ if (prefs.getConfigurationMode().equals(ConfigurationMode.ANNOTATIONS)) {
+ try {
+ localCfg = buildAnnotationConfiguration();
+ localCfg = configureStandardConfiguration(includeMappings, localCfg, properties);
+ } catch (HibernateConsoleRuntimeException he) {
+ throw he;
+ } catch (Exception e) {
+ throw new HibernateConsoleRuntimeException(
+ Messages.ConsoleConfiguration_could_not_load_annotationconfiguration,
+ e);
+ }
+ } else if (prefs.getConfigurationMode().equals(ConfigurationMode.JPA)) {
+ try {
+ localCfg = buildJPAConfiguration(prefs.getPersistenceUnitName(), properties, prefs
+ .getEntityResolverName(), includeMappings);
+ } catch (HibernateConsoleRuntimeException he) {
+ throw he;
+ } catch (Exception e) {
+ throw new HibernateConsoleRuntimeException(
+ Messages.ConsoleConfiguration_could_not_load_jpa_configuration, e);
+ }
+ } else {
+ localCfg = new Configuration();
+ localCfg = configureStandardConfiguration(includeMappings, localCfg, properties);
+ }
+ return localCfg;
+ }
+
+ private Configuration configureStandardConfiguration(final boolean includeMappings,
+ Configuration localCfg, Properties properties) {
+ if (properties != null) {
+ localCfg = localCfg.setProperties(properties);
+ }
+ EntityResolver entityResolver = XMLHelper.DEFAULT_DTD_RESOLVER;
+ if (StringHelper.isNotEmpty(prefs.getEntityResolverName())) {
+ try {
+ entityResolver = (EntityResolver) ReflectHelper.classForName(
+ prefs.getEntityResolverName()).newInstance();
+ } catch (Exception c) {
+ throw new HibernateConsoleRuntimeException(
+ Messages.ConsoleConfiguration_could_not_configure_entity_resolver
+ + prefs.getEntityResolverName(), c);
+ }
+ }
+ localCfg.setEntityResolver(entityResolver);
+ if (StringHelper.isNotEmpty(prefs.getNamingStrategy())) {
+ try {
+ NamingStrategy ns = (NamingStrategy) ReflectHelper.classForName(
+ prefs.getNamingStrategy()).newInstance();
+ localCfg.setNamingStrategy(ns);
+ } catch (Exception c) {
+ throw new HibernateConsoleRuntimeException(
+ Messages.ConsoleConfiguration_could_not_configure_naming_strategy
+ + prefs.getNamingStrategy(), c);
+ }
+ }
+ localCfg = loadConfigurationXML(localCfg, includeMappings, entityResolver);
+ localCfg = configureConnectionProfile(localCfg);
+
+ // replace dialect if it is set in preferences
+ if (StringHelper.isNotEmpty(prefs.getDialectName())) {
+ localCfg.setProperty("hibernate.dialect", prefs.getDialectName()); //$NON-NLS-1$
+ }
+
+ return localCfg;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Configuration loadConfigurationXML(Configuration localCfg, boolean includeMappings,
+ EntityResolver entityResolver) {
+ File configXMLFile = prefs.getConfigXMLFile();
+ if (!includeMappings) {
+ org.dom4j.Document doc;
+ XMLHelper xmlHelper = new XMLHelper();
+ InputStream stream = null;
+ String resourceName = "<unknown>"; //$NON-NLS-1$
+ if (configXMLFile != null) {
+ resourceName = configXMLFile.toString();
+ try {
+ stream = new FileInputStream(configXMLFile);
+ } catch (FileNotFoundException e1) {
+ throw new HibernateConsoleRuntimeException(
+ Messages.ConsoleConfiguration_could_not_access + configXMLFile,
+ e1);
+ }
+ } else {
+ resourceName = "/hibernate.cfg.xml"; //$NON-NLS-1$
+ if (checkHibernateResoureExistence(resourceName)) {
+ stream = ConfigHelper.getResourceAsStream(resourceName); // simulate hibernate's
+ // default look up
+ } else {
+ return localCfg;
+ }
+ }
+
+ try {
+ List<Throwable> errors = new ArrayList<Throwable>();
+
+ doc = xmlHelper.createSAXReader(resourceName, errors, entityResolver).read(
+ new InputSource(stream));
+ if (errors.size() != 0) {
+ throw new MappingException(
+ Messages.ConsoleConfiguration_invalid_configuration, errors
+ .get(0));
+ }
+
+ List<Node> list = doc.getRootElement()
+ .element("session-factory").elements("mapping"); //$NON-NLS-1$ //$NON-NLS-2$
+ for (Node element : list) {
+ element.getParent().remove(element);
+ }
+
+ DOMWriter dw = new DOMWriter();
+ Document document = dw.write(doc);
+ return localCfg.configure(document);
+
+ } catch (DocumentException e) {
+ throw new HibernateException(
+ Messages.ConsoleConfiguration_could_not_parse_configuration
+ + resourceName, e);
+ } finally {
+ try {
+ if (stream != null)
+ stream.close();
+ } catch (IOException ioe) {
+ // log.warn( "could not close input stream for: " + resourceName, ioe );
+ }
+ }
+ } else {
+ if (configXMLFile != null) {
+ return localCfg.configure(configXMLFile);
+ } else {
+ Configuration resultCfg = localCfg;
+ if (checkHibernateResoureExistence("/hibernate.cfg.xml")) { //$NON-NLS-1$
+ resultCfg = localCfg.configure();
+ }
+ return resultCfg;
+ }
+ }
+ }
+
+ private boolean checkHibernateResoureExistence(String resource) {
+ InputStream is = null;
+ try {
+ is = ConfigHelper.getResourceAsStream(resource);
+ } catch (HibernateException e) {
+ // just ignore
+ } finally {
+ try {
+ if (is != null)
+ is.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ return (is != null);
+ }
+
+ private Configuration configureConnectionProfile(Configuration localCfg) {
+ String connectionProfile = prefs.getConnectionProfileName();
+ if (connectionProfile == null) {
+ return localCfg;
+ }
+ IConnectionProfile profile = ProfileManager.getInstance().getProfileByName(
+ connectionProfile);
+ if (profile != null) {
+ refreshProfile(profile);
+ //
+ final Properties invokeProperties = localCfg.getProperties();
+ // set this property to null!
+ invokeProperties.remove(Environment.DATASOURCE);
+ localCfg.setProperties(invokeProperties);
+ Properties cpProperties = profile.getProperties(profile.getProviderId());
+ // seems we should not setup dialect here
+ // String dialect =
+ // "org.hibernate.dialect.HSQLDialect";//cpProperties.getProperty("org.eclipse.datatools.connectivity.db.driverClass");
+ // invoke.setProperty(Environment.DIALECT, dialect);
+ String driver = cpProperties
+ .getProperty("org.eclipse.datatools.connectivity.db.driverClass"); //$NON-NLS-1$
+ localCfg.setProperty(Environment.DRIVER, driver);
+ // TODO:
+ @SuppressWarnings("unused")
+ String driverJarPath = cpProperties.getProperty("jarList"); //$NON-NLS-1$
+ String url = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.URL"); //$NON-NLS-1$
+ // url += "/";// +
+ // cpProperties.getProperty("org.eclipse.datatools.connectivity.db.databaseName");
+ localCfg.setProperty(Environment.URL, url);
+ String user = cpProperties
+ .getProperty("org.eclipse.datatools.connectivity.db.username"); //$NON-NLS-1$
+ if (null != user && user.length() > 0) {
+ localCfg.setProperty(Environment.USER, user);
+ }
+ String pass = cpProperties
+ .getProperty("org.eclipse.datatools.connectivity.db.password"); //$NON-NLS-1$
+ if (null != pass && pass.length() > 0) {
+ localCfg.setProperty(Environment.PASS, pass);
+ }
+ } else {
+ String out = NLS.bind(
+ Messages.ConsoleConfiguration_connection_profile_not_found,
+ connectionProfile);
+ throw new HibernateConsoleRuntimeException(out, null);
+ }
+ return localCfg;
+ }
+
+ @SuppressWarnings("unused")
+ private void autoConfigureDialect(Configuration localCfg) {
+ if (localCfg.getProperty(Environment.DIALECT) == null) {
+ String url = localCfg.getProperty(Environment.URL);
+ String user = localCfg.getProperty(Environment.USER);
+ String pass = localCfg.getProperty(Environment.PASS);
+ Connection connection = null;
+ try {
+ connection = DriverManager.getConnection(url, user, pass);
+ // SQL Dialect:
+ Dialect dialect = DialectFactory.buildDialect(localCfg.getProperties(), connection);
+ localCfg.setProperty(Environment.DIALECT, dialect.toString());
+ } catch (SQLException e) {
+ // can't determine dialect
+ }
+ if (connection != null) {
+ try {
+ connection.close();
+ } catch (SQLException e) {
+ // ignore
+ }
+ }
+ }
+ }
+
+ public static void refreshProfile(IConnectionProfile profile) {
+ // refresh profile (refresh jpa connection):
+ // get fresh information about current db structure and update error markers
+ if (profile.getConnectionState() == IConnectionProfile.CONNECTED_STATE) {
+ profile.disconnect(null);
+ }
+ profile.connect(null);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,48 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.hibernate.cfg.JDBCMetaDataConfiguration;
+
+public class ConfigurationStubJDBCMetaData extends ConfigurationStub {
+
+ protected JDBCMetaDataConfiguration jdbcMetaDataConfiguration;
+
+ protected ConfigurationStubJDBCMetaData(JDBCMetaDataConfiguration configuration) {
+ super(configuration);
+ jdbcMetaDataConfiguration = configuration;
+ }
+
+ public void setProperties(Properties properties) {
+ jdbcMetaDataConfiguration.setProperties(properties);
+ }
+
+ public void setPreferBasicCompositeIds(boolean flag) {
+ jdbcMetaDataConfiguration.setPreferBasicCompositeIds(flag);
+ }
+
+ public void setReverseEngineeringStrategy(ReverseEngineeringStrategyStub reverseEngineeringStrategy) {
+ jdbcMetaDataConfiguration.setReverseEngineeringStrategy(reverseEngineeringStrategy.reverseEngineeringStrategy);
+ }
+
+ public void readFromJDBC() {
+ jdbcMetaDataConfiguration.readFromJDBC();
+ }
+
+ public ArrayList<TableStub> getTableMappingsArr() {
+ ArrayList<TableStub> arr = new ArrayList<TableStub>();
+ Iterator<?> it = jdbcMetaDataConfiguration.getTableMappings();
+ while (it.hasNext() ) {
+ Object table = it.next();
+ arr.add(new TableStub(table));
+ }
+ return arr;
+ }
+
+ public Iterator<TableStub> getTableMappingsIt() {
+ return getTableMappingsArr().iterator();
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,15 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.connection.ConnectionProvider;
+
+public class ConnectionProviderStub {
+ protected ConnectionProvider connectionProvider;
+
+ protected ConnectionProviderStub(Object connectionProvider) {
+ this.connectionProvider = (ConnectionProvider)connectionProvider;
+ }
+
+ public void close() {
+ connectionProvider.close();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,39 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.hibernate.cfg.reveng.DefaultDatabaseCollector;
+import org.hibernate.mapping.Table;
+
+public class DefaultDatabaseCollectorStub {
+ protected DefaultDatabaseCollector defaultDatabaseCollector;
+
+ protected DefaultDatabaseCollectorStub(Object defaultDatabaseCollector) {
+ this.defaultDatabaseCollector = (DefaultDatabaseCollector)defaultDatabaseCollector;
+ }
+
+ public static DefaultDatabaseCollectorStub newInstance() {
+ return new DefaultDatabaseCollectorStub(new DefaultDatabaseCollector());
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<Entry<String, List<TableStub>>> getQualifierEntries() {
+ Iterator<Map.Entry<String, List<Table>>> it = defaultDatabaseCollector.getQualifierEntries();
+ HashMap<String, List<TableStub>> map = new HashMap<String, List<TableStub>>();
+ while (it.hasNext()) {
+ Map.Entry<String, List<Table>> entry = it.next();
+ ArrayList<TableStub> arr = new ArrayList<TableStub>();
+ Iterator<Table> itValue = (Iterator<Table>)entry.getValue().iterator();
+ while (itValue.hasNext()) {
+ arr.add(new TableStub(itValue.next()));
+ }
+ map.put(entry.getKey(), arr);
+ }
+ return map.entrySet().iterator();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,17 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
+
+public class DefaultReverseEngineeringStrategyStub extends ReverseEngineeringStrategyStub {
+
+ protected DefaultReverseEngineeringStrategy defaultReverseEngineeringStrategy;
+
+ protected DefaultReverseEngineeringStrategyStub(Object defaultReverseEngineeringStrategy) {
+ super(defaultReverseEngineeringStrategy);
+ this.defaultReverseEngineeringStrategy = (DefaultReverseEngineeringStrategy)defaultReverseEngineeringStrategy;
+ }
+
+ public static DefaultReverseEngineeringStrategyStub newInstance() {
+ return new DefaultReverseEngineeringStrategyStub(new DefaultReverseEngineeringStrategy());
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,13 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.DependantValue;
+
+public class DependantValueStub extends SimpleValueStub {
+ protected DependantValue dependantValue;
+
+ protected DependantValueStub(Object dependantValue) {
+ super(dependantValue);
+ this.dependantValue = (DependantValue)dependantValue;
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,15 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.dialect.Dialect;
+
+public class DialectStub {
+ protected Dialect dialect;
+
+ protected DialectStub(Object dialect) {
+ this.dialect = (Dialect)dialect;
+ }
+
+ public static DialectStub newInstance(final String dialectName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+ return new DialectStub(Class.forName(dialectName).newInstance());
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,16 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.EntityMode;
+
+public class EntityModeStub {
+
+ public static final EntityModeStub POJO = new EntityModeStub(EntityMode.POJO);
+ public static final EntityModeStub DOM4J = new EntityModeStub(EntityMode.DOM4J);
+ public static final EntityModeStub MAP = new EntityModeStub(EntityMode.MAP);
+
+ protected EntityMode entityMode;
+
+ protected EntityModeStub(Object entityMode) {
+ this.entityMode = (EntityMode)entityMode;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,20 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.EntityType;
+
+public class EntityTypeStub extends AbstractTypeStub {
+ protected EntityType entityType;
+
+ protected EntityTypeStub(Object entityType) {
+ super(entityType);
+ this.entityType = (EntityType)entityType;
+ }
+
+ public String getAssociatedEntityName() {
+ return entityType.getAssociatedEntityName();
+ }
+
+ public boolean isOneToOne() {
+ return entityType.isOneToOne();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,19 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.EnumType;
+
+public class EnumTypeStub {
+
+ public static final String ENUM = EnumType.ENUM;
+ public static final String TYPE = EnumType.TYPE;
+
+ protected EnumType enumType;
+
+ protected EnumTypeStub(Object enumType) {
+ this.enumType = (EnumType)enumType;
+ }
+
+ public static String getClassName() {
+ return EnumType.class.getName();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,46 @@
+package org.hibernate.mediator.stubs;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.hibernate.cfg.Environment;
+
+public class EnvironmentStub {
+ public static final String DIALECT = Environment.DIALECT;
+ public static final String DEFAULT_CATALOG = Environment.DEFAULT_CATALOG;
+ public static final String DEFAULT_SCHEMA = Environment.DEFAULT_SCHEMA;
+ public static final String DRIVER = Environment.DRIVER;
+ public static final String PASS = Environment.PASS;
+ public static final String SESSION_FACTORY_NAME = Environment.SESSION_FACTORY_NAME;
+ public static final String URL = Environment.URL;
+ public static final String USER = Environment.USER;
+
+ @SuppressWarnings("unchecked")
+ public static String[] extractHibernateProperties() {
+ try {
+ // TODO: extract property names from the Environment class in the users hibernate
+ // configuration.
+ Class cl = Environment.class;
+ List<String> names = new ArrayList<String>();
+ Field[] fields = cl.getFields();
+ for (int i = 0; i < fields.length; i++) {
+ Field field = fields[i];
+ if (Modifier.isStatic(field.getModifiers()) && field.getType().equals(String.class)) {
+ String str = (String) field.get(cl);
+ if (str.startsWith("hibernate.")) { //$NON-NLS-1$
+ names.add(str);
+ }
+ }
+ }
+ String[] propertyNames = (String[]) names.toArray(new String[names.size()]);
+ Arrays.sort(propertyNames);
+ return propertyNames;
+ } catch (IllegalAccessException iae) {
+ // ignore
+ return new String[0];
+ }
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,47 @@
+package org.hibernate.mediator.stubs;
+
+import java.io.File;
+import java.util.Properties;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.tool.hbm2x.Exporter;
+
+public class ExporterStub {
+
+ protected Exporter exporter;
+
+ protected ExporterStub(Object exporter) {
+ this.exporter = (Exporter)exporter;
+ }
+
+ public void start() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setConfiguration(Configuration configuration) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setProperties(Properties props) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setArtifactCollector(ArtifactCollectorStub collector) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setOutputDirectory(File file) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setTemplatePath(String[] array) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FetchModeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FetchModeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FetchModeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,8 @@
+package org.hibernate.mediator.stubs;
+
+public enum FetchModeStub {
+ DEFAULT,
+ SELECT,
+ JOIN,
+ SUBSELECT
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,49 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hibernate.mapping.Column;
+import org.hibernate.mapping.ForeignKey;
+
+public class ForeignKeyStub {
+ protected ForeignKey foreignKey;
+
+ protected ForeignKeyStub(Object foreignKey) {
+ this.foreignKey = (ForeignKey)foreignKey;
+ }
+
+ public boolean containsColumn(ColumnStub column) {
+ return foreignKey.containsColumn(column.column);
+ }
+
+ public TableStub getReferencedTable() {
+ return new TableStub(foreignKey.getReferencedTable());
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<ColumnStub> columnIterator() {
+ Iterator<Column> it = (Iterator<Column>)foreignKey.getColumnIterator();
+ ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
+ while (it.hasNext()) {
+ al.add(new ColumnStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<ColumnStub> getReferencedColumns() {
+ Iterator<Column> it = foreignKey.getReferencedColumns().iterator();
+ ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
+ while (it.hasNext()) {
+ al.add(new ColumnStub(it.next()));
+ }
+ return al;
+ }
+
+ public boolean isReferenceToPrimaryKey() {
+ return foreignKey.isReferenceToPrimaryKey();
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,28 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.tool.hbm2x.GenericExporter;
+
+public class GenericExporterStub extends ExporterStub {
+ protected GenericExporter genericExporter;
+
+ protected GenericExporterStub(Object genericExporter) {
+ super(genericExporter);
+ this.genericExporter = (GenericExporter)genericExporter;
+ }
+
+ public void setFilePattern(String property) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setTemplateName(String property) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setForEach(String property) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,50 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.tool.ide.completion.HQLCompletionProposal;
+
+public class HQLCompletionProposalStub {
+
+ public static final int ENTITY_NAME = HQLCompletionProposal.ENTITY_NAME;
+ public static final int PROPERTY = HQLCompletionProposal.PROPERTY;
+ public static final int KEYWORD = HQLCompletionProposal.KEYWORD;
+ public static final int FUNCTION = HQLCompletionProposal.FUNCTION;
+ public static final int ALIAS_REF = HQLCompletionProposal.ALIAS_REF;
+
+ protected HQLCompletionProposal hqlCompletionProposal;
+
+ protected HQLCompletionProposalStub(Object hqlCompletionProposal) {
+ this.hqlCompletionProposal = (HQLCompletionProposal)hqlCompletionProposal;
+ }
+
+ public String getCompletion() {
+ return hqlCompletionProposal.getCompletion();
+ }
+
+ public int getReplaceStart() {
+ return hqlCompletionProposal.getReplaceStart();
+ }
+
+ public int getReplaceEnd() {
+ return hqlCompletionProposal.getReplaceEnd();
+ }
+
+ public int getCompletionKind() {
+ return hqlCompletionProposal.getCompletionKind();
+ }
+
+ public String getEntityName() {
+ return hqlCompletionProposal.getEntityName();
+ }
+
+ public String getSimpleName() {
+ return hqlCompletionProposal.getSimpleName();
+ }
+
+ public String getShortEntityName() {
+ return hqlCompletionProposal.getShortEntityName();
+ }
+
+ public PropertyStub getProperty() {
+ return new PropertyStub(hqlCompletionProposal.getProperty());
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,29 @@
+package org.hibernate.mediator.stubs;
+
+import java.io.StringWriter;
+import java.util.Properties;
+
+import org.hibernate.tool.hbm2x.HibernateConfigurationExporter;
+
+public class HibernateConfigurationExporterStub extends ExporterStub {
+ protected HibernateConfigurationExporter hibernateConfigurationExporter;
+
+ protected HibernateConfigurationExporterStub(Object hibernateConfigurationExporter) {
+ super(hibernateConfigurationExporter);
+ this.hibernateConfigurationExporter = (HibernateConfigurationExporter)hibernateConfigurationExporter;
+ }
+
+ public static HibernateConfigurationExporterStub newInstance() {
+ return new HibernateConfigurationExporterStub(new HibernateConfigurationExporter());
+ }
+
+ public void setCustomProperties(Properties props) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setOutput(StringWriter stringWriter) {
+ // TODO Auto-generated method stub
+
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConsoleRuntimeException.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConsoleRuntimeException.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConsoleRuntimeException.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator.stubs;
+
+/**
+ * @author max
+ *
+ */
+public class HibernateConsoleRuntimeException extends RuntimeException {
+
+ private static final long serialVersionUID = -9056528343206573782L;
+
+ public HibernateConsoleRuntimeException(Throwable cause) {
+ super("HibernateConsoleRuntimeException", cause); //$NON-NLS-1$
+ }
+
+ public HibernateConsoleRuntimeException(String message) {
+ super(message);
+ }
+
+ public HibernateConsoleRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,63 @@
+package org.hibernate.mediator.stubs;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import org.hibernate.tool.hbm2x.HibernateMappingExporter;
+
+public class HibernateMappingExporterStub {
+
+ protected HibernateMappingExporter hibernateMappingExporter;
+
+ protected HibernateMappingExporterStub(ConfigurationStub cfg, File outputdir) {
+ hibernateMappingExporter = new HibernateMappingExporter(cfg.configuration, outputdir);
+ }
+
+ public void setGlobalSettings(HibernateMappingGlobalSettingsStub hmgs) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void start() {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected File getOutputDirectory() {
+ return hibernateMappingExporter.getOutputDirectory();
+ }
+
+ protected void setOutputDirectory(File outputdir) {
+ hibernateMappingExporter.setOutputDirectory(outputdir);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void exportPOJO(Map additionalContext, POJOClassStub element) {
+ // TODO: protected - call via reflection
+ Method m = null;
+ try {
+ m = hibernateMappingExporter.getClass().getDeclaredMethod("exportPOJO");//$NON-NLS-1$
+ } catch (SecurityException e) {
+ //TODO:
+ } catch (NoSuchMethodException e) {
+ //TODO:
+ }
+ m.setAccessible(true);
+ try {
+ m.invoke(hibernateMappingExporter, additionalContext, element.pojoClass);
+ } catch (IllegalArgumentException e) {
+ //TODO:
+ } catch (IllegalAccessException e) {
+ //TODO:
+ } catch (InvocationTargetException e) {
+ //TODO:
+ }
+ }
+
+ public ArtifactCollectorStub getArtifactCollector() {
+ return new ArtifactCollectorStub(hibernateMappingExporter.getArtifactCollector());
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings;
+
+public class HibernateMappingGlobalSettingsStub {
+
+ protected HibernateMappingGlobalSettings hibernateMappingGlobalSettings;
+
+ protected HibernateMappingGlobalSettingsStub(Object hibernateMappingGlobalSettings) {
+ this.hibernateMappingGlobalSettings = (HibernateMappingGlobalSettings)hibernateMappingGlobalSettings;
+ }
+
+ public static HibernateMappingGlobalSettingsStub newInstance() {
+ return new HibernateMappingGlobalSettingsStub(new HibernateMappingGlobalSettings());
+ }
+
+ public void setDefaultAccess(String string) {
+ // TODO Auto-generated method stub
+
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,39 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.Hibernate;
+
+public class HibernateStub {
+ public static final NullableTypeStub BOOLEAN = new NullableTypeStub(Hibernate.BOOLEAN);
+ public static final NullableTypeStub BYTE = new NullableTypeStub(Hibernate.BYTE);
+ public static final NullableTypeStub BIG_INTEGER = new NullableTypeStub(Hibernate.BIG_INTEGER);
+ public static final NullableTypeStub SHORT = new NullableTypeStub(Hibernate.SHORT);
+ public static final NullableTypeStub CALENDAR = new NullableTypeStub(Hibernate.CALENDAR);
+ public static final NullableTypeStub CALENDAR_DATE = new NullableTypeStub(Hibernate.CALENDAR_DATE);
+ public static final NullableTypeStub INTEGER = new NullableTypeStub(Hibernate.INTEGER);
+ public static final NullableTypeStub BIG_DECIMAL = new NullableTypeStub(Hibernate.BIG_DECIMAL);
+ public static final NullableTypeStub CHARACTER = new NullableTypeStub(Hibernate.CHARACTER);
+ public static final NullableTypeStub CLASS = new NullableTypeStub(Hibernate.CLASS);
+ public static final NullableTypeStub CURRENCY = new NullableTypeStub(Hibernate.CURRENCY);
+ public static final NullableTypeStub DATE = new NullableTypeStub(Hibernate.DATE);
+ public static final NullableTypeStub DOUBLE = new NullableTypeStub(Hibernate.DOUBLE);
+ public static final NullableTypeStub FLOAT = new NullableTypeStub(Hibernate.FLOAT);
+ public static final NullableTypeStub LOCALE = new NullableTypeStub(Hibernate.LOCALE);
+ public static final NullableTypeStub LONG = new NullableTypeStub(Hibernate.LONG);
+ public static final NullableTypeStub STRING = new NullableTypeStub(Hibernate.STRING);
+ public static final NullableTypeStub TEXT = new NullableTypeStub(Hibernate.TEXT);
+ public static final NullableTypeStub TIME = new NullableTypeStub(Hibernate.TIME);
+ public static final NullableTypeStub TIMESTAMP = new NullableTypeStub(Hibernate.TIMESTAMP);
+ public static final NullableTypeStub TIMEZONE = new NullableTypeStub(Hibernate.TIMEZONE);
+ public static final NullableTypeStub TRUE_FALSE = new NullableTypeStub(Hibernate.TRUE_FALSE);
+ public static final NullableTypeStub YES_NO = new NullableTypeStub(Hibernate.YES_NO);
+
+ protected Hibernate hibernate;
+
+ protected HibernateStub(Object hibernate) {
+ this.hibernate = (Hibernate)hibernate;
+ }
+
+ public static boolean isInitialized(Object proxy) {
+ return Hibernate.isInitialized(proxy);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,7 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.hql.antlr.HqlSqlTokenTypes;
+
+public class HqlSqlTokenTypesStub {
+ public static final int IDENT = HqlSqlTokenTypes.IDENT;
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,19 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.tool.ide.completion.HQLCodeAssist;
+
+public class IHQLCodeAssistStub {
+ protected HQLCodeAssist hqlCodeAssist;
+
+ protected IHQLCodeAssistStub(Object hqlCodeAssist) {
+ this.hqlCodeAssist = (HQLCodeAssist)hqlCodeAssist;
+ }
+
+ public static IHQLCodeAssistStub createHQLCodeAssist() {
+ return new IHQLCodeAssistStub(new HQLCodeAssist(null));
+ }
+
+ public void codeComplete(String query, int position, IHQLCompletionRequestorStub requestor) {
+ hqlCodeAssist.codeComplete(query, position, requestor.hqlCompletionRequestor);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,26 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.tool.ide.completion.HQLCompletionProposal;
+import org.hibernate.tool.ide.completion.IHQLCompletionRequestor;
+
+public abstract class IHQLCompletionRequestorStub {
+
+ protected IHQLCompletionRequestor hqlCompletionRequestor;
+
+ protected IHQLCompletionRequestorStub() {
+ hqlCompletionRequestor = new IHQLCompletionRequestor() {
+
+ public boolean accept(HQLCompletionProposal proposal) {
+ return IHQLCompletionRequestorStub.this.accept(new HQLCompletionProposalStub(proposal));
+ }
+
+ public void completionFailure(String errorMessage) {
+ IHQLCompletionRequestorStub.this.completionFailure(errorMessage);
+ }
+
+ };
+ }
+
+ public abstract boolean accept(HQLCompletionProposalStub proposal);
+ public abstract void completionFailure(String errorMessage);
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,18 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.IdentifierBag;
+
+public class IdentifierBagStub extends IdentifierCollectionStub {
+ protected IdentifierBag identifierBag;
+
+ protected IdentifierBagStub(Object identifierBag) {
+ super(identifierBag);
+ this.identifierBag = (IdentifierBag)identifierBag;
+ }
+
+ @Override
+ public Object accept(ValueVisitorStub visitor) {
+ return visitor.accept(this);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,13 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.IdentifierCollection;
+
+public abstract class IdentifierCollectionStub extends CollectionStub {
+ protected IdentifierCollection identifierCollection;
+
+ protected IdentifierCollectionStub(Object identifierCollection) {
+ super(identifierCollection);
+ this.identifierCollection = (IdentifierCollection)identifierCollection;
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,13 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.ImmutableType;
+
+public class ImmutableTypeStub extends NullableTypeStub {
+
+ protected ImmutableType immutableType;
+
+ protected ImmutableTypeStub(Object immutableType) {
+ super(immutableType);
+ this.immutableType = (ImmutableType)immutableType;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,18 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.IndexedCollection;
+
+public abstract class IndexedCollectionStub extends CollectionStub {
+
+ protected IndexedCollection indexedCollection;
+
+ protected IndexedCollectionStub(Object indexedCollection) {
+ super(indexedCollection);
+ this.indexedCollection = (IndexedCollection)indexedCollection;
+ }
+
+ public void setIndex(ValueStub index) {
+ indexedCollection.setIndex(index.value);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,13 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.IntegerType;
+
+public class IntegerTypeStub extends PrimitiveTypeStub {
+
+ protected IntegerType integerType;
+
+ protected IntegerTypeStub(Object integerType) {
+ super(integerType);
+ this.integerType = (IntegerType)integerType;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,25 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.hibernate.cfg.JDBCReaderFactory;
+import org.hibernate.cfg.reveng.JDBCReader;
+
+public class JDBCReaderStub {
+
+ protected JDBCReader jdbcReader;
+
+ protected JDBCReaderStub(Properties cfg, SettingsStub settings, ReverseEngineeringStrategyStub revengStrategy) {
+ jdbcReader = JDBCReaderFactory.newJDBCReader(cfg, settings.settings, revengStrategy.reverseEngineeringStrategy);
+ }
+
+ public static JDBCReaderStub newInstance(Properties cfg, SettingsStub settings, ReverseEngineeringStrategyStub revengStrategy) {
+ return new JDBCReaderStub(cfg, settings, revengStrategy);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List readDatabaseSchema(DefaultDatabaseCollectorStub dbs, String catalog, String schema, ProgressListenerStub progress) {
+ return jdbcReader.readDatabaseSchema(dbs.defaultDatabaseCollector, catalog, schema, progress.progressListener);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,25 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper;
+
+public class JDBCToHibernateTypeHelperStub {
+
+ public static String getJDBCTypeName(int intValue) {
+ return JDBCToHibernateTypeHelper.getJDBCTypeName(intValue);
+ }
+
+ public static String getPreferredHibernateType(int intValue, int length, int precision,
+ int scale, boolean nullability, boolean b) {
+ return JDBCToHibernateTypeHelper.getPreferredHibernateType(intValue,
+ length, precision, scale, nullability, b);
+ }
+
+ public static boolean typeHasLength(int intValue) {
+ return JDBCToHibernateTypeHelper.typeHasLength(intValue);
+ }
+
+ public static boolean typeHasScaleAndPrecision(int intValue) {
+ return JDBCToHibernateTypeHelper.typeHasScaleAndPrecision(intValue);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,25 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.hibernate.mapping.Join;
+import org.hibernate.mapping.Property;
+
+public class JoinStub {
+ protected Join join;
+
+ protected JoinStub(Object join) {
+ this.join = (Join)join;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<PropertyStub> getPropertyIterator() {
+ Iterator<Property> it = (Iterator<Property>)join.getPropertyIterator();
+ ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
+ while (it.hasNext()) {
+ al.add(new PropertyStub(it.next()));
+ }
+ return al.iterator();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,26 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.JoinedSubclass;
+
+public class JoinedSubclassStub extends SubclassStub {
+
+ protected JoinedSubclass joinedSubclass;
+
+ protected JoinedSubclassStub(Object joinedSubclass) {
+ super(joinedSubclass);
+ this.joinedSubclass = (JoinedSubclass)joinedSubclass;
+ }
+
+ public static JoinedSubclassStub newInstance(PersistentClassStub persistentClass) {
+ return new JoinedSubclassStub(persistentClass);
+ }
+
+ public void setTable(TableStub table) {
+ joinedSubclass.setTable(table.getTable());
+ }
+
+ public void setKey(KeyValueStub key) {
+ joinedSubclass.setKey(key.keyValue);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,16 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.KeyValue;
+
+public abstract class KeyValueStub extends ValueStub {
+ protected KeyValue keyValue;
+
+ protected KeyValueStub(Object keyValue) {
+ super(keyValue);
+ this.keyValue = (KeyValue)keyValue;
+ }
+
+ @Override
+ public abstract Object accept(ValueVisitorStub visitor);
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,26 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.List;
+
+public class ListStub extends IndexedCollectionStub {
+ protected List list;
+
+ protected ListStub(Object list) {
+ super(list);
+ this.list = (List)list;
+ }
+
+ public static ListStub newInstance(PersistentClassStub owner) {
+ return new ListStub(new List(owner.persistentClass));
+ }
+
+ @Override
+ public Object accept(ValueVisitorStub visitor) {
+ return visitor.accept(this);
+ }
+
+ public ValueStub getIndex() {
+ return ValueStubFactory.createValueStub(list.getIndex());
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.ManyToOne;
+
+public class ManyToOneStub extends ToOneStub {
+ protected ManyToOne manyToOne;
+
+ protected ManyToOneStub(Object manyToOne) {
+ super(manyToOne);
+ this.manyToOne = (ManyToOne)manyToOne;
+ }
+
+ public static ManyToOneStub newInstance(TableStub table) {
+ return new ManyToOneStub(new ManyToOne(table.table));
+ }
+
+ public String getReferencedEntityName() {
+ return manyToOne.getReferencedEntityName();
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MapStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MapStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MapStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.Map;
+
+public class MapStub extends IndexedCollectionStub {
+ protected Map map;
+
+ protected MapStub(Object map) {
+ super(map);
+ this.map = (Map)map;
+ }
+
+ public static MapStub newInstance(PersistentClassStub owner) {
+ return new MapStub(new Map(owner.persistentClass));
+ }
+
+ @Override
+ public Object accept(ValueVisitorStub visitor) {
+ return visitor.accept(this);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,11 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.engine.Mapping;
+
+public class MappingStub {
+ protected Mapping mapping;
+
+ protected MappingStub(Object mapping) {
+ this.mapping = (Mapping)mapping;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,15 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.Mappings;
+
+public class MappingsStub {
+ protected Mappings mappings;
+
+ protected MappingsStub(Object mappings) {
+ this.mappings = (Mappings)mappings;
+ }
+
+ public void addClass(PersistentClassStub persistentClass) {
+ mappings.addClass(persistentClass.getPersistentClass());
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,53 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.NamingStrategy;
+
+public class NamingStrategyStub {
+ protected NamingStrategy namingStrategy;
+
+ protected NamingStrategyStub(Object namingStrategy) {
+ this.namingStrategy = (NamingStrategy)namingStrategy;
+ }
+
+ @SuppressWarnings("nls")
+ public static String getClassName() {
+ return "org.hibernate.cfg.NamingStrategy";
+ }
+
+ public String classToTableName(String className) {
+ return namingStrategy.classToTableName(className);
+ }
+
+ public String tableName(String tableName) {
+ return namingStrategy.tableName(tableName);
+ }
+
+ public String columnName(String columnName) {
+ return namingStrategy.columnName(columnName);
+ }
+
+ public String propertyToColumnName(String propertyName) {
+ return namingStrategy.propertyToColumnName(propertyName);
+ }
+
+ public String joinKeyColumnName(String joinedColumn, String joinedTable) {
+ return namingStrategy.joinKeyColumnName(joinedColumn, joinedTable);
+ }
+
+ public String collectionTableName(String ownerEntity, String ownerEntityTable,
+ String associatedEntity, String associatedEntityTable,
+ String propertyName) {
+ return namingStrategy.collectionTableName(ownerEntity, ownerEntityTable,
+ associatedEntity, associatedEntityTable, propertyName);
+ }
+
+ public String logicalColumnName(String columnName, String propertyName) {
+ return namingStrategy.logicalColumnName(columnName, propertyName);
+ }
+
+ public String foreignKeyColumnName(String propertyName, String propertyEntityName,
+ String propertyTableName, String referencedColumnName) {
+ return namingStrategy.foreignKeyColumnName(propertyName,
+ propertyEntityName, propertyTableName, referencedColumnName);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.NullableType;
+
+public class NullableTypeStub extends AbstractTypeStub {
+
+ protected NullableType nullableType;
+
+ protected NullableTypeStub(Object nullableType) {
+ super(nullableType);
+ this.nullableType = (NullableType)nullableType;
+ }
+
+ public String toString(Object value) {
+ return nullableType.toString(value);
+ }
+
+ public Object fromStringValue(String xml) {
+ return nullableType.fromStringValue(xml);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,36 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.OneToMany;
+
+public class OneToManyStub extends ValueStub {
+ protected OneToMany oneToMany;
+
+ protected OneToManyStub(Object oneToMany) {
+ super(oneToMany);
+ this.oneToMany = (OneToMany)oneToMany;
+ }
+
+ public static OneToManyStub newInstance(PersistentClassStub owner) {
+ return new OneToManyStub(new OneToMany(owner.persistentClass));
+ }
+
+ public void setAssociatedClass(PersistentClassStub associatedClass) {
+ oneToMany.setAssociatedClass(associatedClass.persistentClass);
+ }
+
+ public void setReferencedEntityName(String referencedEntityName) {
+ oneToMany.setReferencedEntityName(referencedEntityName);
+ }
+
+ public PersistentClassStub getAssociatedClass() {
+ return PersistentClassStubFactory.createPersistentClassStub(oneToMany.getAssociatedClass());
+ }
+
+ public Object accept(ValueVisitorStub visitor) {
+ return visitor.accept(this);
+ }
+
+ public String getReferencedEntityName() {
+ return oneToMany.getReferencedEntityName();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.OneToOne;
+
+public class OneToOneStub extends ToOneStub {
+ protected OneToOne oneToOne;
+
+ protected OneToOneStub(Object oneToOne) {
+ super(oneToOne);
+ this.oneToOne = (OneToOne)oneToOne;
+ }
+
+ public static OneToOneStub newInstance(TableStub table, PersistentClassStub owner) {
+ return new OneToOneStub(new OneToOne(table.table, owner.persistentClass));
+ }
+
+ public String getEntityName() {
+ return oneToOne.getEntityName();
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import java.io.File;
+
+public class OverrideRepositoryStub {
+
+ public void addFile(File file) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public ReverseEngineeringStrategyStub getReverseEngineeringStrategy(
+ ReverseEngineeringStrategyStub res) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void addTableFilter(TableFilterStub tf) {
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,18 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.tool.hbm2x.pojo.POJOClass;
+
+public class POJOClassStub {
+
+ protected POJOClass pojoClass;
+
+ protected POJOClassStub(Object pojoClass) {
+ this.pojoClass = (POJOClass)pojoClass;
+ }
+
+ public String getQualifiedDeclarationName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,98 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.hibernate.mapping.Join;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
+
+public abstract class PersistentClassStub {
+ protected PersistentClass persistentClass;
+
+ protected PersistentClassStub(Object persistentClass) {
+ this.persistentClass = (PersistentClass)persistentClass;
+ }
+
+ protected PersistentClass getPersistentClass() {
+ return persistentClass;
+ }
+
+ public Boolean isAbstract() {
+ return persistentClass.isAbstract();
+ }
+
+ public ValueStub getDiscriminator() {
+ return ValueStubFactory.createValueStub(persistentClass.getDiscriminator());
+ }
+
+ public String getClassName() {
+ return persistentClass.getClassName();
+ }
+
+ public String getEntityName() {
+ return persistentClass.getEntityName();
+ }
+
+ public PropertyStub getIdentifierProperty() {
+ return new PropertyStub(persistentClass.getIdentifierProperty());
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<PropertyStub> getPropertyIterator() {
+ Iterator<Property> it = persistentClass.getPropertyIterator();
+ ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
+ while (it.hasNext()) {
+ al.add(new PropertyStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ public RootClassStub getRootClass() {
+ return new RootClassStub(persistentClass.getRootClass());
+ }
+
+ public PropertyStub getVersion() {
+ return new PropertyStub(persistentClass.getVersion());
+ }
+
+ public TableStub getTable() {
+ return new TableStub(persistentClass.getTable());
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<JoinStub> getJoinIterator() {
+ Iterator<Join> it = (Iterator<Join>)persistentClass.getJoinIterator();
+ ArrayList<JoinStub> al = new ArrayList<JoinStub>();
+ while (it.hasNext()) {
+ al.add(new JoinStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ public KeyValueStub getIdentifier() {
+ return (KeyValueStub)ValueStubFactory.createValueStub(persistentClass.getIdentifier());
+ }
+
+ public PersistentClassStub getSuperclass() {
+ return PersistentClassStubFactory.createPersistentClassStub(persistentClass.getSuperclass());
+ }
+
+ public PropertyStub getProperty(String propertyName) {
+ return new PropertyStub(persistentClass.getProperty(propertyName));
+ }
+
+ public String getNodeName() {
+ return persistentClass.getNodeName();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<PropertyStub> getPropertyClosureIterator() {
+ Iterator<Property> it = (Iterator<Property>)persistentClass.getPropertyClosureIterator();
+ ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
+ while (it.hasNext()) {
+ al.add(new PropertyStub(it.next()));
+ }
+ return al.iterator();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStubFactory.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStubFactory.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,26 @@
+package org.hibernate.mediator.stubs;
+
+public class PersistentClassStubFactory {
+ @SuppressWarnings("unchecked")
+ public static PersistentClassStub createPersistentClassStub(Object value) {
+ final Class cl = value.getClass();
+ if (0 == "org.hibernate.mapping.RootClass".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new RootClassStub(value);
+ //} else if (0 == "org.hibernate.mapping.PersistentClass".compareTo(cl.getName())) { //$NON-NLS-1$
+ // return new PersistentClassStub(value);
+ } else if (0 == "org.hibernate.mapping.Subclass".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new SubclassStub(value);
+ } else if (0 == "org.hibernate.mapping.JoinedSubclass".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new JoinedSubclassStub(value);
+ } else if (0 == "org.hibernate.mapping.SingleTableSubclass".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new SingleTableSubclassStub(value);
+ //} else if (0 == "org.hibernate.mapping.UnionSubclass".compareTo(cl.getName())) { //$NON-NLS-1$
+ // return new UnionSubclassStub(value);
+ }
+ return null;
+ }
+
+ public static PersistentClassStub createPersistentClassStub(PersistentClassStub value) {
+ return createPersistentClassStub(value.persistentClass);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,57 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hibernate.mapping.Column;
+import org.hibernate.mapping.PrimaryKey;
+
+public class PrimaryKeyStub {
+ protected PrimaryKey primaryKey;
+
+ protected PrimaryKeyStub(Object primaryKey) {
+ this.primaryKey = (PrimaryKey)primaryKey;
+ }
+
+ public boolean containsColumn(ColumnStub column) {
+ return primaryKey.containsColumn(column.column);
+ }
+
+ public String getName() {
+ return primaryKey.getName();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<ColumnStub> columnIterator() {
+ Iterator<Column> it = (Iterator<Column>)primaryKey.getColumnIterator();
+ ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
+ while (it.hasNext()) {
+ al.add(new ColumnStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<ColumnStub> getColumns() {
+ Iterator<Column> it = (Iterator<Column>)primaryKey.getColumnIterator();
+ ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
+ while (it.hasNext()) {
+ al.add(new ColumnStub(it.next()));
+ }
+ return al;
+ }
+
+ public int getColumnSpan() {
+ return primaryKey.getColumnSpan();
+ }
+
+ public ColumnStub getColumn(int i) {
+ return new ColumnStub(primaryKey.getColumn(i));
+ }
+
+ public TableStub getTable() {
+ return new TableStub(primaryKey.getTable());
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.PrimitiveArray;
+
+public class PrimitiveArrayStub extends ArrayStub {
+ protected PrimitiveArray primitiveArray;
+
+ protected PrimitiveArrayStub(Object primitiveArray) {
+ super(primitiveArray);
+ this.primitiveArray = (PrimitiveArray)primitiveArray;
+ }
+
+ public static PrimitiveArrayStub newInstance(PersistentClassStub owner) {
+ return new PrimitiveArrayStub(new PrimitiveArray(owner.persistentClass));
+ }
+
+ public void setElement(ValueStub element) {
+ primitiveArray.setElement(element.value);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,13 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.PrimitiveType;
+
+public class PrimitiveTypeStub extends ImmutableTypeStub {
+
+ protected PrimitiveType primitiveType;
+
+ protected PrimitiveTypeStub(Object primitiveType) {
+ super(primitiveType);
+ this.primitiveType = (PrimitiveType)primitiveType;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,19 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.reveng.ProgressListener;
+
+public abstract class ProgressListenerStub {
+
+ protected ProgressListener progressListener = new ProgressListener() {
+
+ public void startSubTask(String name) {
+ ProgressListenerStub.this.startSubTask(name);
+ }
+
+ };
+
+ protected ProgressListenerStub() {
+ }
+
+ public abstract void startSubTask(String name);
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,96 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.Property;
+
+public class PropertyStub {
+ protected Property property;
+
+ protected PropertyStub(Object property) {
+ this.property = (Property)property;
+ }
+
+ public static PropertyStub newInstance() {
+ return new PropertyStub(new Property());
+ }
+
+ public void setName(String name) {
+ property.setName(name);
+ }
+
+ public void setValue(ValueStub value) {
+ property.setValue(value.value);
+ }
+
+ public ValueStub getValue() {
+ return ValueStubFactory.createValueStub(property.getValue());
+ }
+
+ public void setCascade(String cascade) {
+ property.setCascade(cascade);
+ }
+
+ public String getName() {
+ return property.getName();
+ }
+
+ public TypeStub getType() {
+ return TypeStubFactory.createTypeStub(property.getType());
+ }
+
+ public PersistentClassStub getPersistentClass() {
+ return PersistentClassStubFactory.createPersistentClassStub(property.getPersistentClass());
+ }
+
+ public void setPersistentClass(PersistentClassStub ownerClass) {
+ property.setPersistentClass(ownerClass.persistentClass);
+ }
+
+ public boolean isSelectable() {
+ return property.isSelectable();
+ }
+
+ public boolean isInsertable() {
+ return property.isInsertable();
+ }
+
+ public boolean isUpdateable() {
+ return property.isUpdateable();
+ }
+
+ public boolean isLazy() {
+ return property.isLazy();
+ }
+
+ public boolean isOptional() {
+ return property.isOptional();
+ }
+
+ public boolean isNaturalIdentifier() {
+ return property.isNaturalIdentifier();
+ }
+
+ public boolean isOptimisticLocked() {
+ return property.isOptimisticLocked();
+ }
+
+ public String getCascade() {
+ return property.getCascade();
+ }
+
+ public String getNodeName() {
+ return property.getNodeName();
+ }
+
+ public boolean isBackRef() {
+ return property.isBackRef();
+ }
+
+ public boolean isComposite() {
+ return property.isComposite();
+ }
+
+ public String getPropertyAccessorName() {
+ return property.getPropertyAccessorName();
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,37 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.reveng.ReverseEngineeringSettings;
+
+public class ReverseEngineeringSettingsStub {
+
+ protected ReverseEngineeringSettings reverseEngineeringSettings;
+
+ protected ReverseEngineeringSettingsStub(Object reverseEngineeringSettings) {
+ this.reverseEngineeringSettings = (ReverseEngineeringSettings)reverseEngineeringSettings;
+ }
+
+ public static ReverseEngineeringSettingsStub newInstance(ReverseEngineeringStrategyStub reverseEngineeringStrategy) {
+ return new ReverseEngineeringSettingsStub(new ReverseEngineeringSettings(reverseEngineeringStrategy.reverseEngineeringStrategy));
+ }
+
+ public ReverseEngineeringSettingsStub setDefaultPackageName(String defaultPackageName) {
+ reverseEngineeringSettings.setDefaultPackageName(defaultPackageName);
+ return this;
+ }
+
+ public ReverseEngineeringSettingsStub setDetectManyToMany(boolean b) {
+ reverseEngineeringSettings.setDetectManyToMany(b);
+ return this;
+ }
+
+ public ReverseEngineeringSettingsStub setDetectOneToOne(boolean b) {
+ reverseEngineeringSettings.setDetectOneToOne(b);
+ return this;
+ }
+
+ public ReverseEngineeringSettingsStub setDetectOptimisticLock(boolean optimisticLockSupportEnabled) {
+ reverseEngineeringSettings.setDetectOptimisticLock(optimisticLockSupportEnabled);
+ return this;
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,21 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
+
+public class ReverseEngineeringStrategyStub {
+
+ protected ReverseEngineeringStrategy reverseEngineeringStrategy;
+
+ protected ReverseEngineeringStrategyStub(Object reverseEngineeringStrategy) {
+ this.reverseEngineeringStrategy = (ReverseEngineeringStrategy)reverseEngineeringStrategy;
+ }
+
+ public static String getClassName() {
+ return ReverseEngineeringStrategy.class.getName();
+ }
+
+ public void setSettings(ReverseEngineeringSettingsStub qqsettings) {
+ // TODO Auto-generated method stub
+
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,195 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Subclass;
+
+public class RootClassStub extends PersistentClassStub {
+ protected RootClass rootClass;
+
+ protected RootClassStub(Object rootClass) {
+ super(rootClass);
+ this.rootClass = (RootClass)rootClass;
+ }
+
+ public static RootClassStub newInstance() {
+ return new RootClassStub(new RootClass());
+ }
+
+ public String getClassName() {
+ return rootClass.getClassName();
+ }
+
+ public void setDiscriminator(ValueStub discr) {
+ rootClass.setDiscriminator(discr.value);
+ }
+
+ public TableStub getTable() {
+ return new TableStub(rootClass.getTable());
+ }
+
+ public void addProperty(PropertyStub p) {
+ rootClass.addProperty(p.property);
+ }
+
+ public void setIdentifierProperty(PropertyStub p) {
+ rootClass.setIdentifierProperty(p.property);
+ }
+
+ public PropertyStub getIdentifierProperty() {
+ return new PropertyStub(rootClass.getIdentifierProperty());
+ }
+
+ public void setEntityName(String entityName) {
+ rootClass.setEntityName(entityName);
+ }
+
+ public void setClassName(String className) {
+ rootClass.setClassName(className);
+ }
+
+ public void setProxyInterfaceName(String proxyInterfaceName) {
+ rootClass.setProxyInterfaceName(proxyInterfaceName);
+ }
+
+ public void setLazy(boolean lazy) {
+ rootClass.setLazy(lazy);
+ }
+
+ public void setTable(TableStub table) {
+ rootClass.setTable(table.table);
+ }
+
+ public void setAbstract(Boolean isAbstract) {
+ rootClass.setAbstract(isAbstract);
+ }
+
+ public String getNodeName() {
+ return rootClass.getNodeName();
+ }
+
+ public KeyValueStub getIdentifier() {
+ return (KeyValueStub)ValueStubFactory.createValueStub(rootClass.getIdentifier());
+ }
+
+ public boolean isCustomDeleteCallable() {
+ return rootClass.isCustomDeleteCallable();
+ }
+
+ public boolean isCustomInsertCallable() {
+ return rootClass.isCustomInsertCallable();
+ }
+
+ public boolean isCustomUpdateCallable() {
+ return rootClass.isCustomUpdateCallable();
+ }
+
+ public boolean isDiscriminatorInsertable() {
+ return rootClass.isDiscriminatorInsertable();
+ }
+
+ public boolean isDiscriminatorValueNotNull() {
+ return rootClass.isDiscriminatorValueNotNull();
+ }
+
+ public boolean isDiscriminatorValueNull() {
+ return rootClass.isDiscriminatorValueNull();
+ }
+
+ public boolean isExplicitPolymorphism() {
+ return rootClass.isExplicitPolymorphism();
+ }
+
+ public boolean isForceDiscriminator() {
+ return rootClass.isForceDiscriminator();
+ }
+
+ public boolean isInherited() {
+ return rootClass.isInherited();
+ }
+
+ public boolean isJoinedSubclass() {
+ return rootClass.isJoinedSubclass();
+ }
+
+ public boolean isLazy() {
+ return rootClass.isLazy();
+ }
+
+ public boolean isLazyPropertiesCacheable() {
+ return rootClass.isLazyPropertiesCacheable();
+ }
+
+ public boolean isMutable() {
+ return rootClass.isMutable();
+ }
+
+ public boolean isPolymorphic() {
+ return rootClass.isPolymorphic();
+ }
+
+ public boolean isVersioned() {
+ return rootClass.isVersioned();
+ }
+
+ public int getBatchSize() {
+ return rootClass.getBatchSize();
+ }
+
+ public String getCacheConcurrencyStrategy() {
+ return rootClass.getCacheConcurrencyStrategy();
+ }
+
+ public String getCustomSQLDelete() {
+ return rootClass.getCustomSQLDelete();
+ }
+
+ public String getCustomSQLInsert() {
+ return rootClass.getCustomSQLInsert();
+ }
+
+ public String getCustomSQLUpdate() {
+ return rootClass.getCustomSQLUpdate();
+ }
+
+ public String getDiscriminatorValue() {
+ return rootClass.getDiscriminatorValue();
+ }
+
+ public String getLoaderName() {
+ return rootClass.getLoaderName();
+ }
+
+ public int getOptimisticLockMode() {
+ return rootClass.getOptimisticLockMode();
+ }
+
+ public String getTemporaryIdTableDDL() {
+ return rootClass.getTemporaryIdTableDDL();
+ }
+
+ public String getTemporaryIdTableName() {
+ return rootClass.getTemporaryIdTableName();
+ }
+
+ public String getWhere() {
+ return rootClass.getWhere();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<SubclassStub> getSubclassIterator() {
+ Iterator<Subclass> it = (Iterator<Subclass>)rootClass.getSubclassIterator();
+ ArrayList<SubclassStub> al = new ArrayList<SubclassStub>();
+ while (it.hasNext()) {
+ al.add(new SubclassStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ @Override
+ public ValueStub getDiscriminator() {
+ return ValueStubFactory.createValueStub(rootClass.getDiscriminator());
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,7 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.reveng.SQLTypeMapping;
+
+public class SQLTypeMappingStub {
+ public static final Boolean UNKNOWN_NULLABLE = SQLTypeMapping.UNKNOWN_NULLABLE;
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,345 @@
+package org.hibernate.mediator.stubs;
+
+import java.sql.Time;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+import org.hibernate.Criteria;
+import org.hibernate.EntityMode;
+import org.hibernate.Session;
+import org.hibernate.Query;
+import org.hibernate.HibernateException;
+import org.hibernate.SessionFactory;
+import org.hibernate.engine.SessionImplementor;
+import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.ConsoleQueryParameter;
+import org.hibernate.mediator.QueryInputModel;
+import org.hibernate.mediator.util.CollectionPropertySource;
+import org.hibernate.metadata.ClassMetadata;
+import org.hibernate.metadata.CollectionMetadata;
+import org.hibernate.proxy.HibernateProxyHelper;
+import org.hibernate.type.Type;
+
+import bsh.EvalError;
+import bsh.Interpreter;
+
+public class SessionStub {
+
+ protected Session session;
+
+ protected SessionStub(Session session) {
+ this.session = session;
+ }
+
+ public boolean isOpen() {
+ boolean res = false;
+ if (session != null) {
+ res = session.isOpen();
+ }
+ return res;
+ }
+
+ public void close(List<Throwable> exceptions) {
+ if (session != null && session.isOpen()) {
+ try {
+ session.close();
+ } catch (HibernateException e) {
+ exceptions.add(e);
+ }
+ }
+ }
+
+ public boolean contains(Object obj) {
+ boolean res = false;
+ if (session != null) {
+ res = session.contains(obj);
+ }
+ return res;
+ }
+
+ public boolean hasMetaData(Object obj) {
+ boolean res = false;
+ if (session != null) {
+ res = session.getSessionFactory().getClassMetadata(
+ HibernateProxyHelper.getClassWithoutInitializingProxy(obj)) != null;
+ }
+ return res;
+ }
+
+ public boolean hasMetaData(Object obj, List<Throwable> exceptions) {
+ boolean res = false;
+ if (session != null) {
+ try {
+ res = session.getSessionFactory().getClassMetadata(
+ HibernateProxyHelper.getClassWithoutInitializingProxy(obj)) != null;
+ } catch (HibernateException e) {
+ exceptions.add(e);
+ }
+ }
+ return res;
+ }
+
+ public String getEntityName(Object obj) {
+ String res = null;
+ if (session != null) {
+ res = session.getEntityName(obj);
+ }
+ return res;
+ }
+
+ public String getEntityName(Object obj, List<Throwable> exceptions) {
+ String res = null;
+ if (session != null) {
+ try {
+ res = session.getEntityName(obj);
+ } catch (HibernateException e) {
+ exceptions.add(e);
+ }
+ }
+ return res;
+ }
+
+ public Object getPropertyValue(Object obj, Object id) {
+ Object pv = null;
+ if (session != null) {
+ SessionFactory sf = session.getSessionFactory();
+ ClassMetadata classMetadata;
+ if (session.isOpen()) {
+ classMetadata = sf.getClassMetadata(session.getEntityName(obj));
+ } else {
+ classMetadata = sf.getClassMetadata(HibernateProxyHelper
+ .getClassWithoutInitializingProxy(obj));
+ }
+ if (id.equals(classMetadata.getIdentifierPropertyName())) {
+ pv = classMetadata.getIdentifier(obj, EntityMode.POJO);
+ } else {
+ pv = classMetadata.getPropertyValue(obj, (String) id, EntityMode.POJO);
+ }
+ if (pv instanceof Collection<?>) {
+ CollectionMetadata collectionMetadata = sf.getCollectionMetadata(classMetadata
+ .getEntityName()
+ + "." + id); //$NON-NLS-1$
+ if (collectionMetadata != null) {
+ pv = new CollectionPropertySource((Collection<?>) pv);
+ }
+ }
+ }
+ return pv;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors(final Object obj) {
+ SessionFactory sf = session.getSessionFactory();
+ ClassMetadata classMetadata;
+ if (session.isOpen()) {
+ classMetadata = sf.getClassMetadata(session.getEntityName(obj));
+ } else {
+ classMetadata = sf.getClassMetadata(HibernateProxyHelper
+ .getClassWithoutInitializingProxy(obj));
+ }
+ return initializePropertyDescriptors(classMetadata);
+ }
+
+ protected IPropertyDescriptor[] initializePropertyDescriptors(ClassMetadata classMetadata) {
+
+ String[] propertyNames = classMetadata.getPropertyNames();
+ int length = propertyNames.length;
+
+ PropertyDescriptor identifier = null;
+
+ if (classMetadata.hasIdentifierProperty()) {
+ identifier = new PropertyDescriptor(classMetadata.getIdentifierPropertyName(),
+ classMetadata.getIdentifierPropertyName());
+ identifier.setCategory(Messages.EntityPropertySource_identifier);
+ length++;
+ }
+
+ PropertyDescriptor[] properties = new PropertyDescriptor[length];
+
+ int idx = 0;
+ if (identifier != null) {
+ properties[idx++] = identifier;
+ }
+
+ for (int i = 0; i < propertyNames.length; i++) {
+ PropertyDescriptor prop = new PropertyDescriptor(propertyNames[i], propertyNames[i]);
+ prop.setCategory(Messages.EntityPropertySource_properties);
+ properties[i + idx] = prop;
+ }
+
+ return properties;
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<Object> evalCriteria(String criteriaCode, QueryInputModel model, Time queryTime,
+ List<Throwable> exceptions) {
+ List<Object> res = Collections.emptyList();
+ if (criteriaCode.indexOf("System.exit") >= 0) { // TODO: externalize run so we don't need this bogus check! //$NON-NLS-1$
+ exceptions.add(new IllegalArgumentException(Messages.JavaPage_not_allowed));
+ return res;
+ }
+ try {
+ Interpreter ip = setupInterpreter();
+ final Integer maxResults = model.getMaxResults();
+ long startTime = System.currentTimeMillis();
+ Object o = ip.eval(criteriaCode);
+ // ugly! TODO: make un-ugly!
+ if (o instanceof Criteria) {
+ Criteria criteria = (Criteria) o;
+ if (maxResults != null) {
+ criteria.setMaxResults(maxResults.intValue());
+ }
+ res = criteria.list();
+ } else if (o instanceof List<?>) {
+ res = (List<Object>) o;
+ if (maxResults != null) {
+ res = res.subList(0, Math.min(res.size(), maxResults.intValue()));
+ }
+ } else {
+ res = new ArrayList<Object>();
+ res.add(o);
+ }
+ queryTime.setTime(System.currentTimeMillis() - startTime);
+ } catch (EvalError e) {
+ exceptions.add(e);
+ } catch (HibernateException e) {
+ exceptions.add(e);
+ }
+ return res;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Interpreter setupInterpreter() throws EvalError, HibernateException {
+ Interpreter interpreter = new Interpreter();
+
+ interpreter.set("session", session); //$NON-NLS-1$
+ interpreter.setClassLoader(Thread.currentThread().getContextClassLoader());
+ SessionImplementor si = (SessionImplementor) session;
+
+ Map<String, ?> map = si.getFactory().getAllClassMetadata();
+
+ Iterator<String> iterator = map.keySet().iterator();
+ // TODO: filter non classes.
+ String imports = ""; //$NON-NLS-1$
+ while (iterator.hasNext()) {
+ String element = iterator.next();
+ imports += "import " + element + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ imports += "import org.hibernate.criterion.*;\n"; //$NON-NLS-1$
+ imports += "import org.hibernate.*;\n"; //$NON-NLS-1$
+ // TODO: expose the parameters as values to be used in the code.
+ interpreter.eval(imports);
+
+ return interpreter;
+ }
+
+ public List<Object> evalQuery(String queryString, QueryInputModel model, Time queryTime,
+ List<Throwable> exceptions) {
+ List<Object> res = Collections.emptyList();
+ Query query = null;
+ try {
+ query = session.createQuery(queryString);
+ } catch (HibernateException e) {
+ exceptions.add(e);
+ } catch (Exception e) {
+ exceptions.add(e);
+ }
+ if (query == null) {
+ return res;
+ }
+ try {
+ res = new ArrayList<Object>();
+ setupParameters(query, model);
+ long startTime = System.currentTimeMillis();
+ // need to be user-controllable to toggle between iterate, scroll etc.
+ Iterator<?> iter = query.list().iterator();
+ queryTime.setTime(System.currentTimeMillis() - startTime);
+ while (iter.hasNext()) {
+ Object element = iter.next();
+ res.add(element);
+ }
+ } catch (HibernateException e) {
+ exceptions.add(e);
+ } catch (IllegalArgumentException e) {
+ exceptions.add(e);
+ }
+ return res;
+ }
+
+ private void setupParameters(Query query, QueryInputModel model) {
+ if (model.getMaxResults() != null) {
+ query.setMaxResults(model.getMaxResults().intValue());
+ }
+ ConsoleQueryParameter[] qp = model.getQueryParameters();
+ for (int i = 0; i < qp.length; i++) {
+ ConsoleQueryParameter parameter = qp[i];
+ try {
+ int pos = Integer.parseInt(parameter.getName());
+ query.setParameter(pos, calcValue(parameter), parameter.getType().type);
+ } catch (NumberFormatException nfe) {
+ query.setParameter(parameter.getName(), calcValue(parameter), parameter.getType().type);
+ }
+ }
+ }
+
+ private Object calcValue(ConsoleQueryParameter parameter) {
+ return parameter.getValueForQuery();
+ }
+
+ public List<String> evalQueryPathNames(String queryString, QueryInputModel model,
+ List<Throwable> exceptions) {
+ List<String> res = Collections.emptyList();
+ Query query = null;
+ try {
+ query = session.createQuery(queryString);
+ } catch (HibernateException e) {
+ exceptions.add(e);
+ } catch (Exception e) {
+ exceptions.add(e);
+ }
+ if (query == null) {
+ return res;
+ }
+ try {
+ String[] returnAliases = null;
+ try {
+ returnAliases = query.getReturnAliases();
+ } catch (NullPointerException e) {
+ // ignore - http://opensource.atlassian.com/projects/hibernate/browse/HHH-2188
+ }
+ if (returnAliases == null) {
+ Type[] t;
+ try {
+ t = query.getReturnTypes();
+ } catch (NullPointerException npe) {
+ t = new Type[] { null };
+ // ignore - http://opensource.atlassian.com/projects/hibernate/browse/HHH-2188
+ }
+ res = new ArrayList<String>(t.length);
+ for (int i = 0; i < t.length; i++) {
+ Type type = t[i];
+ if (type == null) {
+ res.add("<multiple types>"); //$NON-NLS-1$
+ } else {
+ res.add(type.getName());
+ }
+ }
+ } else {
+ String[] t = returnAliases;
+ res = new ArrayList<String>(t.length);
+ for (int i = 0; i < t.length; i++) {
+ res.add(t[i]);
+ }
+ }
+ } catch (HibernateException e) {
+ exceptions.add(e);
+ }
+ return res;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStubFactory.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStubFactory.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,164 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.engine.query.HQLQueryPlan;
+import org.hibernate.hql.QueryTranslator;
+import org.hibernate.impl.SessionFactoryImpl;
+import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.util.ELTransformer;
+import org.hibernate.mediator.util.QLFormatHelper;
+import org.hibernate.metadata.ClassMetadata;
+import org.hibernate.metadata.CollectionMetadata;
+import org.hibernate.type.Type;
+
+public class SessionStubFactory {
+
+ protected SessionFactory sessionFactory;
+
+ public SessionStubFactory(ConfigurationStub configStub) {
+ sessionFactory = configStub.buildSessionFactory();
+ }
+
+ public boolean isSessionFactoryCreated() {
+ return sessionFactory != null;
+ }
+
+ public SessionStub openSession() {
+ if (sessionFactory != null) {
+ return new SessionStub(sessionFactory.openSession());
+ }
+ return null;
+ }
+
+ public void close() {
+ if (sessionFactory != null) {
+ sessionFactory.close();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<String> getClasses() {
+ List<String> res = Collections.emptyList();
+ if (sessionFactory != null) {
+ res = new ArrayList<String>();
+ res.addAll(sessionFactory.getAllClassMetadata().keySet());
+ }
+ return res;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map<String, ClassMetadataStub> getClassMetaData() {
+ if (sessionFactory == null) {
+ return new HashMap<String, ClassMetadataStub>();
+ }
+ Map<String, ClassMetadata> allClassMetadata = sessionFactory.getAllClassMetadata();
+ Iterator<Map.Entry<String, ClassMetadata>> it = allClassMetadata.entrySet().iterator();
+ Map<String, ClassMetadataStub> res = new HashMap<String, ClassMetadataStub>();
+ while (it.hasNext()) {
+ Map.Entry<String, ClassMetadata> entry = it.next();
+ res.put(entry.getKey(), new ClassMetadataStub(entry.getValue()));
+ }
+ return res;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map<String, CollectionMetadataStub> getCollectionMetaData() {
+ if (sessionFactory == null) {
+ return new HashMap<String, CollectionMetadataStub>();
+ }
+ Map<String, CollectionMetadata> allClassMetadata = sessionFactory.getAllCollectionMetadata();
+ Iterator<Map.Entry<String, CollectionMetadata>> it = allClassMetadata.entrySet().iterator();
+ Map<String, CollectionMetadataStub> res = new HashMap<String, CollectionMetadataStub>();
+ while (it.hasNext()) {
+ Map.Entry<String, CollectionMetadata> entry = it.next();
+ res.put(entry.getKey(), new CollectionMetadataStub(entry.getValue()));
+ }
+ return res;
+ }
+
+ /**
+ * Given a ConsoleConfiguration and a query this method validates the query through hibernate if
+ * a sessionfactory is available.
+ *
+ * @param query
+ * @param allowEL
+ * if true, EL syntax will be replaced as a named variable
+ */
+ public void checkQuery(String query, boolean allowEL) {
+ if (sessionFactory != null) {
+ if (allowEL) {
+ query = ELTransformer.removeEL(query);
+ }
+ new HQLQueryPlan(query, false, Collections.EMPTY_MAP,
+ (SessionFactoryImpl) sessionFactory);
+ }
+ }
+
+ public String generateSQL(String query) {
+ try {
+ SessionFactoryImpl sfimpl = (SessionFactoryImpl) sessionFactory; // hack - to get to the
+ // actual queries..
+ StringBuffer str = new StringBuffer(256);
+ HQLQueryPlan plan = new HQLQueryPlan(query, false, Collections.EMPTY_MAP, sfimpl);
+
+ QueryTranslator[] translators = plan.getTranslators();
+ for (int i = 0; i < translators.length; i++) {
+ QueryTranslator translator = translators[i];
+ if (translator.isManipulationStatement()) {
+ str.append(Messages.DynamicSQLPreviewView_manipulation_of + i
+ + ":"); //$NON-NLS-1$
+ Iterator<?> iterator = translator.getQuerySpaces().iterator();
+ while (iterator.hasNext()) {
+ Object qspace = iterator.next();
+ str.append(qspace);
+ if (iterator.hasNext()) {
+ str.append(", ");} //$NON-NLS-1$
+ }
+
+ } else {
+ Type[] returnTypes = translator.getReturnTypes();
+ str.append(i + ": "); //$NON-NLS-1$
+ for (int j = 0; j < returnTypes.length; j++) {
+ Type returnType = returnTypes[j];
+ str.append(returnType.getName());
+ if (j < returnTypes.length - 1) {
+ str.append(", ");} //$NON-NLS-1$
+ }
+ }
+ str.append("\n-----------------\n"); //$NON-NLS-1$
+ Iterator<?> sqls = translator.collectSqlStrings().iterator();
+ while (sqls.hasNext()) {
+ String sql = (String) sqls.next();
+ str.append(QLFormatHelper.formatForScreen(sql));
+ str.append("\n\n"); //$NON-NLS-1$
+ }
+ }
+ return str.toString();
+ } catch (Throwable t) {
+ // StringWriter sw = new StringWriter();
+ StringBuffer msgs = new StringBuffer();
+
+ Throwable cause = t;
+ while (cause != null) {
+ msgs.append(t);
+ if (cause.getCause() == cause) {
+ cause = null;
+ } else {
+ cause = cause.getCause();
+ if (cause != null)
+ msgs.append(Messages.DynamicSQLPreviewView_caused_by);
+ }
+ }
+ // t.printStackTrace(new PrintWriter(sw));
+ // return sw.getBuffer().toString();
+ return msgs.toString();
+ }
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SetStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SetStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SetStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,22 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.Set;
+
+public class SetStub extends CollectionStub {
+ protected Set set;
+
+ protected SetStub(Object set) {
+ super(set);
+ this.set = (Set)set;
+ }
+
+ public static SetStub newInstance(PersistentClassStub owner) {
+ return new SetStub(new Set(owner.persistentClass));
+ }
+
+ @Override
+ public Object accept(ValueVisitorStub visitor) {
+ return visitor.accept(this);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,23 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.Settings;
+
+public class SettingsStub {
+ protected Settings settings;
+
+ protected SettingsStub(Object settings) {
+ this.settings = (Settings)settings;
+ }
+
+ public ConnectionProviderStub getConnectionProvider() {
+ return new ConnectionProviderStub(settings.getConnectionProvider());
+ }
+
+ public String getDefaultCatalogName() {
+ return settings.getDefaultCatalogName();
+ }
+
+ public String getDefaultSchemaName() {
+ return settings.getDefaultSchemaName();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,52 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.Properties;
+
+import org.hibernate.mapping.SimpleValue;
+
+public class SimpleValueStub extends KeyValueStub {
+
+ protected SimpleValue simpleValue;
+
+ protected SimpleValueStub(Object simpleValue) {
+ super(simpleValue);
+ this.simpleValue = (SimpleValue)simpleValue;
+ }
+
+ public static SimpleValueStub newInstance() {
+ return new SimpleValueStub(new SimpleValue());
+ }
+
+ public void setTypeName(String type) {
+ simpleValue.setTypeName(type);
+ }
+
+ public void addColumn(ColumnStub column) {
+ simpleValue.addColumn(column.column);
+ }
+
+ public void setTable(TableStub table) {
+ simpleValue.setTable(table.table);
+ }
+
+ public void setTypeParameters(Properties parameterMap) {
+ simpleValue.setTypeParameters(parameterMap);
+ }
+
+ public String getForeignKeyName() {
+ return simpleValue.getForeignKeyName();
+ }
+
+ public String getTypeName() {
+ return simpleValue.getTypeName();
+ }
+
+ public boolean isTypeSpecified() {
+ return simpleValue.isTypeSpecified();
+ }
+
+ @Override
+ public Object accept(ValueVisitorStub visitor) {
+ return visitor.accept(this);
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,17 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.SingleTableSubclass;
+
+public class SingleTableSubclassStub extends SubclassStub {
+ protected SingleTableSubclass singleTableSubclass;
+
+ protected SingleTableSubclassStub(Object singleTableSubclass) {
+ super(singleTableSubclass);
+ this.singleTableSubclass = (SingleTableSubclass)singleTableSubclass;
+ }
+
+ public static SingleTableSubclassStub newInstance(Object singleTableSubclass) {
+ return new SingleTableSubclassStub(singleTableSubclass);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,41 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mapping.Subclass;
+
+public class SubclassStub extends PersistentClassStub {
+
+ protected Subclass subclass;
+
+ protected SubclassStub(Object subclass) {
+ super(subclass);
+ this.subclass = (Subclass)subclass;
+ }
+
+ public void setClassName(String className) {
+ subclass.setClassName(className);
+ }
+
+ public void setEntityName(String entityName) {
+ subclass.setEntityName(entityName);
+ }
+
+ public void setDiscriminatorValue(String discriminatorValue) {
+ subclass.setDiscriminatorValue(discriminatorValue);
+ }
+
+ public void setAbstract(Boolean isAbstract) {
+ subclass.setAbstract(isAbstract);
+ }
+
+ public void addProperty(PropertyStub p) {
+ subclass.addProperty(p.property);
+ }
+
+ public TableStub getRootTable() {
+ return new TableStub(subclass.getRootTable());
+ }
+
+ public boolean isJoinedSubclass() {
+ return subclass.isJoinedSubclass();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,45 @@
+package org.hibernate.mediator.stubs;
+
+public class TableFilterStub {
+
+ public void setExclude(Boolean exclude) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setMatchCatalog(String matchCatalog) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setMatchName(String matchName) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setMatchSchema(String matchSchema) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Boolean getExclude() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getMatchCatalog() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getMatchSchema() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getMatchName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,23 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.cfg.reveng.TableIdentifier;
+
+public class TableIdentifierStub {
+ protected TableIdentifier tableIdentifier;
+
+ protected TableIdentifierStub(Object tableIdentifier) {
+ this.tableIdentifier = (TableIdentifier)tableIdentifier;
+ }
+
+ public static TableIdentifierStub create(TableStub table) {
+ return newInstance(table.getCatalog(), table.getSchema(), table.getName() );
+ }
+
+ public static TableIdentifierStub newInstance(String catalog, String schema, String name) {
+ return new TableIdentifierStub(new TableIdentifier(catalog, schema, name));
+ }
+
+ public String getName() {
+ return tableIdentifier.getName();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,92 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.hibernate.mapping.Column;
+import org.hibernate.mapping.ForeignKey;
+import org.hibernate.mapping.Table;
+
+public class TableStub {
+ protected Table table;
+
+ protected TableStub(Object table) {
+ this.table = (Table)table;
+ }
+
+ protected Table getTable() {
+ return table;
+ }
+
+ public static TableStub newInstance(String name) {
+ return new TableStub(new Table(name));
+ }
+
+ public String getName() {
+ return table.getName();
+ }
+
+ public PrimaryKeyStub getPrimaryKey() {
+ return new PrimaryKeyStub(table.getPrimaryKey());
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<ForeignKeyStub> getForeignKeyIterator() {
+ Iterator<ForeignKey> it = (Iterator<ForeignKey>)table.getForeignKeyIterator();
+ ArrayList<ForeignKeyStub> al = new ArrayList<ForeignKeyStub>();
+ while (it.hasNext()) {
+ al.add(new ForeignKeyStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ public String getCatalog() {
+ return table.getCatalog();
+ }
+
+ public String getSchema() {
+ return table.getSchema();
+ }
+
+ public DependantValueStub getIdentifierValue() {
+ return new DependantValueStub(table.getIdentifierValue());
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<ColumnStub> getColumnIterator() {
+ Iterator<Column> it = (Iterator<Column>)table.getColumnIterator();
+ ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
+ while (it.hasNext()) {
+ al.add(new ColumnStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ public String getComment() {
+ return table.getComment();
+ }
+
+ public String getRowId() {
+ return table.getRowId();
+ }
+
+ public String getSubselect() {
+ return table.getSubselect();
+ }
+
+ public boolean hasDenormalizedTables() {
+ return table.hasDenormalizedTables();
+ }
+
+ public boolean isAbstract() {
+ return table.isAbstract();
+ }
+
+ public boolean isAbstractUnionTable() {
+ return table.isAbstractUnionTable();
+ }
+
+ public boolean isPhysicalTable() {
+ return table.isPhysicalTable();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,36 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.FetchMode;
+import org.hibernate.mapping.ToOne;
+
+public class ToOneStub extends SimpleValueStub {
+ protected ToOne toOne;
+
+ protected ToOneStub(Object toOne) {
+ super(toOne);
+ this.toOne = (ToOne)toOne;
+ }
+
+ public void setReferencedEntityName(String referencedEntityName) {
+ toOne.setReferencedEntityName(referencedEntityName);
+ }
+
+ public void setReferencedPropertyName(String name) {
+ toOne.setReferencedPropertyName(name);
+ }
+
+ public void setFetchMode(FetchModeStub fetchMode) {
+ if (FetchModeStub.DEFAULT.equals(fetchMode)) {
+ toOne.setFetchMode(FetchMode.DEFAULT);
+ } else if (FetchModeStub.SELECT.equals(fetchMode)) {
+ toOne.setFetchMode(FetchMode.SELECT);
+ } else if (FetchModeStub.JOIN.equals(fetchMode)) {
+ toOne.setFetchMode(FetchMode.JOIN);
+ } else if (FetchModeStub.SUBSELECT.equals(fetchMode)) {
+ }
+ }
+
+ public boolean isEmbedded() {
+ return toOne.isEmbedded();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,36 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.type.Type;
+
+public abstract class TypeStub {
+ protected Type type;
+
+ protected TypeStub(Object type) {
+ this.type = (Type)type;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class getReturnedClass() {
+ return type.getReturnedClass();
+ }
+
+ public boolean isCollectionType() {
+ return type.isCollectionType();
+ }
+
+ public boolean isEntityType() {
+ return type.isEntityType();
+ }
+
+ public boolean isAnyType() {
+ return type.isAnyType();
+ }
+
+ public boolean isComponentType() {
+ return type.isComponentType();
+ }
+
+ public String getName() {
+ return type.getName();
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStubFactory.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStubFactory.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,34 @@
+package org.hibernate.mediator.stubs;
+
+import java.lang.reflect.Type;
+
+public class TypeStubFactory {
+ @SuppressWarnings("unchecked")
+ public static TypeStub createTypeStub(Object value) {
+ final Class cl = value.getClass();
+ if (isClassOrOffspring(cl, "org.hibernate.type.CollectionType")) { //$NON-NLS-1$
+ return new CollectionTypeStub(value);
+ //} else if (0 == "org.hibernate.type.Type".compareTo(cl.getName())) { //$NON-NLS-1$
+ // return new TypeStub(value);
+ } else if (isClassOrOffspring(cl, "org.hibernate.type.EntityType")) { //$NON-NLS-1$
+ return new EntityTypeStub(value);
+ } else if (isClassOrOffspring(cl, "org.hibernate.type.NullableType")) { //$NON-NLS-1$
+ return new NullableTypeStub(value);
+ }
+ return new AbstractTypeStub(value);
+ }
+
+ protected static boolean isClassOrOffspring(final Class<?> cl, final String name) {
+ if (cl == null || name == null) {
+ return false;
+ }
+ if (0 == name.compareTo(cl.getName())) {
+ return true;
+ }
+ Type type = cl.getGenericSuperclass();
+ if (type instanceof Class<?>) {
+ return isClassOrOffspring((Class<?>)type, name);
+ }
+ return false;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,39 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.hibernate.mapping.Column;
+import org.hibernate.mapping.Value;
+
+public abstract class ValueStub {
+ protected Value value;
+
+ protected ValueStub(Object value) {
+ this.value = (Value)value;
+ }
+
+ public TableStub getTable() {
+ return new TableStub(value.getTable());
+ }
+
+ public boolean isSimpleValue() {
+ return value.isSimpleValue();
+ }
+
+ public TypeStub getType() {
+ return TypeStubFactory.createTypeStub(value.getType());
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator<ColumnStub> getColumnIterator() {
+ Iterator<Column> it = (Iterator<Column>)value.getColumnIterator();
+ ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
+ while (it.hasNext()) {
+ al.add(new ColumnStub(it.next()));
+ }
+ return al.iterator();
+ }
+
+ public abstract Object accept(ValueVisitorStub visitor);
+};
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStubFactory.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStubFactory.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,46 @@
+package org.hibernate.mediator.stubs;
+
+public class ValueStubFactory {
+ @SuppressWarnings("unchecked")
+ public static ValueStub createValueStub(Object value) {
+ final Class cl = value.getClass();
+ if (0 == "org.hibernate.mapping.Bag".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new BagStub(value);
+ //} else if (0 == "org.hibernate.mapping.IdentifierCollection".compareTo(cl.getName())) { //$NON-NLS-1$
+ // return new IdentifierCollectionStub(value);
+ } else if (0 == "org.hibernate.mapping.IdentifierBag".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new IdentifierBagStub(value);
+ //} else if (0 == "org.hibernate.mapping.IndexedCollection".compareTo(cl.getName())) { //$NON-NLS-1$
+ // return new IndexedCollectionStub(value);
+ } else if (0 == "org.hibernate.mapping.List".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new ListStub(value);
+ } else if (0 == "org.hibernate.mapping.Array".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new ArrayStub(value);
+ } else if (0 == "org.hibernate.mapping.PrimitiveArray".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new PrimitiveArrayStub(value);
+ } else if (0 == "org.hibernate.mapping.Map".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new MapStub(value);
+ } else if (0 == "org.hibernate.mapping.Set".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new SetStub(value);
+ } else if (0 == "org.hibernate.mapping.OneToMany".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new OneToManyStub(value);
+ //} else if (0 == "org.hibernate.mapping.KeyValue".compareTo(cl.getName())) { //$NON-NLS-1$
+ // return new KeyValueStub(value);
+ } else if (0 == "org.hibernate.mapping.SimpleValue".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new SimpleValueStub(value);
+ } else if (0 == "org.hibernate.mapping.Any".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new AnyStub(value);
+ } else if (0 == "org.hibernate.mapping.Component".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new ComponentStub(value);
+ } else if (0 == "org.hibernate.mapping.DependantValue".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new DependantValueStub(value);
+ } else if (0 == "org.hibernate.mapping.ToOne".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new ToOneStub(value);
+ } else if (0 == "org.hibernate.mapping.ManyToOne".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new ManyToOneStub(value);
+ } else if (0 == "org.hibernate.mapping.OneToOne".compareTo(cl.getName())) { //$NON-NLS-1$
+ return new OneToOneStub(value);
+ }
+ return null;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueVisitorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueVisitorStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueVisitorStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,19 @@
+package org.hibernate.mediator.stubs;
+
+// look at org.hibernate.mapping.ValueVisitor
+public interface ValueVisitorStub {
+ Object accept(BagStub bag);
+ Object accept(IdentifierBagStub bag);
+ Object accept(ListStub list);
+ Object accept(PrimitiveArrayStub primitiveArray);
+ Object accept(ArrayStub list);
+ Object accept(MapStub map);
+ Object accept(OneToManyStub many);
+ Object accept(SetStub set);
+ Object accept(AnyStub any);
+ Object accept(SimpleValueStub value);
+ Object accept(DependantValueStub value);
+ Object accept(ComponentStub component);
+ Object accept(ManyToOneStub mto);
+ Object accept(OneToOneStub oto);
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,15 @@
+package org.hibernate.mediator.stubs;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.hibernate.tool.hbm2x.XMLPrettyPrinter;
+
+public class XMLPrettyPrinterStub {
+
+ public static void prettyPrint(InputStream in, OutputStream writer) throws IOException {
+ XMLPrettyPrinter.prettyPrint(in, writer);
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/CollectionHelper.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/CollectionHelper.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/CollectionHelper.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,32 @@
+package org.hibernate.mediator.stubs.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@SuppressWarnings("unchecked")
+public final class CollectionHelper {
+
+ public static final List EMPTY_LIST = Collections.unmodifiableList( new ArrayList(0) );
+ public static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList(0) );
+ public static final Map EMPTY_MAP = Collections.unmodifiableMap( new HashMap(0) );
+
+ private CollectionHelper() {
+ }
+
+ /**
+ * Build a properly sized map, especially handling load size and load factor to prevent immediate resizing.
+ * <p/>
+ * Especially helpful for copy map contents.
+ *
+ * @param size The size to make the map.
+ * @return The sized map.
+ */
+ public static Map mapOfSize(int size) {
+ final int currentSize = (int) (size / 0.75f);
+ return new HashMap( Math.max( currentSize+ 1, 16), 0.75f );
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/HqlBaseLexerStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/HqlBaseLexerStub.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/HqlBaseLexerStub.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,39 @@
+package org.hibernate.mediator.stubs.util;
+
+import java.io.Reader;
+
+import org.hibernate.hql.antlr.HqlBaseLexer;
+import org.hibernate.mediator.stubs.HqlSqlTokenTypesStub;
+
+import antlr.Token;
+import antlr.TokenStreamException;
+
+public class HqlBaseLexerStub {
+
+ protected HqlBaseLexer hqlBaseLexer;
+
+ protected HqlBaseLexerStub(HqlBaseLexer hqlBaseLexer) {
+ this.hqlBaseLexer = hqlBaseLexer;
+ }
+
+ public static HqlBaseLexerStub newInstance(Reader in) {
+ return new HqlBaseLexerStub(new HqlBaseLexer(in));
+ }
+
+ private Token nextToken() {
+ try {
+ return hqlBaseLexer.nextToken();
+ } catch (TokenStreamException e) {
+ return null;
+ }
+ }
+
+ public boolean isNextTokenIdent() {
+ Token token = nextToken();
+ if (token != null && token.getType() == HqlSqlTokenTypesStub.IDENT) {
+ return true;
+ }
+ return false;
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/OpenMappingUtilsEjb3.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/OpenMappingUtilsEjb3.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/OpenMappingUtilsEjb3.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,282 @@
+package org.hibernate.mediator.stubs.util;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import javax.persistence.Embeddable;
+import javax.persistence.Entity;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.spi.PersistenceUnitTransactionType;
+
+import org.hibernate.ejb.Ejb3Configuration;
+import org.hibernate.ejb.HibernatePersistence;
+import org.hibernate.ejb.packaging.ClassFilter;
+import org.hibernate.ejb.packaging.Entry;
+import org.hibernate.ejb.packaging.FileFilter;
+import org.hibernate.ejb.packaging.Filter;
+import org.hibernate.ejb.packaging.JarVisitor;
+import org.hibernate.ejb.packaging.JarVisitorFactory;
+import org.hibernate.ejb.packaging.NamedInputStream;
+import org.hibernate.ejb.packaging.PackageFilter;
+import org.hibernate.ejb.packaging.PersistenceMetadata;
+import org.hibernate.ejb.packaging.PersistenceXmlLoader;
+import org.hibernate.mediator.stubs.util.CollectionHelper;
+import org.xml.sax.EntityResolver;
+
+/**
+ * Most functions in this utility class are copy of
+ * org.hibernate.ejb.Ejb3Configuration private functions.
+ * These functions are responsible for bypass all ejb3 configuration files.
+ *
+ * @author Vitali Yemialyanchyk
+ */
+public class OpenMappingUtilsEjb3 {
+
+ public static final String META_INF_PERS_XML = "META-INF/persistence.xml"; //$NON-NLS-1$
+ public static final String META_INF_ORM_XML = "META-INF/orm.xml"; //$NON-NLS-1$
+
+ private OpenMappingUtilsEjb3() {}
+
+ /**
+ * Collect list of paths to ejb3 resource configuration files.
+ * This function code based on code from Ejb3Configuration.
+ * @see Ejb3Configuration configure(String persistenceUnitName, Map integration)
+ *
+ * @param consoleConfiguration
+ * @return
+ */
+ public static List<String> enumDocuments(String persistenceUnitName, EntityResolver er) {
+ Enumeration<URL> xmls = null;
+ try {
+ xmls = Thread.currentThread().getContextClassLoader().getResources(META_INF_PERS_XML);
+ } catch (IOException e) {
+ //ignore
+ }
+ if (xmls == null || !xmls.hasMoreElements()) {
+ return null;
+ }
+ final String IMPLEMENTATION_NAME = HibernatePersistence.class.getName();
+ List<String> res = null;
+ while (xmls.hasMoreElements() && res == null) {
+ URL url = xmls.nextElement();
+ List<PersistenceMetadata> metadataFiles = null;
+ try {
+ metadataFiles = PersistenceXmlLoader.deploy(
+ url, CollectionHelper.EMPTY_MAP,
+ er,
+ PersistenceUnitTransactionType.RESOURCE_LOCAL);
+ } catch (Exception e1) {
+ //ignore
+ }
+ if (metadataFiles == null) {
+ continue;
+ }
+ boolean stopErrorFlag = false;
+ for (PersistenceMetadata metadata : metadataFiles) {
+ boolean tmp = metadata.getProvider() == null;
+ tmp = tmp || IMPLEMENTATION_NAME.equalsIgnoreCase(metadata.getProvider());
+ if (!tmp) {
+ continue;
+ }
+ //correct provider
+ //lazy compute the visitor if possible to avoid useless exceptions if an unexpected state happens
+ JarVisitor visitor = null;
+ URL visitorJarURL = null;
+ if (metadata.getName() == null) {
+ visitor = getMainJarVisitor(url, metadata, CollectionHelper.EMPTY_MAP);
+ visitorJarURL = JarVisitorFactory.getJarURLFromURLEntry(url, "/" + META_INF_PERS_XML); //$NON-NLS-1$
+ metadata.setName(visitor.getUnqualifiedJarName());
+ }
+ if (persistenceUnitName == null && xmls.hasMoreElements()) {
+ //throw new PersistenceException("No name provided and several persistence units found");
+ stopErrorFlag = true;
+ break;
+ } else if (persistenceUnitName == null || metadata.getName().equals(persistenceUnitName)) {
+ if (visitor == null) {
+ visitor = getMainJarVisitor(url, metadata, CollectionHelper.EMPTY_MAP);
+ visitorJarURL = JarVisitorFactory.getJarURLFromURLEntry(url, "/" + META_INF_PERS_XML); //$NON-NLS-1$
+ }
+ try {
+ addMetadataFromVisitor(visitor, visitorJarURL.getPath(), metadata);
+ /** /
+ JarVisitor.Filter[] otherXmlFilter = getFilters(metadata, CollectionHelper.EMPTY_MAP, false);
+ for (String jarFile : metadata.getJarFiles()) {
+ // TODO: test this code
+ //vit//visitor = JarVisitor.getVisitor(jarFile, otherXmlFilter);
+ //vit//addMetadataFromVisitor(visitor, metadata);
+ }
+ /**/
+ } catch (IOException e) {
+ //ignore
+ }
+ res = new ArrayList<String>();
+ Iterator<NamedInputStream> it = metadata.getHbmfiles().iterator();
+ while (it.hasNext()) {
+ NamedInputStream nis = it.next();
+ res.add(nis.getName());
+ try {
+ nis.getStream().close();
+ } catch (IOException ioe) {
+ // TODO:
+ //HibernateConsolePlugin.getDefault().logErrorMessage("could not close input stream for", ioe); //$NON-NLS-1$
+ }
+ }
+ break;
+ }
+ }
+ if (stopErrorFlag) {
+ break;
+ }
+ }
+ return res;
+ }
+
+ /**
+ * This function code based on code from Ejb3Configuration.
+ * @see JarVisitor Ejb3Configuration.getMainJarVisitor(URL url, PersistenceMetadata metadata, Map integration)
+ *
+ * @param url
+ * @param metadata
+ * @param integration
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ private static JarVisitor getMainJarVisitor(URL url, PersistenceMetadata metadata, Map integration) {
+ URL jarURL = JarVisitorFactory.getJarURLFromURLEntry(url, "/" + META_INF_PERS_XML); //$NON-NLS-1$
+ Filter[] persistenceXmlFilter = getFilters(metadata, integration, metadata.getExcludeUnlistedClasses());
+ JarVisitor visitor = JarVisitorFactory.getVisitor(jarURL, persistenceXmlFilter);
+ return visitor;
+ }
+
+ /**
+ * This function code based on code from Ejb3Configuration.
+ * @see JarVisitor Ejb3Configuration.addMetadataFromVisitor(JarVisitor visitor, PersistenceMetadata metadata) throws IOException
+ *
+ * @param visitor
+ * @param metadata
+ * @throws IOException
+ */
+ @SuppressWarnings("unchecked")
+ private static void addMetadataFromVisitor(JarVisitor visitor, String addPath, PersistenceMetadata metadata) throws IOException {
+ Set[] entries = visitor.getMatchingEntries();
+ Filter[] filters = visitor.getFilters();
+ int size = filters.length;
+ List<String> classes = metadata.getClasses();
+ List<String> packages = metadata.getPackages();
+ List<NamedInputStream> hbmFiles = metadata.getHbmfiles();
+ List<String> mappingFiles = metadata.getMappingFiles();
+ for (int index = 0; index < size; index++) {
+ for (Object o : entries[index]) {
+ Entry entry = (Entry) o;
+ if (filters[index] instanceof ClassFilter) {
+ classes.add(entry.getName());
+ } else if (filters[index] instanceof PackageFilter) {
+ packages.add(entry.getName());
+ } else if (filters[index] instanceof FileFilter) {
+ hbmFiles.add(new NamedInputStream(addPath + "/" + entry.getName(), //$NON-NLS-1$
+ entry.getInputStream()));
+ if (mappingFiles != null) {
+ mappingFiles.remove(entry.getName());
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This function code based on code from Ejb3Configuration.
+ * @see boolean[] Ejb3Configuration.getDetectedArtifacts(Properties properties, Map overridenProperties, boolean excludeIfNotOverriden)
+ *
+ * @param properties
+ * @param overridenProperties
+ * @param excludeIfNotOverriden
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ private static boolean[] getDetectedArtifacts(Properties properties, Map overridenProperties, boolean excludeIfNotOverriden) {
+ //result[0] - detect classes
+ //result[1] - detect hbm
+ boolean[] result = { false, false };
+ String detect = overridenProperties != null ?
+ (String) overridenProperties.get(HibernatePersistence.AUTODETECTION) : null;
+ detect = detect == null ?
+ properties.getProperty( HibernatePersistence.AUTODETECTION) : detect;
+ if (detect == null && excludeIfNotOverriden) {
+ //not overridden through HibernatePersistence.AUTODETECTION so we comply with the spec excludeUnlistedClasses
+ return result;
+ }
+ else if (detect == null){
+ detect = "class,hbm"; //$NON-NLS-1$
+ }
+ StringTokenizer st = new StringTokenizer(detect, ", ", false); //$NON-NLS-1$
+ while (st.hasMoreElements()) {
+ String element = (String)st.nextElement();
+ if ("class".equalsIgnoreCase(element)) { //$NON-NLS-1$
+ result[0] = true;
+ }
+ if ("hbm".equalsIgnoreCase(element)) { //$NON-NLS-1$
+ result[1] = true;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * This function code based on code from Ejb3Configuration.
+ * @see JarVisitor.Filter[] Ejb3Configuration.getFilters(PersistenceMetadata metadata, Map overridenProperties, boolean excludeIfNotOverriden)
+ *
+ * @param metadata
+ * @param overridenProperties
+ * @param excludeIfNotOverriden
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ private static Filter[] getFilters(PersistenceMetadata metadata, Map overridenProperties, boolean excludeIfNotOverriden) {
+ Properties properties = metadata.getProps();
+ final List<String> mappingFiles = metadata.getMappingFiles();
+ boolean[] detectedArtifacts = getDetectedArtifacts(properties, overridenProperties, excludeIfNotOverriden);
+ return getFilters(detectedArtifacts, true, mappingFiles);
+ }
+
+ private static Filter[] getFilters(final boolean[] detectedArtifacts, final boolean searchORM, final List<String> mappingFiles) {
+ final int mappingFilesSize = mappingFiles != null ? mappingFiles.size() : 0;
+ int size = (detectedArtifacts[0] ? 2 : 0) + ((searchORM || detectedArtifacts[1] || mappingFilesSize > 0) ? 1 : 0);
+ Filter[] filters = new Filter[size];
+ if (detectedArtifacts[0]) {
+ filters[0] = new PackageFilter(false, null) {
+ public boolean accept(String javaElementName) {
+ return true;
+ }
+ };
+ filters[1] = new ClassFilter(
+ false, new Class[] {
+ Entity.class,
+ MappedSuperclass.class,
+ Embeddable.class}
+ ) {
+ public boolean accept(String javaElementName) {
+ return true;
+ }
+ };
+ }
+ if (detectedArtifacts[1] || searchORM || mappingFilesSize > 0) {
+ filters[size - 1] = new FileFilter(true) {
+ public boolean accept(String javaElementName) {
+ return (detectedArtifacts[1] && javaElementName.endsWith("hbm.xml")) //$NON-NLS-1$
+ || (searchORM && javaElementName.endsWith(META_INF_ORM_XML))
+ || (mappingFilesSize > 0 && mappingFiles.contains(javaElementName));
+ }
+ };
+ }
+ return filters;
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ParserHelper.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ParserHelper.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ParserHelper.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,9 @@
+package org.hibernate.mediator.stubs.util;
+
+public class ParserHelper {
+ public static final String HQL_VARIABLE_PREFIX = ":"; //$NON-NLS-1$
+
+ public static final String HQL_SEPARATORS = " \n\r\f\t,()=<>&|+-=/*'^![]#~\\"; //$NON-NLS-1$
+ //NOTICE: no " or . since they are part of (compound) identifiers
+ public static final String PATH_SEPARATORS = "."; //$NON-NLS-1$
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ReflectHelper.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ReflectHelper.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ReflectHelper.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,29 @@
+package org.hibernate.mediator.stubs.util;
+
+//org.hibernate.util.ReflectHelper
+public final class ReflectHelper {
+
+ @SuppressWarnings("unchecked")
+ public static Class classForName(String name) throws ClassNotFoundException {
+ try {
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ if (contextClassLoader != null) {
+ return contextClassLoader.loadClass(name);
+ }
+ } catch (Throwable ignore) {
+ }
+ return Class.forName(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Class classForName(String name, Class caller) throws ClassNotFoundException {
+ try {
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ if (contextClassLoader != null) {
+ return contextClassLoader.loadClass(name);
+ }
+ } catch (Throwable ignore) {
+ }
+ return Class.forName(name, true, caller.getClassLoader());
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/StringHelper.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/StringHelper.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/StringHelper.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,79 @@
+package org.hibernate.mediator.stubs.util;
+
+import java.util.ArrayList;
+
+import org.hibernate.util.ArrayHelper;
+
+// org.hibernate.util.StringHelper
+public final class StringHelper {
+ public static final String WHITESPACE = " \n\r\f\t"; //$NON-NLS-1$
+
+ public static boolean isNotEmpty(String string) {
+ return string != null && string.length() > 0;
+ }
+
+ public static boolean isEmpty(String string) {
+ return string == null || string.length() == 0;
+ }
+
+ public static String unqualify(String qualifiedName) {
+ int loc = qualifiedName.lastIndexOf("."); //$NON-NLS-1$
+ return (loc < 0) ? qualifiedName : qualifiedName.substring(loc + 1);
+ }
+
+ public static String qualifier(String qualifiedName) {
+ int loc = qualifiedName.lastIndexOf("."); //$NON-NLS-1$
+ return (loc < 0) ? "" : qualifiedName.substring(0, loc); //$NON-NLS-1$
+ }
+
+ public static String qualify(String prefix, String name) {
+ if (name == null || prefix == null) {
+ throw new NullPointerException();
+ }
+ return new StringBuffer(prefix.length() + name.length() + 1).append(prefix).append('.')
+ .append(name).toString();
+ }
+
+ public static String join(String seperator, String[] strings) {
+ int length = strings.length;
+ if (length == 0)
+ return ""; //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer(length * strings[0].length()).append(strings[0]);
+ for (int i = 1; i < length; i++) {
+ buf.append(seperator).append(strings[i]);
+ }
+ return buf.toString();
+ }
+
+ public static int[] locateUnquoted(String string, char character) {
+ if ( '\'' == character ) {
+ throw new IllegalArgumentException( "Unquoted count of quotes is invalid" ); //$NON-NLS-1$
+ }
+ if (string == null) {
+ return new int[0];
+ }
+
+ ArrayList<Integer> locations = new ArrayList<Integer>( 20 );
+
+ // Impl note: takes advantage of the fact that an escpaed single quote
+ // embedded within a quote-block can really be handled as two seperate
+ // quote-blocks for the purposes of this method...
+ int stringLength = string.length();
+ boolean inQuote = false;
+ for ( int indx = 0; indx < stringLength; indx++ ) {
+ char c = string.charAt( indx );
+ if ( inQuote ) {
+ if ( '\'' == c ) {
+ inQuote = false;
+ }
+ }
+ else if ( '\'' == c ) {
+ inQuote = true;
+ }
+ else if ( c == character ) {
+ locations.add( new Integer( indx ) );
+ }
+ }
+ return ArrayHelper.toIntArray( locations );
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/XMLHelper.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/XMLHelper.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/XMLHelper.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,45 @@
+package org.hibernate.mediator.stubs.util;
+
+import java.util.List;
+
+import org.dom4j.io.SAXReader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXParseException;
+
+@SuppressWarnings("unchecked")
+public class XMLHelper {
+
+ private static final Logger log = LoggerFactory.getLogger(XMLHelper.class);
+ private SAXReader saxReader;
+
+ public SAXReader createSAXReader(String file, List errorsList, EntityResolver entityResolver) {
+ if (saxReader==null) saxReader = new SAXReader();
+ saxReader.setEntityResolver(entityResolver);
+ saxReader.setErrorHandler(new ErrorLogger(file, errorsList));
+ saxReader.setMergeAdjacentText(true);
+ saxReader.setValidation(true);
+ return saxReader;
+ }
+
+ public static class ErrorLogger implements ErrorHandler {
+ private String file;
+ private List errors;
+ ErrorLogger(String file, List errors) {
+ this.file=file;
+ this.errors = errors;
+ }
+ public void error(SAXParseException error) {
+ log.error( "Error parsing XML: " + file + '(' + error.getLineNumber() + ") " + error.getMessage() ); //$NON-NLS-1$ //$NON-NLS-2$
+ errors.add(error);
+ }
+ public void fatalError(SAXParseException error) {
+ error(error);
+ }
+ public void warning(SAXParseException warn) {
+ log.warn( "Warning parsing XML: " + file + '(' + warn.getLineNumber() + ") " + warn.getMessage() ); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/CollectionPropertySource.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/CollectionPropertySource.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/CollectionPropertySource.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator.util;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.PropertyDescriptor;
+
+public class CollectionPropertySource implements IPropertySource {
+
+ private Collection<?> collection;
+
+ IPropertyDescriptor[] descriptors = null;
+
+ Map<Object, Object> values = new WeakHashMap<Object, Object>();
+
+ public CollectionPropertySource(Collection<?> propertyValue) {
+ collection = propertyValue;
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (descriptors == null) {
+ PropertyDescriptor[] properties = new PropertyDescriptor[collection.size()];
+ for (int i = 0; i < properties.length; i++) {
+ properties[i] = new PropertyDescriptor(Integer.valueOf(i), "#" + i); //$NON-NLS-1$
+ }
+ descriptors = properties;
+ }
+ return descriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ Object value = values.get(id);
+ if (value == null) {
+ Integer i = (Integer) id;
+ Iterator<?> iterator = collection.iterator();
+ int base = 0;
+
+ while (iterator.hasNext()) {
+
+ value = iterator.next();
+
+ if (base == i.intValue()) {
+ values.put(id, value);
+ return value;
+ } else {
+ value = null;
+ }
+ base++;
+ }
+ }
+
+ return value;
+ }
+
+ public boolean isPropertySet(Object id) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/ELTransformer.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/ELTransformer.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/ELTransformer.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,28 @@
+package org.hibernate.mediator.util;
+
+public class ELTransformer {
+
+ /**
+ * transform any #{el expressions} into named parameters so HQL validation won't fail on it.
+ *
+ * @param hql
+ * @return
+ */
+ static public String removeEL(String hql) {
+ int elStart = hql.indexOf("#{"); //$NON-NLS-1$
+ int next = hql.indexOf("}", elStart); //$NON-NLS-1$
+
+ while (elStart != -1 && next != -1) {
+ String result = hql.substring(0, elStart);
+ result += ":_" + hql.substring(elStart + 2, next).replaceAll("[^\\p{javaJavaIdentifierStart}]", "_") + "_"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ result += hql.substring(next + 1);
+
+ hql = result;
+
+ elStart = hql.indexOf("#{"); //$NON-NLS-1$
+ next = hql.indexOf("}", elStart); //$NON-NLS-1$
+ }
+
+ return hql;
+ }
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/Formatter.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/Formatter.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/Formatter.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,375 @@
+package org.hibernate.mediator.util;
+
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.hibernate.mediator.stubs.util.StringHelper;
+
+/**
+ * Old formatter from previous Hibernate versions which allowed a bit more control, i.e. we want *less* spaces not more.
+ * In here to simplify migration from 3.2 to 3.3 where this class changed.
+ *
+ */
+@SuppressWarnings({ "unchecked", "nls" })
+public class Formatter {
+
+ private static final Set BEGIN_CLAUSES = new HashSet();
+ private static final Set END_CLAUSES = new HashSet();
+ private static final Set LOGICAL = new HashSet();
+ private static final Set QUANTIFIERS = new HashSet();
+ private static final Set DML = new HashSet();
+ private static final Set MISC = new HashSet();
+ static {
+
+ BEGIN_CLAUSES.add("left");
+ BEGIN_CLAUSES.add("right");
+ BEGIN_CLAUSES.add("inner");
+ BEGIN_CLAUSES.add("outer");
+ BEGIN_CLAUSES.add("group");
+ BEGIN_CLAUSES.add("order");
+
+ END_CLAUSES.add("where");
+ END_CLAUSES.add("set");
+ END_CLAUSES.add("having");
+ END_CLAUSES.add("join");
+ END_CLAUSES.add("from");
+ END_CLAUSES.add("by");
+ END_CLAUSES.add("join");
+ END_CLAUSES.add("into");
+ END_CLAUSES.add("union");
+
+ LOGICAL.add("and");
+ LOGICAL.add("or");
+ LOGICAL.add("when");
+ LOGICAL.add("else");
+ LOGICAL.add("end");
+
+ QUANTIFIERS.add("in");
+ QUANTIFIERS.add("all");
+ QUANTIFIERS.add("exists");
+ QUANTIFIERS.add("some");
+ QUANTIFIERS.add("any");
+
+ DML.add("insert");
+ DML.add("update");
+ DML.add("delete");
+
+ MISC.add("select");
+ MISC.add("on");
+ //MISC.add("values");
+
+ }
+
+ String indentString = " ";
+ String initial = "\n ";
+
+ boolean beginLine = true;
+ boolean afterBeginBeforeEnd = false;
+ boolean afterByOrSetOrFromOrSelect = false;
+ boolean afterValues = false;
+ boolean afterOn = false;
+ boolean afterBetween = false;
+ boolean afterInsert = false;
+ int inFunction = 0;
+ int parensSinceSelect = 0;
+ private LinkedList parenCounts = new LinkedList();
+ private LinkedList afterByOrFromOrSelects = new LinkedList();
+
+ int indent = 1;
+
+ StringBuffer result = new StringBuffer();
+ StringTokenizer tokens;
+ String lastToken;
+ String token;
+ String lcToken;
+
+ public Formatter(String sql) {
+ tokens = new StringTokenizer(
+ sql,
+ "()+*/-=<>'`\"[]," + StringHelper.WHITESPACE,
+ true
+ );
+ }
+
+ public Formatter setInitialString(String initial) {
+ this.initial = initial;
+ return this;
+ }
+
+ public Formatter setIndentString(String indent) {
+ this.indentString = indent;
+ return this;
+ }
+
+ public String format() {
+
+ result.append(initial);
+
+ while ( tokens.hasMoreTokens() ) {
+ token = tokens.nextToken();
+ lcToken = token.toLowerCase();
+
+ if ( "'".equals(token) ) {
+ String t;
+ do {
+ t = tokens.nextToken();
+ token += t;
+ }
+ while ( !"'".equals(t) && tokens.hasMoreTokens() ); // cannot handle single quotes
+ }
+ else if ( "\"".equals(token) ) {
+ String t;
+ do {
+ t = tokens.nextToken();
+ token += t;
+ }
+ while ( !"\"".equals(t) );
+ }
+
+ if ( afterByOrSetOrFromOrSelect && ",".equals(token) ) {
+ commaAfterByOrFromOrSelect();
+ }
+ else if ( afterOn && ",".equals(token) ) {
+ commaAfterOn();
+ }
+
+ else if ( "(".equals(token) ) {
+ openParen();
+ }
+ else if ( ")".equals(token) ) {
+ closeParen();
+ }
+
+ else if ( BEGIN_CLAUSES.contains(lcToken) ) {
+ beginNewClause();
+ }
+
+ else if ( END_CLAUSES.contains(lcToken) ) {
+ endNewClause();
+ }
+
+ else if ( "select".equals(lcToken) ) {
+ select();
+ }
+
+ else if ( DML.contains(lcToken) ) {
+ updateOrInsertOrDelete();
+ }
+
+ else if ( "values".equals(lcToken) ) {
+ values();
+ }
+
+ else if ( "on".equals(lcToken) ) {
+ on();
+ }
+
+ else if ( afterBetween && lcToken.equals("and") ) {
+ misc();
+ afterBetween = false;
+ }
+
+ else if ( LOGICAL.contains(lcToken) ) {
+ logical();
+ }
+
+ else if ( isWhitespace(token) ) {
+ white();
+ }
+
+ else {
+ misc();
+ }
+
+ if ( !isWhitespace( token ) ) lastToken = lcToken;
+
+ }
+ return result.toString();
+ }
+
+ private void commaAfterOn() {
+ out();
+ indent--;
+ newline();
+ afterOn = false;
+ afterByOrSetOrFromOrSelect = true;
+ }
+
+ private void commaAfterByOrFromOrSelect() {
+ out();
+ newline();
+ }
+
+ private void logical() {
+ if ( "end".equals(lcToken) ) indent--;
+ newline();
+ out();
+ beginLine = false;
+ }
+
+ private void on() {
+ indent++;
+ afterOn = true;
+ newline();
+ out();
+ beginLine = false;
+ }
+
+ private void misc() {
+ out();
+ if ( "between".equals(lcToken) ) {
+ afterBetween = true;
+ }
+ if (afterInsert) {
+ newline();
+ afterInsert = false;
+ }
+ else {
+ beginLine = false;
+ if ( "case".equals(lcToken) ) {
+ indent++;
+ }
+ }
+ }
+
+ private void white() {
+ if ( !beginLine ) {
+ result.append(" ");
+ }
+ }
+
+ private void updateOrInsertOrDelete() {
+ out();
+ indent++;
+ beginLine = false;
+ if ( "update".equals(lcToken) ) newline();
+ if ( "insert".equals(lcToken) ) afterInsert = true;
+ }
+
+ private void select() {
+ out();
+ indent++;
+ newline();
+ parenCounts.addLast( new Integer(parensSinceSelect) );
+ afterByOrFromOrSelects.addLast( new Boolean(afterByOrSetOrFromOrSelect) );
+ parensSinceSelect = 0;
+ afterByOrSetOrFromOrSelect = true;
+ }
+
+ private void out() {
+ result.append(token);
+ }
+
+ private void endNewClause() {
+ if (!afterBeginBeforeEnd) {
+ indent--;
+ if (afterOn) {
+ indent--;
+ afterOn=false;
+ }
+ newline();
+ }
+ out();
+ if ( !"union".equals(lcToken) ) indent++;
+ newline();
+ afterBeginBeforeEnd = false;
+ afterByOrSetOrFromOrSelect = "by".equals(lcToken)
+ || "set".equals(lcToken)
+ || "from".equals(lcToken);
+ }
+
+ private void beginNewClause() {
+ if (!afterBeginBeforeEnd) {
+ if (afterOn) {
+ indent--;
+ afterOn=false;
+ }
+ indent--;
+ newline();
+ }
+ out();
+ beginLine = false;
+ afterBeginBeforeEnd = true;
+ }
+
+ private void values() {
+ indent--;
+ newline();
+ out();
+ indent++;
+ newline();
+ afterValues = true;
+ }
+
+ private void closeParen() {
+ parensSinceSelect--;
+ if (parensSinceSelect<0) {
+ indent--;
+ parensSinceSelect = ( (Integer) parenCounts.removeLast() ).intValue();
+ afterByOrSetOrFromOrSelect = ( (Boolean) afterByOrFromOrSelects.removeLast() ).booleanValue();
+ }
+ if ( inFunction>0 ) {
+ inFunction--;
+ out();
+ }
+ else {
+ if (!afterByOrSetOrFromOrSelect) {
+ indent--;
+ newline();
+ }
+ out();
+ }
+ beginLine = false;
+ }
+
+ private void openParen() {
+ if ( isFunctionName( lastToken ) || inFunction>0 ) {
+ inFunction++;
+ }
+ beginLine = false;
+ if ( inFunction>0 ) {
+ out();
+ }
+ else {
+ out();
+ if (!afterByOrSetOrFromOrSelect) {
+ indent++;
+ newline();
+ beginLine = true;
+ }
+ }
+ parensSinceSelect++;
+ }
+
+ private static boolean isFunctionName(String tok) {
+ final char begin = tok.charAt(0);
+ final boolean isIdentifier = Character.isJavaIdentifierStart( begin ) || '"'==begin;
+ return isIdentifier &&
+ !LOGICAL.contains(tok) &&
+ !END_CLAUSES.contains(tok) &&
+ !QUANTIFIERS.contains(tok) &&
+ !DML.contains(tok) &&
+ !MISC.contains(tok);
+ }
+
+ private static boolean isWhitespace(String token) {
+ return StringHelper.WHITESPACE.indexOf(token)>=0;
+ }
+
+ private void newline() {
+ result.append("\n");
+ for ( int i=0; i<indent; i++ ) {
+ result.append(indentString);
+ }
+ beginLine = true;
+ }
+
+ public static void main(String[] args) {
+ if ( args.length>0 ) System.out.println(
+ new Formatter( StringHelper.join(" ", args) ).format()
+ );
+ }
+
+}
Added: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/QLFormatHelper.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/QLFormatHelper.java (rev 0)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/QLFormatHelper.java 2010-03-29 15:58:02 UTC (rev 21117)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.hibernate.mediator.util;
+
+public class QLFormatHelper {
+
+ static public String formatForScreen(String query) {
+ return new Formatter(query).setInitialString("").setIndentString(" ").format(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+}
14 years, 11 months
JBoss Tools SVN: r21116 - in trunk/jsf/plugins: org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-03-29 09:46:13 -0400 (Mon, 29 Mar 2010)
New Revision: 21116
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELRefactorContributionFactory.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameELVariableProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4990
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameELVariableProcessor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameELVariableProcessor.java 2010-03-29 13:09:02 UTC (rev 21115)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameELVariableProcessor.java 2010-03-29 13:46:13 UTC (rev 21116)
@@ -33,6 +33,7 @@
* @author Daniel Azarov
*/
public class RenameELVariableProcessor extends ELRenameProcessor {
+ private final static String MANAGED_BEAN_NAME_ATTRIBUTE = "managed-bean-name";
IFile file;
/**
@@ -70,7 +71,7 @@
throws CoreException, OperationCanceledException {
RefactoringStatus result = new RefactoringStatus();
- if(findManagedBean() == null)
+ if(findManagedBean(file, getOldName()) == null)
result.addFatalError(Messages.format(ElCoreMessages.RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_EL_VARIABLE, getOldName()));
return result;
}
@@ -133,15 +134,15 @@
}
private void renameELVariable(IProgressMonitor pm, IFile file){
- XModelObject managedBean = findManagedBean();
+ XModelObject managedBean = findManagedBean(file, getOldName());
if(managedBean != null){
- Change managedBeanChange = RenameModelObjectChange.createChange(new XModelObject[]{managedBean}, getNewName(), "managed-bean-name");
+ Change managedBeanChange = RenameModelObjectChange.createChange(new XModelObject[]{managedBean}, getNewName(), MANAGED_BEAN_NAME_ATTRIBUTE);
rootChange.add(managedBeanChange);
getSearcher().findELReferences();
}
}
- private XModelObject findManagedBean(){
+ public static XModelObject findManagedBean(IFile file, String name){
IModelNature nature = EclipseResourceUtil.getModelNature(file.getProject());
if(nature == null)
return null;
@@ -149,9 +150,17 @@
if(model == null)
return null;
JSFBeanSearcher beanSearcher = new JSFBeanSearcher(model);
- beanSearcher.parse(getOldName());
+ beanSearcher.parse(name);
XModelObject managedBean = beanSearcher.getBean();
return managedBean;
}
+
+ public static String getManagedBeanName(IFile file, String text){
+ XModelObject managedBean = findManagedBean(file, text);
+ if(managedBean != null){
+ return managedBean.getAttributeValue(MANAGED_BEAN_NAME_ATTRIBUTE);
+ }
+ return null;
+ }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELRefactorContributionFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELRefactorContributionFactory.java 2010-03-29 13:09:02 UTC (rev 21115)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELRefactorContributionFactory.java 2010-03-29 13:46:13 UTC (rev 21116)
@@ -13,17 +13,10 @@
import java.io.IOException;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse.jface.action.Action;
@@ -61,13 +54,12 @@
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.propertieseditor.PropertiesCompoundEditor;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jsf.el.refactoring.RenameELVariableProcessor;
import org.jboss.tools.jsf.el.refactoring.RenameELVariableRefactoring;
-import org.jboss.tools.jsf.ui.JsfUiPlugin;
import org.jboss.tools.jsf.ui.JsfUIMessages;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
import org.jboss.tools.jst.web.ui.editors.WebCompoundEditor;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -212,8 +204,13 @@
for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
ELPropertyInvocation pi = findELVariable(ie);
if(pi != null){
- if(offset+pi.getStartPosition() == selection.getOffset() && pi.getLength() == selection.getLength())
- return true;
+ if(offset+pi.getStartPosition() == selection.getOffset() && pi.getLength() == selection.getLength()){
+ String beanName = RenameELVariableProcessor.getManagedBeanName(file, pi.getText());
+ if(beanName != null){
+ selectedText = beanName;
+ return true;
+ }
+ }
}
}
}
14 years, 11 months