Author: vyemialyanchyk
Date: 2010-04-06 08:34:30 -0400 (Tue, 06 Apr 2010)
New Revision: 21286
Added:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCodeAssistStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SchemaExportStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/MReflectionUtils.java
Removed:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java
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/launch/CodeGenerationSettingsTab.java
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/src/org/hibernate/console/ConsoleConfiguration.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/base/HObject.java
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/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/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/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/FormulaStub.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/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/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/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/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/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/SelectableStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.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/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/UnionSubclassStub.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/XMLPrettyPrinterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ClassHelper.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 - create/invoke by string name - for all
classes
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-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -45,7 +45,7 @@
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.HQLCodeAssistStub;
import org.hibernate.mediator.stubs.SessionStub;
import org.hibernate.mediator.stubs.SessionFactoryStub;
import org.hibernate.mediator.stubs.SettingsStub;
@@ -446,7 +446,7 @@
return configStub.getEntityResolver();
}
- public IHQLCodeAssistStub getHQLCodeAssist() {
+ public HQLCodeAssistStub getHQLCodeAssist() {
if (configStub == null) {
try{
build();
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-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -38,7 +38,7 @@
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.QueryEditor;
-import org.hibernate.mediator.stubs.IHQLCodeAssistStub;
+import org.hibernate.mediator.stubs.HQLCodeAssistStub;
/**
* content assist processor for HQL code.
@@ -109,11 +109,11 @@
errorMessage =
HibernateConsoleMessages.HQLCompletionProcessor_could_not_get_document_contents;
return result;
}
- IHQLCodeAssistStub hqlEval = null;
+ HQLCodeAssistStub hqlEval = null;
if (consoleConfig != null) {
hqlEval = consoleConfig.getHQLCodeAssist();
} else {
- hqlEval = IHQLCodeAssistStub.createHQLCodeAssist();
+ hqlEval = HQLCodeAssistStub.createHQLCodeAssist();
}
EclipseHQLCompletionRequestor eclipseHQLCompletionCollector = new
EclipseHQLCompletionRequestor();
hqlEval.codeComplete(doc.get(), currentOffset, eclipseHQLCompletionCollector);
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-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -155,7 +155,7 @@
reverseEngineeringStrategy = new StringButtonDialogField(new
IStringButtonAdapter() {
public void changeControlPressed(DialogField field) {
- String string =
DialogSelectionHelper.chooseImplementation(ReverseEngineeringStrategyStub.getClassName(),
reverseEngineeringStrategy.getText(),
HibernateConsoleMessages.CodeGenerationSettingsTab_choose_reverse_engineering_strategy,
getShell());
+ String string =
DialogSelectionHelper.chooseImplementation(ReverseEngineeringStrategyStub.CL,
reverseEngineeringStrategy.getText(),
HibernateConsoleMessages.CodeGenerationSettingsTab_choose_reverse_engineering_strategy,
getShell());
if(string!=null) {
reverseEngineeringStrategy.setText(string);
}
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-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -39,7 +39,7 @@
import org.hibernate.eclipse.hqleditor.EclipseHQLCompletionRequestor;
import org.hibernate.eclipse.hqleditor.HQLCompletionProcessor;
import org.hibernate.eclipse.nature.HibernateNature;
-import org.hibernate.mediator.stubs.IHQLCodeAssistStub;
+import org.hibernate.mediator.stubs.HQLCodeAssistStub;
public class HQLJavaCompletionProposalComputer implements IJavaCompletionProposalComputer
{
@@ -76,7 +76,7 @@
try {
ConsoleConfiguration consoleConfig = getConfiguration( ctx.getProject() );
if (consoleConfig != null) {
- IHQLCodeAssistStub hqlEval = consoleConfig.getHQLCodeAssist();
+ HQLCodeAssistStub hqlEval = consoleConfig.getHQLCodeAssist();
String query = ""; //$NON-NLS-1$
int stringStart = getStringStart( ctx.getDocument(), ctx.getInvocationOffset() );
int stringEnd = getStringEnd( ctx.getDocument(), ctx.getInvocationOffset() );
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-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -577,7 +577,7 @@
}
prop.setCascade("none");//$NON-NLS-1$
} else if (tb.isEnum()){
- value = buildSimpleValue(EnumTypeStub.getClassName());
+ value = buildSimpleValue(EnumTypeStub.CL);
Properties typeParameters = new Properties();
typeParameters.put(EnumTypeStub.ENUM, tb.getBinaryName());
typeParameters.put(EnumTypeStub.TYPE, java.sql.Types.VARCHAR);
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/base/HObject.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/base/HObject.java 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/base/HObject.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,11 +1,15 @@
package org.hibernate.mediator.base;
import java.beans.Expression;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import org.hibernate.mediator.Messages;
import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
import org.hibernate.mediator.stubs.util.ClassHelper;
import org.hibernate.mediator.stubs.util.ReflectHelper;
+import org.hibernate.mediator.util.MReflectionUtils;
public class HObject {
// store object
@@ -46,42 +50,34 @@
return invoke(methodName, new HObject[0]);
}
- // TODO: get rid of Object -> HObject
public Object invoke(final String methodName, Object param0) {
- return invoke(methodName, new HObject[] { new HObject(param0) });
+ return invoke(methodName, new HObject[] { ho(param0) });
}
- // TODO: get rid of Object -> HObject
public Object invoke(final String methodName, Object param0, Object param1) {
- return invoke(methodName, new HObject[] { new HObject(param0), new HObject(param1) });
+ return invoke(methodName, new HObject[] { ho(param0), ho(param1) });
}
- // TODO: get rid of Object -> HObject
public Object invoke(final String methodName, Object param0, Object param1, Object
param2) {
- return invoke(methodName, new HObject[] { new HObject(param0), new HObject(param1),
- new HObject(param2) });
+ return invoke(methodName, new HObject[] { ho(param0), ho(param1), ho(param2) });
}
- // TODO: get rid of Object -> HObject
public Object invoke(final String methodName, Object param0, Object param1, Object
param2,
Object param3) {
- return invoke(methodName, new HObject[] { new HObject(param0), new HObject(param1),
- new HObject(param2), new HObject(param3) });
+ return invoke(methodName, new HObject[] { ho(param0), ho(param1), ho(param2),
+ ho(param3) });
}
- // TODO: get rid of Object -> HObject
public Object invoke(final String methodName, Object param0, Object param1, Object
param2,
Object param3, Object param4) {
- return invoke(methodName, new HObject[] { new HObject(param0), new HObject(param1),
- new HObject(param2), new HObject(param3), new HObject(param4) });
+ return invoke(methodName, new HObject[] { ho(param0), ho(param1), ho(param2),
+ ho(param3), ho(param4) });
}
- // TODO: get rid of Object -> HObject
public Object invoke(final String methodName, Object param0, Object param1, Object
param2,
Object param3, Object param4, Object param5) {
- return invoke(methodName,
- new HObject[] { new HObject(param0), new HObject(param1), new HObject(param2),
- new HObject(param3), new HObject(param4), new HObject(param5) });
+ return invoke(methodName, new HObject[] { ho(param0), ho(param1), ho(param2),
+ ho(param3), ho(param4), ho(param5) });
}
//
@@ -105,26 +101,74 @@
}
}
+
//
+ public static Object invokeStaticMethod(final String className, final String methodName)
{
+ return invokeStaticMethod(className, methodName, new HObject[0]);
+ }
+
+ public static Object invokeStaticMethod(final String className, final String methodName,
Object param0) {
+ return invokeStaticMethod(className, methodName, new HObject[] { ho(param0) });
+ }
+
+ public static Object invokeStaticMethod(final String className, final String methodName,
Object param0, Object param1) {
+ return invokeStaticMethod(className, methodName, new HObject[] { ho(param0), ho(param1)
});
+ }
+
+ public static Object invokeStaticMethod(final String className, final String methodName,
Object param0, Object param1, Object param2) {
+ return invokeStaticMethod(className, methodName, new HObject[] { ho(param0),
ho(param1), ho(param2) });
+ }
+
+ public static Object invokeStaticMethod(final String className, final String
methodName, HObject[] params ) {
+ Class<?>[] signature = new Class<?>[params.length];
+ Object[] vals = new Object[params.length];
+ for (int i = 0; i < params.length; i++) {
+ signature[i] = params[i].Cl();
+ vals[i] = params[i].obj;
+ }
+ Class<?> clazz;
+ try {
+ clazz = ReflectHelper.classForName(className);
+ } catch (ClassNotFoundException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ Method method = MReflectionUtils.getMethod(clazz, methodName, signature );
+ Object res;
+ try {
+ res = method.invoke(null, vals);
+ } catch (IllegalArgumentException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ return res;
+ }
+
+ //
public static Object newInstance(final String cn) {
return newInstance(cn, new HObject[0]);
}
- // TODO: get rid of Object -> HObject
public static Object newInstance(final String cn, Object param0) {
- return newInstance(cn, new HObject[] { new HObject(param0) });
+ return newInstance(cn, new HObject[] { ho(param0) });
}
- // TODO: get rid of Object -> HObject
public static Object newInstance(final String cn, Object param0, Object param1) {
- return newInstance(cn, new HObject[] { new HObject(param0), new HObject(param1) });
+ return newInstance(cn, new HObject[] { ho(param0), ho(param1) });
}
- // TODO: get rid of Object -> HObject
public static Object newInstance(final String cn, Object param0, Object param1, Object
param2) {
- return newInstance(cn, new HObject[] { new HObject(param0), new HObject(param1),
- new HObject(param2) });
+ return newInstance(cn, new HObject[] { ho(param0), ho(param1), ho(param2) });
}
+
+ protected static HObject ho(Object obj) {
+ if (obj instanceof HObject) {
+ return (HObject)obj;
+ }
+ return new HObject(obj);
+ }
//
public static Object newInstance(final String cn, HObject[] params) {
@@ -167,4 +211,28 @@
}
return ""; //$NON-NLS-1$
}
+
+ public static final Object readStaticFieldValue(final String className, String
fieldName) {
+ Class<?> clazz;
+ try {
+ clazz = ReflectHelper.classForName(className);
+ } catch (ClassNotFoundException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ Field fld;
+ try {
+ fld = clazz.getDeclaredField(fieldName);
+ } catch (SecurityException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (NoSuchFieldException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ try {
+ return fld.get(null);
+ } catch (IllegalArgumentException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ }
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -6,4 +6,8 @@
protected AbstractTypeStub(Object abstractType) {
super(abstractType, CL);
}
+
+ protected AbstractTypeStub(Object abstractType, String cn) {
+ super(abstractType, cn);
+ }
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -18,22 +18,22 @@
}
public void setElement(ValueStub element) {
- invoke("setElement", element); //$NON-NLS-1$
+ invoke(mn(), element);
}
public void setCollectionTable(TableStub table) {
- invoke("setCollectionTable", table); //$NON-NLS-1$
+ invoke(mn(), table);
}
public void setElementClassName(String elementClassName) {
- invoke("setElementClassName", elementClassName); //$NON-NLS-1$
+ invoke(mn(), elementClassName);
}
public void setIndex(ValueStub index) {
- invoke("setIndex", index); //$NON-NLS-1$
+ invoke(mn(), index);
}
public String getElementClassName() {
- return (String)invoke("getElementClassName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -16,11 +16,11 @@
}
public File[] getFiles(String string) {
- return (File[])invoke("getFiles", string); //$NON-NLS-1$
+ return (File[])invoke(mn(), string);
}
public void formatFiles() {
- invoke("formatFiles"); //$NON-NLS-1$
+ invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -14,10 +14,10 @@
}
public String getTag(PersistentClassStub persistentClass) {
- return (String)invoke("getTag", persistentClass); //$NON-NLS-1$
+ return (String)invoke(mn(), persistentClass);
}
public String getTag(PropertyStub property) {
- return (String)invoke("getTag", property); //$NON-NLS-1$
+ return (String)invoke(mn(), property);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,27 +1,20 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.metadata.ClassMetadata;
-import org.hibernate.type.Type;
+import org.hibernate.mediator.base.HObject;
-public class ClassMetadataStub {
+public class ClassMetadataStub extends HObject {
public static final String CL = "org.hibernate.metadata.ClassMetadata";
//$NON-NLS-1$
- protected ClassMetadata classMetadata;
-
protected ClassMetadataStub(Object classMetadata) {
- if (classMetadata == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.classMetadata = (ClassMetadata)classMetadata;
+ super(classMetadata, CL);
}
public String[] getPropertyNames() {
- return classMetadata.getPropertyNames();
+ return (String[])invoke(mn());
}
public TypeStub[] getPropertyTypes() {
- Type[] types = classMetadata.getPropertyTypes();
+ Object[] types = (Object[])invoke(mn());
TypeStub[] res = new TypeStub[types.length];
for (int i = 0; i < types.length; i++) {
res[i] = TypeStubFactory.createTypeStub(types[i]);
@@ -30,23 +23,23 @@
}
public String getIdentifierPropertyName() {
- return classMetadata.getIdentifierPropertyName();
+ return (String)invoke(mn());
}
public Object getPropertyValue(Object baseObject, String name, EntityModeStub pojo) {
- return classMetadata.getPropertyValue(baseObject, name, pojo.entityMode);
+ return invoke(mn(), baseObject, name, pojo);
}
public String getEntityName() {
- return classMetadata.getEntityName();
+ return (String)invoke(mn());
}
public TypeStub getIdentifierType() {
- return TypeStubFactory.createTypeStub(classMetadata.getIdentifierType());
+ return TypeStubFactory.createTypeStub(invoke(mn()));
}
public Class<?> getMappedClass(EntityModeStub pojo) {
- return classMetadata.getMappedClass(pojo.entityMode);
+ return (Class<?>)invoke(mn(), pojo);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,21 +1,15 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.metadata.CollectionMetadata;
+import org.hibernate.mediator.base.HObject;
-public class CollectionMetadataStub {
+public class CollectionMetadataStub extends HObject {
public static final String CL = "org.hibernate.metadata.CollectionMetadata";
//$NON-NLS-1$
- protected CollectionMetadata collectionMetadata;
-
protected CollectionMetadataStub(Object collectionMetadata) {
- if (collectionMetadata == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.collectionMetadata = (CollectionMetadata)collectionMetadata;
+ super(collectionMetadata, CL);
}
public TypeStub getElementType() {
- return TypeStubFactory.createTypeStub(collectionMetadata.getElementType());
+ return TypeStubFactory.createTypeStub(invoke(mn()));
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,35 +12,35 @@
}
public void setCollectionTable(TableStub table) {
- invoke("setCollectionTable", table); //$NON-NLS-1$
+ invoke(mn(), table);
}
public void setKey(KeyValueStub key) {
- invoke("setKey", key); //$NON-NLS-1$
+ invoke(mn(), key);
}
public void setLazy(boolean lazy) {
- invoke("setLazy", lazy); //$NON-NLS-1$
+ invoke(mn(), lazy);
}
public void setRole(String role) {
- invoke("setRole", role); //$NON-NLS-1$
+ invoke(mn(), role);
}
public void setElement(ValueStub element) {
- invoke("setElement", element); //$NON-NLS-1$
+ invoke(mn(), element);
}
public void setFetchMode(FetchModeStub fetchMode) {
- invoke("setFetchMode", fetchMode); //$NON-NLS-1$
+ invoke(mn(), fetchMode);
}
public ValueStub getElement() {
- return ValueStubFactory.createValueStub(invoke("getElement")); //$NON-NLS-1$
+ return ValueStubFactory.createValueStub(invoke(mn()));
}
public TableStub getCollectionTable() {
- Object obj = invoke("getCollectionTable"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -48,14 +48,14 @@
}
public KeyValueStub getKey() {
- return (KeyValueStub)ValueStubFactory.createValueStub(invoke("getKey"));
//$NON-NLS-1$
+ return (KeyValueStub)ValueStubFactory.createValueStub(invoke(mn()));
}
public boolean isOneToMany() {
- return (Boolean)invoke("isOneToMany"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isInverse() {
- return (Boolean)invoke("isInverse"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,27 +1,18 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.type.CollectionType;
-
public class CollectionTypeStub extends AbstractTypeStub {
public static final String CL = "org.hibernate.type.CollectionType";
//$NON-NLS-1$
- protected CollectionType collectionType;
-
protected CollectionTypeStub(Object collectionType) {
- super(collectionType);
- if (collectionType == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.collectionType = (CollectionType)collectionType;
+ super(collectionType, CL);
}
public String getRole() {
- return collectionType.getRole();
+ return (String)invoke(mn());
}
public boolean isArrayType() {
- return collectionType.isArrayType();
+ return (Boolean)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,7 +1,6 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mapping.Column;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
public class ColumnStub extends SelectableStub {
public static final String CL = "org.hibernate.mapping.Column"; //$NON-NLS-1$
@@ -10,66 +9,60 @@
public static final int DEFAULT_PRECISION = 19;
public static final int DEFAULT_SCALE = 2;
- protected Column column;
-
protected ColumnStub(Object column) {
- super(column);
- if (column == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.column = (Column)column;
+ super(column, CL);
}
public static ColumnStub newInstance() {
- return new ColumnStub(new Column());
+ return new ColumnStub(HObject.newInstance(CL));
}
public static ColumnStub newInstance(String columnName) {
- return new ColumnStub(new Column(columnName));
+ return new ColumnStub(HObject.newInstance(CL, columnName));
}
public String getSqlType() {
- return column.getSqlType();
+ return (String)invoke(mn());
}
public void setSqlType(String sqlType) {
- column.setSqlType(sqlType);
+ invoke(mn(), sqlType);
}
public String getSqlType(DialectStub dialect, MappingStub mapping) {
- return column.getSqlType(dialect.dialect, mapping.mapping);
+ return (String)invoke(mn(), dialect, mapping);
}
public ValueStub getValue() {
- return ValueStubFactory.createValueStub(column.getValue());
+ return ValueStubFactory.createValueStub(invoke(mn()));
}
public String getName() {
- return column.getName();
+ return (String)invoke(mn());
}
public boolean isNullable() {
- return column.isNullable();
+ return (Boolean)invoke(mn());
}
public boolean isUnique() {
- return column.isUnique();
+ return (Boolean)invoke(mn());
}
public Integer getSqlTypeCode() {
- return column.getSqlTypeCode();
+ return (Integer)invoke(mn());
}
public int getLength() {
- return column.getLength();
+ return (Integer)invoke(mn());
}
public int getPrecision() {
- return column.getPrecision();
+ return (Integer)invoke(mn());
}
public int getScale() {
- return column.getScale();
+ return (Integer)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,38 +3,28 @@
import java.util.ArrayList;
import java.util.Iterator;
-import org.hibernate.mapping.Component;
-import org.hibernate.mapping.Property;
-import org.hibernate.mediator.Messages;
-
public class ComponentStub extends SimpleValueStub {
public static final String CL = "org.hibernate.mapping.Component";
//$NON-NLS-1$
- protected Component component;
-
protected ComponentStub(Object component) {
- super(component);
- if (component == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.component = (Component)component;
+ super(component, CL);
}
public String getComponentClassName() {
- return component.getComponentClassName();
+ return (String)invoke(mn());
}
public PersistentClassStub getOwner() {
- return PersistentClassStubFactory.createPersistentClassStub(component.getOwner());
+ return PersistentClassStubFactory.createPersistentClassStub(invoke(mn()));
}
public String getParentProperty() {
- return component.getParentProperty();
+ return (String)invoke(mn());
}
@SuppressWarnings("unchecked")
public Iterator<PropertyStub> getPropertyIterator() {
- Iterator<Property> it =
(Iterator<Property>)component.getPropertyIterator();
+ Iterator it = (Iterator)invoke(mn());
ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -46,6 +36,6 @@
}
public boolean isEmbedded() {
- return component.isEmbedded();
+ return (Boolean)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -11,14 +11,10 @@
import java.util.Properties;
import org.eclipse.osgi.util.NLS;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.mapping.PersistentClass;
import org.hibernate.mediator.Messages;
import org.hibernate.mediator.FakeDelegatingDriver;
import org.hibernate.mediator.base.HObject;
import org.hibernate.mediator.stubs.util.ReflectHelper;
-import org.hibernate.tool.hbm2ddl.SchemaExport;
-import org.hibernate.tool.ide.completion.HQLCodeAssist;
import org.w3c.dom.Document;
import org.xml.sax.EntityResolver;
@@ -31,8 +27,12 @@
super(configuration, CL);
}
+ protected ConfigurationStub(Object configuration, String cn) {
+ super(configuration, cn);
+ }
+
public static ConfigurationStub newInstance() {
- return new ConfigurationStub(newInstance(CL));
+ return new ConfigurationStub(HObject.newInstance(CL));
}
public void cleanUp() {
@@ -48,11 +48,11 @@
}
public void buildMappings() {
- invoke("buildMappings"); //$NON-NLS-1$
+ invoke(mn());
}
public SettingsStub buildSettings() {
- Object obj = invoke("buildSettings"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -68,16 +68,15 @@
}
public EntityResolver getEntityResolver() {
- return (EntityResolver)invoke("getEntityResolver"); //$NON-NLS-1$
+ return (EntityResolver)invoke(mn());
}
- public IHQLCodeAssistStub getHQLCodeAssist() {
- // TODO: fix this
- return new IHQLCodeAssistStub(new HQLCodeAssist((Configuration)Obj()));
+ public HQLCodeAssistStub getHQLCodeAssist() {
+ return HQLCodeAssistStub.createHQLCodeAssist(this);
}
public NamingStrategyStub getNamingStrategy() {
- Object obj = invoke("getNamingStrategy"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -90,7 +89,7 @@
@SuppressWarnings("unchecked")
public Iterator<PersistentClassStub> getClassMappings() {
- Iterator<PersistentClass> it =
(Iterator<PersistentClass>)invoke("getClassMappings"); //$NON-NLS-1$
+ Iterator it = (Iterator)invoke(mn());
ArrayList<PersistentClassStub> arr = new ArrayList<PersistentClassStub>();
while (it.hasNext()) {
arr.add(PersistentClassStubFactory.createPersistentClassStub(it.next()));
@@ -99,11 +98,11 @@
}
public PersistentClassStub getClassMapping(String entityName) {
- return
PersistentClassStubFactory.createPersistentClassStub(invoke("getClassMapping",
entityName)); //$NON-NLS-1$
+ return PersistentClassStubFactory.createPersistentClassStub(invoke(mn(), entityName));
}
public MappingsStub createMappings() {
- Object obj = invoke("createMappings"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -111,7 +110,7 @@
}
public MappingStub buildMapping() {
- Object obj = invoke("buildMapping"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -140,8 +139,7 @@
@SuppressWarnings("unchecked")
public Iterator<Throwable> doSchemaExport() {
- // TODO: fix this
- SchemaExport export = new SchemaExport((Configuration)Obj());
+ SchemaExportStub export = SchemaExportStub.createSchemaExport(this);
export.create(false, true);
if (!export.getExceptions().isEmpty()) {
return (Iterator<Throwable>)export.getExceptions().iterator();
@@ -154,11 +152,11 @@
}
public Properties getProperties() {
- return (Properties)invoke("getProperties"); //$NON-NLS-1$
+ return (Properties)invoke(mn());
}
public String getProperty(String propertyName) {
- return (String)invoke("getProperty", propertyName); //$NON-NLS-1$
+ return (String)invoke(mn(), propertyName);
}
/**
@@ -208,39 +206,39 @@
}
public ConfigurationStub setProperties(Properties properties) {
- Object tmp = invoke("setProperties", properties); //$NON-NLS-1$
+ Object tmp = invoke(mn(), properties);
return (tmp == Obj() ? this : new ConfigurationStub(tmp));
}
public void setProperty(String propertyName, String value) {
- invoke("setProperty", propertyName, value); //$NON-NLS-1$
+ invoke(mn(), propertyName, value);
}
public ConfigurationStub configure(Document document) {
- Object tmp = invoke("configure", document); //$NON-NLS-1$
+ Object tmp = invoke(mn(), document);
return (tmp == Obj() ? this : new ConfigurationStub(tmp));
}
public ConfigurationStub configure() {
- Object tmp = invoke("configure"); //$NON-NLS-1$
+ Object tmp = invoke(mn());
return (tmp == Obj() ? this : new ConfigurationStub(tmp));
}
public ConfigurationStub configure(File configFile) {
- Object tmp = invoke("configure", configFile); //$NON-NLS-1$
+ Object tmp = invoke(mn(), configFile);
return (tmp == Obj() ? this : new ConfigurationStub(tmp));
}
public void setEntityResolver(EntityResolver entityResolver) {
- invoke("setEntityResolver", entityResolver); //$NON-NLS-1$
+ invoke(mn(), entityResolver);
}
public void setNamingStrategy(NamingStrategyStub ns) {
- invoke("setNamingStrategy", ns); //$NON-NLS-1$
+ invoke(mn(), ns);
}
public ConfigurationStub addFile(File xmlFile) {
- Object tmp = invoke("addFile", xmlFile); //$NON-NLS-1$
+ Object tmp = invoke(mn(), xmlFile);
return (tmp == Obj() ? this : new ConfigurationStub(tmp));
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,47 +3,40 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Properties;
+import org.hibernate.mediator.base.HObject;
-import org.hibernate.cfg.JDBCMetaDataConfiguration;
-import org.hibernate.mediator.Messages;
-
public class ConfigurationStubJDBCMetaData extends ConfigurationStub {
public static final String CL = "org.hibernate.cfg.JDBCMetaDataConfiguration";
//$NON-NLS-1$
- protected JDBCMetaDataConfiguration jdbcMetaDataConfiguration;
-
- protected ConfigurationStubJDBCMetaData(JDBCMetaDataConfiguration configuration) {
- super(configuration);
- if (configuration == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- jdbcMetaDataConfiguration = configuration;
+ protected ConfigurationStubJDBCMetaData(Object configuration) {
+ super(configuration, CL);
}
public static ConfigurationStubJDBCMetaData newInstance() {
- return new ConfigurationStubJDBCMetaData(new JDBCMetaDataConfiguration());
+ return new ConfigurationStubJDBCMetaData(HObject.newInstance(CL));
}
public ConfigurationStubJDBCMetaData setProperties(Properties properties) {
- JDBCMetaDataConfiguration tmp =
(JDBCMetaDataConfiguration)jdbcMetaDataConfiguration.setProperties(properties);
- return (tmp == jdbcMetaDataConfiguration ? this : new
ConfigurationStubJDBCMetaData(tmp));
+ Object tmp = invoke(mn(), properties);
+ return (tmp == Obj() ? this : new ConfigurationStubJDBCMetaData(tmp));
}
public void setPreferBasicCompositeIds(boolean flag) {
- jdbcMetaDataConfiguration.setPreferBasicCompositeIds(flag);
+ invoke(mn(), flag);
}
public void setReverseEngineeringStrategy(ReverseEngineeringStrategyStub
reverseEngineeringStrategy) {
- jdbcMetaDataConfiguration.setReverseEngineeringStrategy(reverseEngineeringStrategy.reverseEngineeringStrategy);
+ invoke(mn(), reverseEngineeringStrategy);
}
public void readFromJDBC() {
- jdbcMetaDataConfiguration.readFromJDBC();
+ invoke(mn());
}
+ @SuppressWarnings("unchecked")
public ArrayList<TableStub> getTableMappingsArr() {
ArrayList<TableStub> arr = new ArrayList<TableStub>();
- Iterator<?> it = jdbcMetaDataConfiguration.getTableMappings();
+ Iterator it = (Iterator)invoke(mn());
while (it.hasNext() ) {
Object obj = it.next();
if (obj != null) {
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,21 +1,15 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.connection.ConnectionProvider;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class ConnectionProviderStub {
+public class ConnectionProviderStub extends HObject {
public static final String CL = "org.hibernate.connection.ConnectionProvider";
//$NON-NLS-1$
- protected ConnectionProvider connectionProvider;
-
protected ConnectionProviderStub(Object connectionProvider) {
- if (connectionProvider == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.connectionProvider = (ConnectionProvider)connectionProvider;
+ super(connectionProvider, CL);
}
public void close() {
- connectionProvider.close();
+ invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -6,35 +6,27 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import org.hibernate.mediator.base.HObject;
-import org.hibernate.cfg.reveng.DefaultDatabaseCollector;
-import org.hibernate.mapping.Table;
-import org.hibernate.mediator.Messages;
-
-public class DefaultDatabaseCollectorStub {
+public class DefaultDatabaseCollectorStub extends HObject {
public static final String CL =
"org.hibernate.cfg.reveng.DefaultDatabaseCollector"; //$NON-NLS-1$
- protected DefaultDatabaseCollector defaultDatabaseCollector;
-
protected DefaultDatabaseCollectorStub(Object defaultDatabaseCollector) {
- if (defaultDatabaseCollector == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.defaultDatabaseCollector = (DefaultDatabaseCollector)defaultDatabaseCollector;
+ super(defaultDatabaseCollector, CL);
}
public static DefaultDatabaseCollectorStub newInstance() {
- return new DefaultDatabaseCollectorStub(new DefaultDatabaseCollector());
+ return new DefaultDatabaseCollectorStub(HObject.newInstance(CL));
}
@SuppressWarnings("unchecked")
public Iterator<Entry<String, List<TableStub>>> getQualifierEntries()
{
- Iterator<Map.Entry<String, List<Table>>> it =
defaultDatabaseCollector.getQualifierEntries();
+ Iterator<Map.Entry<String, List>> it = (Iterator<Map.Entry<String,
List>>)invoke(mn());
HashMap<String, List<TableStub>> map = new HashMap<String,
List<TableStub>>();
while (it.hasNext()) {
- Map.Entry<String, List<Table>> entry = it.next();
+ Map.Entry<String, List> entry = it.next();
ArrayList<TableStub> arr = new ArrayList<TableStub>();
- Iterator<Table> itValue = (Iterator<Table>)entry.getValue().iterator();
+ Iterator itValue = (Iterator)entry.getValue().iterator();
while (itValue.hasNext()) {
Object obj = itValue.next();
if (obj != null) {
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,22 +1,15 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
public class DefaultReverseEngineeringStrategyStub extends ReverseEngineeringStrategyStub
{
public static final String CL =
"org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy"; //$NON-NLS-1$
- protected DefaultReverseEngineeringStrategy defaultReverseEngineeringStrategy;
-
protected DefaultReverseEngineeringStrategyStub(Object
defaultReverseEngineeringStrategy) {
- super(defaultReverseEngineeringStrategy);
- if (defaultReverseEngineeringStrategy == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.defaultReverseEngineeringStrategy =
(DefaultReverseEngineeringStrategy)defaultReverseEngineeringStrategy;
+ super(defaultReverseEngineeringStrategy, CL);
}
public static DefaultReverseEngineeringStrategyStub newInstance() {
- return new DefaultReverseEngineeringStrategyStub(new
DefaultReverseEngineeringStrategy());
+ return new DefaultReverseEngineeringStrategyStub(HObject.newInstance(CL));
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,19 +1,10 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mapping.DependantValue;
-import org.hibernate.mediator.Messages;
-
public class DependantValueStub extends SimpleValueStub {
public static final String CL = "org.hibernate.mapping.DependantValue";
//$NON-NLS-1$
- protected DependantValue dependantValue;
-
protected DependantValueStub(Object dependantValue) {
- super(dependantValue);
- if (dependantValue == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.dependantValue = (DependantValue)dependantValue;
+ super(dependantValue, CL);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,31 +3,34 @@
import java.sql.Connection;
import java.util.Properties;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.dialect.resolver.DialectFactory;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class DialectStub {
+public class DialectStub extends HObject {
public static final String CL = "org.hibernate.dialect.Dialect";
//$NON-NLS-1$
- protected Dialect dialect;
-
protected DialectStub(Object dialect) {
- if (dialect == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.dialect = (Dialect)dialect;
+ super(dialect, CL);
}
- public static DialectStub newInstance(final String dialectName) throws
InstantiationException, IllegalAccessException, ClassNotFoundException {
- return new DialectStub(Class.forName(dialectName).newInstance());
+ public static DialectStub newInstance(final String dialectName) {
+ try {
+ return new DialectStub(Class.forName(dialectName).newInstance());
+ } catch (InstantiationException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (ClassNotFoundException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
}
public static DialectStub newInstance(Properties properties, Connection connection) {
- return new DialectStub(DialectFactory.buildDialect(properties, connection));
+ Object dialect =
invokeStaticMethod("org.hibernate.dialect.resolver.DialectFactory",
//$NON-NLS-1$
+ "buildDialect", properties, connection); //$NON-NLS-1$
+ return new DialectStub(dialect);
}
public String toString() {
- return dialect.toString();
+ return Obj().toString();
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,21 +1,15 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.EntityMode;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class EntityModeStub {
+public class EntityModeStub extends HObject {
public static final String CL = "org.hibernate.EntityMode"; //$NON-NLS-1$
- 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);
+ public static final EntityModeStub POJO = new EntityModeStub(readStaticFieldValue(CL,
"POJO")); //$NON-NLS-1$
+ public static final EntityModeStub DOM4J = new EntityModeStub(readStaticFieldValue(CL,
"DOM4J")); //$NON-NLS-1$
+ public static final EntityModeStub MAP = new EntityModeStub(readStaticFieldValue(CL,
"MAP")); //$NON-NLS-1$
- protected EntityMode entityMode;
-
protected EntityModeStub(Object entityMode) {
- if (entityMode == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.entityMode = (EntityMode)entityMode;
+ super(entityMode, CL);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,26 +1,17 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.type.EntityType;
-
public class EntityTypeStub extends AbstractTypeStub {
public static final String CL = "org.hibernate.type.EntityType";
//$NON-NLS-1$
- protected EntityType entityType;
-
protected EntityTypeStub(Object entityType) {
- super(entityType);
- if (entityType == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.entityType = (EntityType)entityType;
+ super(entityType, CL);
}
public String getAssociatedEntityName() {
- return entityType.getAssociatedEntityName();
+ return (String)invoke(mn());
}
public boolean isOneToOne() {
- return entityType.isOneToOne();
+ return (Boolean)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,24 +1,14 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.type.EnumType;
+import org.hibernate.mediator.base.HObject;
-public class EnumTypeStub {
+public class EnumTypeStub extends HObject {
public static final String CL = "org.hibernate.type.EnumType"; //$NON-NLS-1$
- public static final String ENUM = EnumType.ENUM;
- public static final String TYPE = EnumType.TYPE;
+ public static final String ENUM = (String)readStaticFieldValue(CL, "ENUM");
//$NON-NLS-1$
+ public static final String TYPE = (String)readStaticFieldValue(CL, "TYPE");
//$NON-NLS-1$
- protected EnumType enumType;
-
protected EnumTypeStub(Object enumType) {
- if (enumType == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.enumType = (EnumType)enumType;
+ super(enumType, CL);
}
-
- public static String getClassName() {
- return EnumType.class.getName();
- }
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -6,28 +6,29 @@
import java.util.Arrays;
import java.util.List;
-import org.hibernate.cfg.Environment;
+import org.hibernate.mediator.base.HObject;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
public class EnvironmentStub {
public static final String CL = "org.hibernate.cfg.Environment";
//$NON-NLS-1$
- 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;
- public static final String HBM2DDL_AUTO = Environment.HBM2DDL_AUTO;
- public static final String DATASOURCE = Environment.DATASOURCE;
+ public static final String DIALECT = (String)HObject.readStaticFieldValue(CL,
"DIALECT"); //$NON-NLS-1$
+ public static final String DEFAULT_CATALOG = (String)HObject.readStaticFieldValue(CL,
"DEFAULT_CATALOG"); //$NON-NLS-1$
+ public static final String DEFAULT_SCHEMA = (String)HObject.readStaticFieldValue(CL,
"DEFAULT_SCHEMA"); //$NON-NLS-1$
+ public static final String DRIVER = (String)HObject.readStaticFieldValue(CL,
"DRIVER"); //$NON-NLS-1$
+ public static final String PASS = (String)HObject.readStaticFieldValue(CL,
"PASS"); //$NON-NLS-1$
+ public static final String SESSION_FACTORY_NAME =
(String)HObject.readStaticFieldValue(CL, "SESSION_FACTORY_NAME"); //$NON-NLS-1$
+ public static final String URL = (String)HObject.readStaticFieldValue(CL,
"URL"); //$NON-NLS-1$
+ public static final String USER = (String)HObject.readStaticFieldValue(CL,
"USER"); //$NON-NLS-1$
+ public static final String HBM2DDL_AUTO = (String)HObject.readStaticFieldValue(CL,
"HBM2DDL_AUTO"); //$NON-NLS-1$
+ public static final String DATASOURCE = (String)HObject.readStaticFieldValue(CL,
"DATASOURCE"); //$NON-NLS-1$
@SuppressWarnings("unchecked")
public static String[] extractHibernateProperties() {
try {
// TODO: extract property names from the Environment class in the users hibernate
// configuration.
- Class cl = Environment.class;
+ Class cl = ReflectHelper.classForName(CL);
List<String> names = new ArrayList<String>();
Field[] fields = cl.getFields();
for (int i = 0; i < fields.length; i++) {
@@ -42,6 +43,9 @@
String[] propertyNames = (String[]) names.toArray(new String[names.size()]);
Arrays.sort(propertyNames);
return propertyNames;
+ } catch (ClassNotFoundException e) {
+ // ignore
+ return new String[0];
} catch (IllegalAccessException iae) {
// ignore
return new String[0];
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,45 +3,41 @@
import java.io.File;
import java.util.Properties;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.mediator.Messages;
-import org.hibernate.tool.hbm2x.ArtifactCollector;
-import org.hibernate.tool.hbm2x.Exporter;
+import org.hibernate.mediator.base.HObject;
-public class ExporterStub {
+public class ExporterStub extends HObject {
public static final String CL = "org.hibernate.tool.hbm2x.Exporter";
//$NON-NLS-1$
- protected Exporter exporter;
-
protected ExporterStub(Object exporter) {
- if (exporter == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.exporter = (Exporter)exporter;
+ super(exporter, CL);
}
+ protected ExporterStub(Object exporter, String cn) {
+ super(exporter, cn);
+ }
+
public void start() {
- exporter.start();
+ invoke(mn());
}
public void setConfiguration(ConfigurationStub configuration) {
- exporter.setConfiguration((Configuration)configuration.Obj());
+ invoke(mn(), configuration);
}
public void setProperties(Properties props) {
- exporter.setProperties(props);
+ invoke(mn(), props);
}
public void setArtifactCollector(ArtifactCollectorStub collector) {
- exporter.setArtifactCollector((ArtifactCollector)collector.Obj());
+ invoke(mn(), collector);
}
public void setOutputDirectory(File file) {
- exporter.setOutputDirectory(file);
+ invoke(mn(), file);
}
public void setTemplatePath(String[] array) {
- exporter.setTemplatePath(array);
+ invoke(mn(), array);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FetchModeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,6 +1,5 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.FetchMode;
import org.hibernate.mediator.base.HObject;
public class FetchModeStub extends HObject {
@@ -10,7 +9,7 @@
super(fetchMode, CL);
}
- public static final FetchModeStub DEFAULT = new FetchModeStub(FetchMode.DEFAULT);
- public static final FetchModeStub SELECT = new FetchModeStub(FetchMode.SELECT);
- public static final FetchModeStub JOIN = new FetchModeStub(FetchMode.JOIN);
+ public static final FetchModeStub DEFAULT = new FetchModeStub(readStaticFieldValue(CL,
"DEFAULT")); //$NON-NLS-1$
+ public static final FetchModeStub SELECT = new FetchModeStub(readStaticFieldValue(CL,
"SELECT")); //$NON-NLS-1$
+ public static final FetchModeStub JOIN = new FetchModeStub(readStaticFieldValue(CL,
"JOIN")); //$NON-NLS-1$
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -4,28 +4,21 @@
import java.util.Iterator;
import java.util.List;
-import org.hibernate.mapping.Column;
-import org.hibernate.mapping.ForeignKey;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class ForeignKeyStub {
+public class ForeignKeyStub extends HObject {
public static final String CL = "org.hibernate.mapping.ForeignKey";
//$NON-NLS-1$
- protected ForeignKey foreignKey;
-
protected ForeignKeyStub(Object foreignKey) {
- if (foreignKey == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.foreignKey = (ForeignKey)foreignKey;
+ super(foreignKey, CL);
}
public boolean containsColumn(ColumnStub column) {
- return foreignKey.containsColumn(column.column);
+ return (Boolean)invoke(mn(), column);
}
public TableStub getReferencedTable() {
- Object obj = foreignKey.getReferencedTable();
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -34,7 +27,7 @@
@SuppressWarnings("unchecked")
public Iterator<ColumnStub> columnIterator() {
- Iterator<Column> it = (Iterator<Column>)foreignKey.getColumnIterator();
+ Iterator it = (Iterator)invoke(mn());
ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -47,8 +40,9 @@
@SuppressWarnings("unchecked")
public List<ColumnStub> getReferencedColumns() {
- Iterator<Column> it = foreignKey.getReferencedColumns().iterator();
+ List list = (List)invoke(mn());
ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
+ Iterator it = list.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj != null) {
@@ -59,7 +53,7 @@
}
public boolean isReferenceToPrimaryKey() {
- return foreignKey.isReferenceToPrimaryKey();
+ return (Boolean)invoke(mn());
}
}
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FormulaStub.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FormulaStub.java 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FormulaStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,18 +1,9 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mapping.Formula;
-import org.hibernate.mediator.Messages;
-
public class FormulaStub extends SelectableStub {
public static final String CL = "org.hibernate.mapping.Formula";
//$NON-NLS-1$
- protected Formula formula;
-
protected FormulaStub(Object formula) {
- super(formula);
- if (formula == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.formula = (Formula)formula;
+ super(formula, CL);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,31 +1,22 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.tool.hbm2x.GenericExporter;
-
public class GenericExporterStub extends ExporterStub {
public static final String CL = "org.hibernate.tool.hbm2x.GenericExporter";
//$NON-NLS-1$
- protected GenericExporter genericExporter;
-
protected GenericExporterStub(Object genericExporter) {
- super(genericExporter);
- if (genericExporter == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.genericExporter = (GenericExporter)genericExporter;
+ super(genericExporter, CL);
}
public void setFilePattern(String property) {
- genericExporter.setFilePattern(property);
+ invoke(mn(), property);
}
public void setTemplateName(String property) {
- genericExporter.setTemplateName(property);
+ invoke(mn(), property);
}
public void setForEach(String property) {
- genericExporter.setForEach(property);
+ invoke(mn(), property);
}
}
Copied:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCodeAssistStub.java
(from rev 21237,
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/HQLCodeAssistStub.java
(rev 0)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCodeAssistStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -0,0 +1,23 @@
+package org.hibernate.mediator.stubs;
+
+import org.hibernate.mediator.base.HObject;
+
+public class HQLCodeAssistStub extends HObject {
+ public static final String CL =
"org.hibernate.tool.ide.completion.HQLCodeAssist"; //$NON-NLS-1$
+
+ protected HQLCodeAssistStub(Object hqlCodeAssist) {
+ super(hqlCodeAssist, CL);
+ }
+
+ public static HQLCodeAssistStub createHQLCodeAssist(Object configuration) {
+ return new HQLCodeAssistStub(HObject.newInstance(CL, configuration));
+ }
+
+ public static HQLCodeAssistStub createHQLCodeAssist() {
+ return new HQLCodeAssistStub(HObject.newInstance(CL, null));
+ }
+
+ public void codeComplete(String query, int position, IHQLCompletionRequestorStub
requestor) {
+ invoke(mn(), query, position, requestor);
+ }
+}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,56 +1,50 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.tool.ide.completion.HQLCompletionProposal;
+import org.hibernate.mediator.base.HObject;
-public class HQLCompletionProposalStub {
+public class HQLCompletionProposalStub extends HObject {
public static final String CL =
"org.hibernate.tool.ide.completion.HQLCompletionProposal"; //$NON-NLS-1$
- 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;
+ public static final int ENTITY_NAME = (Integer)readStaticFieldValue(CL,
"ENTITY_NAME"); //$NON-NLS-1$
+ public static final int PROPERTY = (Integer)readStaticFieldValue(CL,
"PROPERTY"); //$NON-NLS-1$
+ public static final int KEYWORD = (Integer)readStaticFieldValue(CL,
"KEYWORD"); //$NON-NLS-1$
+ public static final int FUNCTION = (Integer)readStaticFieldValue(CL,
"FUNCTION"); //$NON-NLS-1$
+ public static final int ALIAS_REF = (Integer)readStaticFieldValue(CL,
"ALIAS_REF"); //$NON-NLS-1$
- protected HQLCompletionProposal hqlCompletionProposal;
-
protected HQLCompletionProposalStub(Object hqlCompletionProposal) {
- if (hqlCompletionProposal == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.hqlCompletionProposal = (HQLCompletionProposal)hqlCompletionProposal;
+ super(hqlCompletionProposal, CL);
}
public String getCompletion() {
- return hqlCompletionProposal.getCompletion();
+ return (String)invoke(mn());
}
public int getReplaceStart() {
- return hqlCompletionProposal.getReplaceStart();
+ return (Integer)invoke(mn());
}
public int getReplaceEnd() {
- return hqlCompletionProposal.getReplaceEnd();
+ return (Integer)invoke(mn());
}
public int getCompletionKind() {
- return hqlCompletionProposal.getCompletionKind();
+ return (Integer)invoke(mn());
}
public String getEntityName() {
- return hqlCompletionProposal.getEntityName();
+ return (String)invoke(mn());
}
public String getSimpleName() {
- return hqlCompletionProposal.getSimpleName();
+ return (String)invoke(mn());
}
public String getShortEntityName() {
- return hqlCompletionProposal.getShortEntityName();
+ return (String)invoke(mn());
}
public PropertyStub getProperty() {
- Object obj = hqlCompletionProposal.getProperty();
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,31 +3,24 @@
import java.io.StringWriter;
import java.util.Properties;
-import org.hibernate.mediator.Messages;
-import org.hibernate.tool.hbm2x.HibernateConfigurationExporter;
+import org.hibernate.mediator.base.HObject;
public class HibernateConfigurationExporterStub extends ExporterStub {
public static final String CL =
"org.hibernate.tool.hbm2x.HibernateConfigurationExporter"; //$NON-NLS-1$
- protected HibernateConfigurationExporter hibernateConfigurationExporter;
-
protected HibernateConfigurationExporterStub(Object hibernateConfigurationExporter) {
- super(hibernateConfigurationExporter);
- if (hibernateConfigurationExporter == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.hibernateConfigurationExporter =
(HibernateConfigurationExporter)hibernateConfigurationExporter;
+ super(hibernateConfigurationExporter, CL);
}
public static HibernateConfigurationExporterStub newInstance() {
- return new HibernateConfigurationExporterStub(new HibernateConfigurationExporter());
+ return new HibernateConfigurationExporterStub(HObject.newInstance(CL));
}
public void setCustomProperties(Properties props) {
- hibernateConfigurationExporter.setCustomProperties(props);
+ invoke(mn(), props);
}
public void setOutput(StringWriter stringWriter) {
- hibernateConfigurationExporter.setOutput(stringWriter);
+ invoke(mn(), stringWriter);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -4,64 +4,56 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
+import org.hibernate.mediator.base.HObject;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.mediator.Messages;
-import org.hibernate.tool.hbm2x.HibernateMappingExporter;
-
-public class HibernateMappingExporterStub {
+public class HibernateMappingExporterStub extends HObject {
public static final String CL =
"org.hibernate.tool.hbm2x.HibernateMappingExporter"; //$NON-NLS-1$
- protected HibernateMappingExporter hibernateMappingExporter;
-
protected HibernateMappingExporterStub(ConfigurationStub cfg, File outputdir) {
- if (cfg.Obj() == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- hibernateMappingExporter = new HibernateMappingExporter((Configuration)cfg.Obj(),
outputdir);
+ super(HObject.newInstance(CL, cfg, outputdir), CL);
}
public void setGlobalSettings(HibernateMappingGlobalSettingsStub hmgs) {
- hibernateMappingExporter.setGlobalSettings(hmgs.hibernateMappingGlobalSettings);
+ invoke(mn(), hmgs);
}
public void start() {
- hibernateMappingExporter.start();
+ invoke(mn());
}
protected File getOutputDirectory() {
- return hibernateMappingExporter.getOutputDirectory();
+ return (File)invoke(mn());
}
protected void setOutputDirectory(File outputdir) {
- hibernateMappingExporter.setOutputDirectory(outputdir);
+ invoke(mn(), outputdir);
}
@SuppressWarnings("unchecked")
protected void exportPOJO(Map additionalContext, POJOClassStub element) {
- // TODO: protected - call via reflection
+ // protected -> call via reflection
Method m = null;
try {
- m =
hibernateMappingExporter.getClass().getDeclaredMethod("exportPOJO");//$NON-NLS-1$
+ m = Cl().getDeclaredMethod("exportPOJO");//$NON-NLS-1$
} catch (SecurityException e) {
- //TODO:
+ throw new HibernateConsoleRuntimeException(e);
} catch (NoSuchMethodException e) {
- //TODO:
+ throw new HibernateConsoleRuntimeException(e);
}
m.setAccessible(true);
try {
- m.invoke(hibernateMappingExporter, additionalContext, element.pojoClass);
+ m.invoke(Obj(), additionalContext, element.Obj());
} catch (IllegalArgumentException e) {
- //TODO:
+ throw new HibernateConsoleRuntimeException(e);
} catch (IllegalAccessException e) {
- //TODO:
+ throw new HibernateConsoleRuntimeException(e);
} catch (InvocationTargetException e) {
- //TODO:
+ throw new HibernateConsoleRuntimeException(e);
}
}
public ArtifactCollectorStub getArtifactCollector() {
- return new ArtifactCollectorStub(hibernateMappingExporter.getArtifactCollector());
+ return new ArtifactCollectorStub(invoke(mn()));
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,25 +1,19 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings;
+import org.hibernate.mediator.base.HObject;
-public class HibernateMappingGlobalSettingsStub {
+public class HibernateMappingGlobalSettingsStub extends HObject {
public static final String CL =
"org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings"; //$NON-NLS-1$
- protected HibernateMappingGlobalSettings hibernateMappingGlobalSettings;
-
protected HibernateMappingGlobalSettingsStub(Object hibernateMappingGlobalSettings) {
- if (hibernateMappingGlobalSettings == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.hibernateMappingGlobalSettings =
(HibernateMappingGlobalSettings)hibernateMappingGlobalSettings;
+ super(hibernateMappingGlobalSettings, CL);
}
public static HibernateMappingGlobalSettingsStub newInstance() {
- return new HibernateMappingGlobalSettingsStub(new HibernateMappingGlobalSettings());
+ return new HibernateMappingGlobalSettingsStub(HObject.newInstance(CL));
}
public void setDefaultAccess(String string) {
- hibernateMappingGlobalSettings.setDefaultAccess(string);
+ invoke(mn(), string);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,45 +1,40 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.Hibernate;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class HibernateStub {
+public class HibernateStub extends HObject {
public static final String CL = "org.hibernate.Hibernate"; //$NON-NLS-1$
- 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);
+ public static final NullableTypeStub BOOLEAN = new
NullableTypeStub(readStaticFieldValue(CL, "BOOLEAN")); //$NON-NLS-1$
+ public static final NullableTypeStub BYTE = new
NullableTypeStub(readStaticFieldValue(CL, "BYTE")); //$NON-NLS-1$
+ public static final NullableTypeStub BIG_INTEGER = new
NullableTypeStub(readStaticFieldValue(CL, "BIG_INTEGER")); //$NON-NLS-1$
+ public static final NullableTypeStub SHORT = new
NullableTypeStub(readStaticFieldValue(CL, "SHORT")); //$NON-NLS-1$
+ public static final NullableTypeStub CALENDAR = new
NullableTypeStub(readStaticFieldValue(CL, "CALENDAR")); //$NON-NLS-1$
+ public static final NullableTypeStub CALENDAR_DATE = new
NullableTypeStub(readStaticFieldValue(CL, "CALENDAR_DATE")); //$NON-NLS-1$
+ public static final NullableTypeStub INTEGER = new
NullableTypeStub(readStaticFieldValue(CL, "INTEGER")); //$NON-NLS-1$
+ public static final NullableTypeStub BIG_DECIMAL = new
NullableTypeStub(readStaticFieldValue(CL, "BIG_DECIMAL")); //$NON-NLS-1$
+ public static final NullableTypeStub CHARACTER = new
NullableTypeStub(readStaticFieldValue(CL, "CHARACTER")); //$NON-NLS-1$
+ public static final NullableTypeStub CLASS = new
NullableTypeStub(readStaticFieldValue(CL, "CLASS")); //$NON-NLS-1$
+ public static final NullableTypeStub CURRENCY = new
NullableTypeStub(readStaticFieldValue(CL, "CURRENCY")); //$NON-NLS-1$
+ public static final NullableTypeStub DATE = new
NullableTypeStub(readStaticFieldValue(CL, "DATE")); //$NON-NLS-1$
+ public static final NullableTypeStub DOUBLE = new
NullableTypeStub(readStaticFieldValue(CL, "DOUBLE")); //$NON-NLS-1$
+ public static final NullableTypeStub FLOAT = new
NullableTypeStub(readStaticFieldValue(CL, "FLOAT")); //$NON-NLS-1$
+ public static final NullableTypeStub LOCALE = new
NullableTypeStub(readStaticFieldValue(CL, "LOCALE")); //$NON-NLS-1$
+ public static final NullableTypeStub LONG = new
NullableTypeStub(readStaticFieldValue(CL, "LONG")); //$NON-NLS-1$
+ public static final NullableTypeStub STRING = new
NullableTypeStub(readStaticFieldValue(CL, "STRING")); //$NON-NLS-1$
+ public static final NullableTypeStub TEXT = new
NullableTypeStub(readStaticFieldValue(CL, "TEXT")); //$NON-NLS-1$
+ public static final NullableTypeStub TIME = new
NullableTypeStub(readStaticFieldValue(CL, "TIME")); //$NON-NLS-1$
+ public static final NullableTypeStub TIMESTAMP = new
NullableTypeStub(readStaticFieldValue(CL, "TIMESTAMP")); //$NON-NLS-1$
+ public static final NullableTypeStub TIMEZONE = new
NullableTypeStub(readStaticFieldValue(CL, "TIMEZONE")); //$NON-NLS-1$
+ public static final NullableTypeStub TRUE_FALSE = new
NullableTypeStub(readStaticFieldValue(CL, "TRUE_FALSE")); //$NON-NLS-1$
+ public static final NullableTypeStub YES_NO = new
NullableTypeStub(readStaticFieldValue(CL, "YES_NO")); //$NON-NLS-1$
- protected Hibernate hibernate;
-
protected HibernateStub(Object hibernate) {
- if (hibernate == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.hibernate = (Hibernate)hibernate;
+ super(hibernate, CL);
}
public static boolean isInitialized(Object proxy) {
- return Hibernate.isInitialized(proxy);
+ Boolean isInitialized = (Boolean)invokeStaticMethod(CL, "isInitialized",
proxy); //$NON-NLS-1$
+ return isInitialized;
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,9 +1,14 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.hql.antlr.HqlSqlTokenTypes;
+import org.hibernate.mediator.base.HObject;
-public class HqlSqlTokenTypesStub {
+public class HqlSqlTokenTypesStub extends HObject {
+
public static final String CL = "org.hibernate.hql.antlr.HqlSqlTokenTypes";
//$NON-NLS-1$
- public static final int IDENT = HqlSqlTokenTypes.IDENT;
+ public static final int IDENT = (Integer)HObject.readStaticFieldValue(CL,
"IDENT"); //$NON-NLS-1$
+
+ public HqlSqlTokenTypesStub(Object hqlSqlTokenTypes) {
+ super(hqlSqlTokenTypes, CL);
+ }
}
Deleted:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,25 +0,0 @@
-package org.hibernate.mediator.stubs;
-
-import org.hibernate.mediator.Messages;
-import org.hibernate.tool.ide.completion.HQLCodeAssist;
-
-public class IHQLCodeAssistStub {
- public static final String CL =
"org.hibernate.tool.ide.completion.HQLCodeAssist"; //$NON-NLS-1$
-
- protected HQLCodeAssist hqlCodeAssist;
-
- protected IHQLCodeAssistStub(Object hqlCodeAssist) {
- if (hqlCodeAssist == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- 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);
- }
-}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,6 +1,5 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.tool.ide.completion.HQLCompletionProposal;
import org.hibernate.tool.ide.completion.IHQLCompletionRequestor;
public abstract class IHQLCompletionRequestorStub {
@@ -8,6 +7,9 @@
protected IHQLCompletionRequestor hqlCompletionRequestor;
+ public IHQLCompletionRequestorStub() {
+ }
+ /** /
protected IHQLCompletionRequestorStub() {
hqlCompletionRequestor = new IHQLCompletionRequestor() {
@@ -21,6 +23,7 @@
};
}
+ /**/
public abstract boolean accept(HQLCompletionProposalStub proposal);
public abstract void completionFailure(String errorMessage);
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,19 +1,10 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mapping.IdentifierBag;
-import org.hibernate.mediator.Messages;
-
public class IdentifierBagStub extends IdentifierCollectionStub {
public static final String CL = "org.hibernate.mapping.IdentifierBag";
//$NON-NLS-1$
- protected IdentifierBag identifierBag;
-
protected IdentifierBagStub(Object identifierBag) {
- super(identifierBag);
- if (identifierBag == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.identifierBag = (IdentifierBag)identifierBag;
+ super(identifierBag, CL);
}
@Override
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,19 +1,14 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mapping.IdentifierCollection;
-import org.hibernate.mediator.Messages;
-
public abstract class IdentifierCollectionStub extends CollectionStub {
public static final String CL = "org.hibernate.mapping.IdentifierCollection";
//$NON-NLS-1$
- protected IdentifierCollection identifierCollection;
-
protected IdentifierCollectionStub(Object identifierCollection) {
- super(identifierCollection);
- if (identifierCollection == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.identifierCollection = (IdentifierCollection)identifierCollection;
+ super(identifierCollection, CL);
}
+ protected IdentifierCollectionStub(Object identifierCollection, String cn) {
+ super(identifierCollection, cn);
+ }
+
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,18 +1,13 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.type.ImmutableType;
-
public class ImmutableTypeStub extends NullableTypeStub {
public static final String CL = "org.hibernate.type.ImmutableType";
//$NON-NLS-1$
- protected ImmutableType immutableType;
-
protected ImmutableTypeStub(Object immutableType) {
- super(immutableType);
- if (immutableType == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.immutableType = (ImmutableType)immutableType;
+ super(immutableType, CL);
}
+
+ protected ImmutableTypeStub(Object immutableType, String cn) {
+ super(immutableType, cn);
+ }
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,7 +12,7 @@
}
public void setIndex(ValueStub index) {
- invoke("setIndex", index); //$NON-NLS-1$
+ invoke(mn(), index);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,18 +1,9 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.type.IntegerType;
-
public class IntegerTypeStub extends PrimitiveTypeStub {
public static final String CL = "org.hibernate.type.IntegerType";
//$NON-NLS-1$
- protected IntegerType integerType;
-
protected IntegerTypeStub(Object integerType) {
- super(integerType);
- if (integerType == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.integerType = (IntegerType)integerType;
+ super(integerType, CL);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,24 +3,27 @@
import java.util.List;
import java.util.Properties;
-import org.hibernate.cfg.JDBCReaderFactory;
-import org.hibernate.cfg.reveng.JDBCReader;
+import org.hibernate.mediator.base.HObject;
-public class JDBCReaderStub {
+public class JDBCReaderStub extends HObject {
public static final String CL = "org.hibernate.cfg.reveng.JDBCReader";
//$NON-NLS-1$
-
- protected JDBCReader jdbcReader;
protected JDBCReaderStub(Properties cfg, SettingsStub settings,
ReverseEngineeringStrategyStub revengStrategy) {
- jdbcReader = JDBCReaderFactory.newJDBCReader(cfg, settings.settings,
revengStrategy.reverseEngineeringStrategy);
+ super(create(cfg, settings, revengStrategy), CL);
}
+ private static Object create(Properties cfg, SettingsStub settings,
ReverseEngineeringStrategyStub revengStrategy) {
+ Object jdbcReader = invokeStaticMethod("org.hibernate.cfg.JDBCReaderFactory",
//$NON-NLS-1$
+ "newJDBCReader", cfg, settings, revengStrategy); //$NON-NLS-1$
+ return jdbcReader;
+ }
+
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);
+ return (List)invoke(mn(), dbs, catalog, schema, progress.progressListener);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -2,6 +2,7 @@
import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper;
+// TODO: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
public class JDBCToHibernateTypeHelperStub {
public static final String CL =
"org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper"; //$NON-NLS-1$
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,25 +3,18 @@
import java.util.ArrayList;
import java.util.Iterator;
-import org.hibernate.mapping.Join;
-import org.hibernate.mapping.Property;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class JoinStub {
+public class JoinStub extends HObject {
public static final String CL = "org.hibernate.mapping.Join"; //$NON-NLS-1$
- protected Join join;
-
protected JoinStub(Object join) {
- if (join == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.join = (Join)join;
+ super(join, CL);
}
@SuppressWarnings("unchecked")
public Iterator<PropertyStub> getPropertyIterator() {
- Iterator<Property> it = (Iterator<Property>)join.getPropertyIterator();
+ Iterator it = (Iterator)invoke(mn());
ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
while (it.hasNext()) {
Object obj = it.next();
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,11 +12,11 @@
}
public void setTable(TableStub table) {
- invoke("setTable", table); //$NON-NLS-1$
+ invoke(mn(), table);
}
public void setKey(KeyValueStub key) {
- invoke("ssetKey", key); //$NON-NLS-1$
+ invoke(mn(), key);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -21,7 +21,7 @@
}
public ValueStub getIndex() {
- return ValueStubFactory.createValueStub(invoke("getIndex")); //$NON-NLS-1$
+ return ValueStubFactory.createValueStub(invoke(mn()));
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,7 +12,7 @@
}
public String getReferencedEntityName() {
- return (String)invoke("getReferencedEntityName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,17 +1,11 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.engine.Mapping;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class MappingStub {
+public class MappingStub extends HObject {
public static final String CL = "org.hibernate.engine.Mapping"; //$NON-NLS-1$
- protected Mapping mapping;
-
protected MappingStub(Object mapping) {
- if (mapping == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.mapping = (Mapping)mapping;
+ super(mapping, CL);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -10,6 +10,6 @@
}
public void addClass(PersistentClassStub persistentClass) {
- invoke("addClass", persistentClass); //$NON-NLS-1$
+ invoke(mn(), persistentClass);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -6,43 +6,43 @@
public static final String CL = "org.hibernate.cfg.NamingStrategy";
//$NON-NLS-1$
protected NamingStrategyStub(Object namingStrategy) {
- super(namingStrategy, CL);;
+ super(namingStrategy, CL);
}
public String classToTableName(String className) {
- return (String)invoke("classToTableName", className); //$NON-NLS-1$
+ return (String)invoke(mn(), className);
}
public String tableName(String tableName) {
- return (String)invoke("tableName", tableName); //$NON-NLS-1$
+ return (String)invoke(mn(), tableName);
}
public String columnName(String columnName) {
- return (String)invoke("columnName", columnName); //$NON-NLS-1$
+ return (String)invoke(mn(), columnName);
}
public String propertyToColumnName(String propertyName) {
- return (String)invoke("propertyToColumnName", propertyName); //$NON-NLS-1$
+ return (String)invoke(mn(), propertyName);
}
public String joinKeyColumnName(String joinedColumn, String joinedTable) {
- return (String)invoke("joinKeyColumnName", joinedColumn, joinedTable);
//$NON-NLS-1$
+ return (String)invoke(mn(), joinedColumn, joinedTable);
}
public String collectionTableName(String ownerEntity, String ownerEntityTable,
String associatedEntity, String associatedEntityTable,
String propertyName) {
- return (String)invoke("collectionTableName", ownerEntity, ownerEntityTable,
//$NON-NLS-1$
+ return (String)invoke(mn(), ownerEntity, ownerEntityTable,
associatedEntity, associatedEntityTable, propertyName);
}
public String logicalColumnName(String columnName, String propertyName) {
- return (String)invoke("logicalColumnName", columnName, propertyName);
//$NON-NLS-1$
+ return (String)invoke(mn(), columnName, propertyName);
}
public String foreignKeyColumnName(String propertyName, String propertyEntityName,
String propertyTableName, String referencedColumnName) {
- return (String)invoke("foreignKeyColumnName", propertyName, //$NON-NLS-1$
+ return (String)invoke(mn(), propertyName,
propertyEntityName, propertyTableName, referencedColumnName);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,26 +1,21 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.type.NullableType;
-
public class NullableTypeStub extends AbstractTypeStub {
public static final String CL = "org.hibernate.type.NullableType";
//$NON-NLS-1$
- protected NullableType nullableType;
-
protected NullableTypeStub(Object nullableType) {
- super(nullableType);
- if (nullableType == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.nullableType = (NullableType)nullableType;
+ super(nullableType, CL);
}
+ protected NullableTypeStub(Object nullableType, String cn) {
+ super(nullableType, cn);
+ }
+
public String toString(Object value) {
- return nullableType.toString(value);
+ return (String)invoke(mn(), value);
}
public Object fromStringValue(String xml) {
- return nullableType.fromStringValue(xml);
+ return invoke(mn(), xml);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,15 +12,15 @@
}
public void setAssociatedClass(PersistentClassStub associatedClass) {
- invoke("setAssociatedClass", associatedClass); //$NON-NLS-1$
+ invoke(mn(), associatedClass);
}
public void setReferencedEntityName(String referencedEntityName) {
- invoke("setReferencedEntityName", referencedEntityName); //$NON-NLS-1$
+ invoke(mn(), referencedEntityName);
}
public PersistentClassStub getAssociatedClass() {
- return
PersistentClassStubFactory.createPersistentClassStub(invoke("getAssociatedClass"));
//$NON-NLS-1$
+ return PersistentClassStubFactory.createPersistentClassStub(invoke(mn()));
}
public Object accept(ValueVisitorStub visitor) {
@@ -28,6 +28,6 @@
}
public String getReferencedEntityName() {
- return (String)invoke("getReferencedEntityName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,7 +12,7 @@
}
public String getEntityName() {
- return (String)invoke("getEntityName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -2,32 +2,26 @@
import java.io.File;
-import org.hibernate.cfg.reveng.OverrideRepository;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class OverrideRepositoryStub {
+public class OverrideRepositoryStub extends HObject {
public static final String CL = "org.hibernate.cfg.reveng.OverrideRepository";
//$NON-NLS-1$
- protected OverrideRepository overrideRepository;
-
protected OverrideRepositoryStub(Object overrideRepository) {
- if (overrideRepository == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.overrideRepository = (OverrideRepository)overrideRepository;
+ super(overrideRepository, CL);
}
public static OverrideRepositoryStub newInstance() {
- return new OverrideRepositoryStub(new OverrideRepository());
+ return new OverrideRepositoryStub(newInstance(CL));
}
public void addFile(File file) {
- overrideRepository.addFile(file);
+ invoke(mn(), file);
}
public ReverseEngineeringStrategyStub getReverseEngineeringStrategy(
ReverseEngineeringStrategyStub res) {
- Object obj =
overrideRepository.getReverseEngineeringStrategy(res.reverseEngineeringStrategy);
+ Object obj = invoke(mn(), res);
if (obj == null) {
return null;
}
@@ -35,7 +29,7 @@
}
public void addTableFilter(TableFilterStub tf) {
- overrideRepository.addTableFilter(tf.tableFilter);
+ invoke(mn(), tf);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,22 +1,16 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.tool.hbm2x.pojo.POJOClass;
+import org.hibernate.mediator.base.HObject;
-public class POJOClassStub {
+public class POJOClassStub extends HObject {
public static final String CL = "org.hibernate.tool.hbm2x.pojo.POJOClass";
//$NON-NLS-1$
- protected POJOClass pojoClass;
-
protected POJOClassStub(Object pojoClass) {
- if (pojoClass == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.pojoClass = (POJOClass)pojoClass;
+ super(pojoClass, CL);
}
public String getQualifiedDeclarationName() {
- return pojoClass.getQualifiedDeclarationName();
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -17,23 +17,23 @@
}
public Boolean isAbstract() {
- return (Boolean)invoke("isAbstract"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public ValueStub getDiscriminator() {
- return ValueStubFactory.createValueStub(invoke("getDiscriminator"));
//$NON-NLS-1$
+ return ValueStubFactory.createValueStub(invoke(mn()));
}
public String getClassName() {
- return (String)invoke("getClassName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getEntityName() {
- return (String)invoke("getEntityName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public PropertyStub getIdentifierProperty() {
- Object obj = invoke("getIdentifierProperty"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -42,7 +42,7 @@
@SuppressWarnings("unchecked")
public Iterator<PropertyStub> getPropertyIterator() {
- Iterator it = (Iterator)invoke("getPropertyIterator"); //$NON-NLS-1$
+ Iterator it = (Iterator)invoke(mn());
ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -54,7 +54,7 @@
}
public RootClassStub getRootClass() {
- Object obj = invoke("getRootClass"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -62,7 +62,7 @@
}
public PropertyStub getVersion() {
- Object obj = invoke("getVersion"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -70,7 +70,7 @@
}
public TableStub getTable() {
- Object obj = invoke("getTable"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -79,7 +79,7 @@
@SuppressWarnings("unchecked")
public Iterator<JoinStub> getJoinIterator() {
- Iterator it = (Iterator)invoke("getJoinIterator"); //$NON-NLS-1$
+ Iterator it = (Iterator)invoke(mn());
ArrayList<JoinStub> al = new ArrayList<JoinStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -91,15 +91,15 @@
}
public KeyValueStub getIdentifier() {
- return
(KeyValueStub)ValueStubFactory.createValueStub(invoke("getIdentifier"));
//$NON-NLS-1$
+ return (KeyValueStub)ValueStubFactory.createValueStub(invoke(mn()));
}
public PersistentClassStub getSuperclass() {
- return
PersistentClassStubFactory.createPersistentClassStub(invoke("getSuperclass"));
//$NON-NLS-1$
+ return PersistentClassStubFactory.createPersistentClassStub(invoke(mn()));
}
public PropertyStub getProperty(String propertyName) {
- Object obj = invoke("getProperty", propertyName); //$NON-NLS-1$
+ Object obj = invoke(mn(), propertyName);
if (obj == null) {
return null;
}
@@ -107,12 +107,12 @@
}
public String getNodeName() {
- return (String)invoke("getNodeName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
@SuppressWarnings("unchecked")
public Iterator<PropertyStub> getPropertyClosureIterator() {
- Iterator it = (Iterator)invoke("getPropertyClosureIterator"); //$NON-NLS-1$
+ Iterator it = (Iterator)invoke(mn());
ArrayList<PropertyStub> al = new ArrayList<PropertyStub>();
while (it.hasNext()) {
Object obj = it.next();
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -4,33 +4,26 @@
import java.util.Iterator;
import java.util.List;
-import org.hibernate.mapping.Column;
-import org.hibernate.mapping.PrimaryKey;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class PrimaryKeyStub {
+public class PrimaryKeyStub extends HObject {
public static final String CL = "org.hibernate.mapping.PrimaryKey";
//$NON-NLS-1$
- protected PrimaryKey primaryKey;
-
protected PrimaryKeyStub(Object primaryKey) {
- if (primaryKey == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.primaryKey = (PrimaryKey)primaryKey;
+ super(primaryKey, CL);
}
public boolean containsColumn(ColumnStub column) {
- return primaryKey.containsColumn(column.column);
+ return (Boolean)invoke(mn(), column);
}
public String getName() {
- return primaryKey.getName();
+ return (String)invoke(mn());
}
@SuppressWarnings("unchecked")
public Iterator<ColumnStub> columnIterator() {
- Iterator<Column> it = (Iterator<Column>)primaryKey.getColumnIterator();
+ Iterator it = (Iterator)invoke(mn());
ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -43,7 +36,7 @@
@SuppressWarnings("unchecked")
public List<ColumnStub> getColumns() {
- Iterator<Column> it = (Iterator<Column>)primaryKey.getColumnIterator();
+ Iterator it = (Iterator)invoke("getColumnIterator"); //$NON-NLS-1$
ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -55,11 +48,11 @@
}
public int getColumnSpan() {
- return primaryKey.getColumnSpan();
+ return (Integer)invoke(mn());
}
public ColumnStub getColumn(int i) {
- Object obj = primaryKey.getColumn(i);
+ Object obj = invoke(mn(), i);
if (obj == null) {
return null;
}
@@ -67,7 +60,7 @@
}
public TableStub getTable() {
- Object obj = primaryKey.getTable();
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,7 +12,7 @@
}
public void setElement(ValueStub element) {
- invoke("setElement", element); //$NON-NLS-1$
+ invoke(mn(), element);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,18 +1,13 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mediator.Messages;
-import org.hibernate.type.PrimitiveType;
-
public class PrimitiveTypeStub extends ImmutableTypeStub {
public static final String CL = "org.hibernate.type.PrimitiveType";
//$NON-NLS-1$
- protected PrimitiveType primitiveType;
-
protected PrimitiveTypeStub(Object primitiveType) {
- super(primitiveType);
- if (primitiveType == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.primitiveType = (PrimitiveType)primitiveType;
+ super(primitiveType, CL);
}
+
+ protected PrimitiveTypeStub(Object primitiveType, String cn) {
+ super(primitiveType, cn);
+ }
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -2,6 +2,7 @@
import org.hibernate.cfg.reveng.ProgressListener;
+//TODO: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
public abstract class ProgressListenerStub {
public static final String CL = "org.hibernate.cfg.reveng.ProgressListener";
//$NON-NLS-1$
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -14,83 +14,83 @@
}
public void setName(String name) {
- invoke("setName", name); //$NON-NLS-1$
+ invoke(mn(), name);
}
public void setValue(ValueStub value) {
- invoke("setValue", value); //$NON-NLS-1$
+ invoke(mn(), value);
}
public ValueStub getValue() {
- return ValueStubFactory.createValueStub(invoke("getValue")); //$NON-NLS-1$
+ return ValueStubFactory.createValueStub(invoke(mn()));
}
public void setCascade(String cascade) {
- invoke("setCascade", cascade); //$NON-NLS-1$
+ invoke(mn(), cascade);
}
public String getName() {
- return (String)invoke("getName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public TypeStub getType() {
- return TypeStubFactory.createTypeStub(invoke("getType")); //$NON-NLS-1$
+ return TypeStubFactory.createTypeStub(invoke(mn()));
}
public PersistentClassStub getPersistentClass() {
- return
PersistentClassStubFactory.createPersistentClassStub(invoke("getPersistentClass"));
//$NON-NLS-1$
+ return PersistentClassStubFactory.createPersistentClassStub(invoke(mn()));
}
public void setPersistentClass(PersistentClassStub ownerClass) {
- invoke("setPersistentClass", ownerClass); //$NON-NLS-1$
+ invoke(mn(), ownerClass);
}
public boolean isSelectable() {
- return (Boolean)invoke("isSelectable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isInsertable() {
- return (Boolean)invoke("isInsertable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isUpdateable() {
- return (Boolean)invoke("isUpdateable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isLazy() {
- return (Boolean)invoke("isLazy"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isOptional() {
- return (Boolean)invoke("isOptional"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isNaturalIdentifier() {
- return (Boolean)invoke("isNaturalIdentifier"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isOptimisticLocked() {
- return (Boolean)invoke("isOptimisticLocked"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public String getCascade() {
- return (String)invoke("getCascade"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getNodeName() {
- return (String)invoke("getNodeName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public boolean isBackRef() {
- return (Boolean)invoke("isBackRef"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isComposite() {
- return (Boolean)invoke("isComposite"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public String getPropertyAccessorName() {
- return (String)invoke("getPropertyAccessorName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,41 +1,35 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.reveng.ReverseEngineeringSettings;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class ReverseEngineeringSettingsStub {
+public class ReverseEngineeringSettingsStub extends HObject {
public static final String CL =
"org.hibernate.cfg.reveng.ReverseEngineeringSettings"; //$NON-NLS-1$
- protected ReverseEngineeringSettings reverseEngineeringSettings;
-
protected ReverseEngineeringSettingsStub(Object reverseEngineeringSettings) {
- if (reverseEngineeringSettings == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.reverseEngineeringSettings =
(ReverseEngineeringSettings)reverseEngineeringSettings;
+ super(reverseEngineeringSettings, CL);
}
public static ReverseEngineeringSettingsStub newInstance(ReverseEngineeringStrategyStub
reverseEngineeringStrategy) {
- return new ReverseEngineeringSettingsStub(new
ReverseEngineeringSettings(reverseEngineeringStrategy.reverseEngineeringStrategy));
+ return new ReverseEngineeringSettingsStub(newInstance(CL,
reverseEngineeringStrategy));
}
public ReverseEngineeringSettingsStub setDefaultPackageName(String defaultPackageName)
{
- reverseEngineeringSettings.setDefaultPackageName(defaultPackageName);
+ invoke(mn(), defaultPackageName);
return this;
}
public ReverseEngineeringSettingsStub setDetectManyToMany(boolean b) {
- reverseEngineeringSettings.setDetectManyToMany(b);
+ invoke(mn(), b);
return this;
}
public ReverseEngineeringSettingsStub setDetectOneToOne(boolean b) {
- reverseEngineeringSettings.setDetectOneToOne(b);
+ invoke(mn(), b);
return this;
}
public ReverseEngineeringSettingsStub setDetectOptimisticLock(boolean
optimisticLockSupportEnabled) {
- reverseEngineeringSettings.setDetectOptimisticLock(optimisticLockSupportEnabled);
+ invoke(mn(), optimisticLockSupportEnabled);
return this;
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,25 +1,19 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class ReverseEngineeringStrategyStub {
+public class ReverseEngineeringStrategyStub extends HObject {
public static final String CL =
"org.hibernate.cfg.reveng.ReverseEngineeringStrategy"; //$NON-NLS-1$
- protected ReverseEngineeringStrategy reverseEngineeringStrategy;
-
protected ReverseEngineeringStrategyStub(Object reverseEngineeringStrategy) {
- if (reverseEngineeringStrategy == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.reverseEngineeringStrategy =
(ReverseEngineeringStrategy)reverseEngineeringStrategy;
+ super(reverseEngineeringStrategy, CL);
}
-
- public static String getClassName() {
- return ReverseEngineeringStrategy.class.getName();
+
+ protected ReverseEngineeringStrategyStub(Object reverseEngineeringStrategy, String cn)
{
+ super(reverseEngineeringStrategy, cn);
}
public void setSettings(ReverseEngineeringSettingsStub settings) {
- reverseEngineeringStrategy.setSettings(settings.reverseEngineeringSettings);
+ invoke(mn(), settings);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -15,15 +15,15 @@
}
public String getClassName() {
- return (String)invoke("getClassName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public void setDiscriminator(ValueStub discr) {
- invoke("setDiscriminator", discr); //$NON-NLS-1$
+ invoke(mn(), discr);
}
public TableStub getTable() {
- Object obj = invoke("getTable"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -31,15 +31,15 @@
}
public void addProperty(PropertyStub p) {
- invoke("addProperty", p); //$NON-NLS-1$
+ invoke(mn(), p);
}
public void setIdentifierProperty(PropertyStub p) {
- invoke("setIdentifierProperty", p); //$NON-NLS-1$
+ invoke(mn(), p);
}
public PropertyStub getIdentifierProperty() {
- Object obj = invoke("getIdentifierProperty"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -47,144 +47,144 @@
}
public void setEntityName(String entityName) {
- invoke("setEntityName", entityName); //$NON-NLS-1$
+ invoke(mn(), entityName);
}
public void setClassName(String className) {
- invoke("setClassName", className); //$NON-NLS-1$
+ invoke(mn(), className);
}
public void setProxyInterfaceName(String proxyInterfaceName) {
- invoke("setProxyInterfaceName", proxyInterfaceName); //$NON-NLS-1$
+ invoke(mn(), proxyInterfaceName);
}
public void setLazy(boolean lazy) {
- invoke("setLazy", lazy); //$NON-NLS-1$
+ invoke(mn(), lazy);
}
public void setTable(TableStub table) {
- invoke("setTable", table); //$NON-NLS-1$
+ invoke(mn(), table);
}
public void setAbstract(Boolean isAbstract) {
- invoke("setAbstract", isAbstract); //$NON-NLS-1$
+ invoke(mn(), isAbstract);
}
public String getNodeName() {
- return (String)invoke("getNodeName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public KeyValueStub getIdentifier() {
- return
(KeyValueStub)ValueStubFactory.createValueStub(invoke("getIdentifier"));
//$NON-NLS-1$
+ return (KeyValueStub)ValueStubFactory.createValueStub(invoke(mn()));
}
public boolean isCustomDeleteCallable() {
- return (Boolean)invoke("isCustomDeleteCallable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isCustomInsertCallable() {
- return (Boolean)invoke("isCustomInsertCallable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isCustomUpdateCallable() {
- return (Boolean)invoke("isCustomUpdateCallable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isDiscriminatorInsertable() {
- return (Boolean)invoke("isDiscriminatorInsertable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isDiscriminatorValueNotNull() {
- return (Boolean)invoke("isDiscriminatorValueNotNull"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isDiscriminatorValueNull() {
- return (Boolean)invoke("isDiscriminatorValueNull"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isExplicitPolymorphism() {
- return (Boolean)invoke("isExplicitPolymorphism"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isForceDiscriminator() {
- return (Boolean)invoke("isForceDiscriminator"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isInherited() {
- return (Boolean)invoke("isInherited"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isJoinedSubclass() {
- return (Boolean)invoke("isJoinedSubclass"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isLazy() {
- return (Boolean)invoke("isLazy"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isLazyPropertiesCacheable() {
- return (Boolean)invoke("isLazyPropertiesCacheable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isMutable() {
- return (Boolean)invoke("isMutable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isPolymorphic() {
- return (Boolean)invoke("isPolymorphic"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isVersioned() {
- return (Boolean)invoke("isVersioned"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public int getBatchSize() {
- return (Integer)invoke("getBatchSize"); //$NON-NLS-1$
+ return (Integer)invoke(mn());
}
public String getCacheConcurrencyStrategy() {
- return (String)invoke("getCacheConcurrencyStrategy"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getCustomSQLDelete() {
- return (String)invoke("getCustomSQLDelete"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getCustomSQLInsert() {
- return (String)invoke("getCustomSQLInsert"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getCustomSQLUpdate() {
- return (String)invoke("getCustomSQLUpdate"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getDiscriminatorValue() {
- return (String)invoke("getDiscriminatorValue"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getLoaderName() {
- return (String)invoke("getLoaderName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public int getOptimisticLockMode() {
- return (Integer)invoke("getOptimisticLockMode"); //$NON-NLS-1$
+ return (Integer)invoke(mn());
}
public String getTemporaryIdTableDDL() {
- return (String)invoke("getTemporaryIdTableDDL"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getTemporaryIdTableName() {
- return (String)invoke("getTemporaryIdTableName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getWhere() {
- return (String)invoke("getWhere"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
@SuppressWarnings("unchecked")
public Iterator<SubclassStub> getSubclassIterator() {
- Iterator it = (Iterator)invoke("getSubclassIterator"); //$NON-NLS-1$
+ Iterator it = (Iterator)invoke(mn());
ArrayList<SubclassStub> al = new ArrayList<SubclassStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -197,6 +197,6 @@
@Override
public ValueStub getDiscriminator() {
- return ValueStubFactory.createValueStub(invoke("getDiscriminator"));
//$NON-NLS-1$
+ return ValueStubFactory.createValueStub(invoke(mn()));
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,9 +1,9 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.reveng.SQLTypeMapping;
+import org.hibernate.mediator.base.HObject;
public class SQLTypeMappingStub {
public static final String CL = "org.hibernate.cfg.reveng.SQLTypeMapping";
//$NON-NLS-1$
- public static final Boolean UNKNOWN_NULLABLE = SQLTypeMapping.UNKNOWN_NULLABLE;
+ public static final Boolean UNKNOWN_NULLABLE = (Boolean)HObject.readStaticFieldValue(CL,
"UNKNOWN_NULLABLE"); //$NON-NLS-1$
}
Added:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SchemaExportStub.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SchemaExportStub.java
(rev 0)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SchemaExportStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -0,0 +1,30 @@
+package org.hibernate.mediator.stubs;
+
+import java.util.List;
+
+import org.hibernate.mediator.base.HObject;
+
+public class SchemaExportStub extends HObject {
+ public static final String CL = "org.hibernate.tool.hbm2ddl.SchemaExport";
//$NON-NLS-1$
+
+ protected SchemaExportStub(Object exporter) {
+ super(exporter, CL);
+ }
+
+ protected SchemaExportStub(Object exporter, String cn) {
+ super(exporter, cn);
+ }
+
+ public static SchemaExportStub createSchemaExport(Object configuration) {
+ return new SchemaExportStub(HObject.newInstance(CL, configuration));
+ }
+
+ public void create(boolean b, boolean c) {
+ invoke(mn(), b, c );
+ }
+
+ @SuppressWarnings("unchecked")
+ public List getExceptions() {
+ return (List)invoke(mn());
+ }
+}
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SelectableStub.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SelectableStub.java 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SelectableStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,17 +1,15 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mapping.Selectable;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class SelectableStub {
+public class SelectableStub extends HObject {
public static final String CL = "org.hibernate.mapping.Selectable";
//$NON-NLS-1$
- protected Selectable selectable;
-
protected SelectableStub(Object selectable) {
- if (selectable == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.selectable = (Selectable)selectable;
+ super(selectable, CL);
}
+
+ protected SelectableStub(Object selectable, String cn) {
+ super(selectable, cn);
+ }
}
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -7,82 +7,76 @@
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.base.HObject;
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 SessionFactoryStub {
+//TODO: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+public class SessionFactoryStub extends HObject {
public static final String CL = "org.hibernate.SessionFactory"; //$NON-NLS-1$
- protected SessionFactory sessionFactory;
-
protected SessionFactoryStub(Object sessionFactory) {
- if (sessionFactory == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.sessionFactory = (SessionFactory)sessionFactory;
+ super(sessionFactory, CL);
}
public boolean isSessionFactoryCreated() {
- return sessionFactory != null;
+ return Obj() != null;
}
public SessionStub openSession() {
- if (sessionFactory != null) {
- return new SessionStub(sessionFactory.openSession());
+ if (Obj() != null) {
+ return new SessionStub(invoke(mn()));
}
return null;
}
public void close() {
- if (sessionFactory != null) {
- sessionFactory.close();
+ if (Obj() != null) {
+ invoke(mn());
}
}
@SuppressWarnings("unchecked")
public List<String> getClasses() {
List<String> res = Collections.emptyList();
- if (sessionFactory != null) {
+ if (Obj() != null) {
res = new ArrayList<String>();
- res.addAll(sessionFactory.getAllClassMetadata().keySet());
+ res.addAll(((Map)invoke("getAllClassMetadata")).keySet()); //$NON-NLS-1$
}
return res;
}
@SuppressWarnings("unchecked")
public Map<String, ClassMetadataStub> getClassMetaData() {
- if (sessionFactory == null) {
+ if (Obj() == null) {
return new HashMap<String, ClassMetadataStub>();
}
- Map<String, ClassMetadata> allClassMetadata =
sessionFactory.getAllClassMetadata();
- Iterator<Map.Entry<String, ClassMetadata>> it =
allClassMetadata.entrySet().iterator();
+ Map allClassMetadata = (Map)invoke("getAllClassMetadata"); //$NON-NLS-1$
+ Iterator 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()));
+ Map.Entry entry = (Map.Entry)it.next();
+ res.put((String)entry.getKey(), new ClassMetadataStub(entry.getValue()));
}
return res;
}
@SuppressWarnings("unchecked")
public Map<String, CollectionMetadataStub> getCollectionMetaData() {
- if (sessionFactory == null) {
+ if (Obj() == null) {
return new HashMap<String, CollectionMetadataStub>();
}
- Map<String, CollectionMetadata> allClassMetadata =
sessionFactory.getAllCollectionMetadata();
- Iterator<Map.Entry<String, CollectionMetadata>> it =
allClassMetadata.entrySet().iterator();
+ Map allClassMetadata = (Map)invoke("getAllCollectionMetadata");
//$NON-NLS-1$
+ Iterator 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()));
+ Map.Entry entry = (Map.Entry)it.next();
+ res.put((String)entry.getKey(), new CollectionMetadataStub(entry.getValue()));
}
return res;
}
@@ -96,18 +90,18 @@
* if true, EL syntax will be replaced as a named variable
*/
public void checkQuery(String query, boolean allowEL) {
- if (sessionFactory != null) {
+ if (Obj() != null) {
if (allowEL) {
query = ELTransformer.removeEL(query);
}
new HQLQueryPlan(query, false, Collections.EMPTY_MAP,
- (SessionFactoryImpl) sessionFactory);
+ (SessionFactoryImpl) Obj());
}
}
public String generateSQL(String query) {
try {
- SessionFactoryImpl sfimpl = (SessionFactoryImpl) sessionFactory; // hack - to get to
the
+ SessionFactoryImpl sfimpl = (SessionFactoryImpl) Obj(); // hack - to get to the
// actual queries..
StringBuffer str = new StringBuffer(256);
HQLQueryPlan plan = new HQLQueryPlan(query, false, Collections.EMPTY_MAP, sfimpl);
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,7 +12,6 @@
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;
@@ -20,6 +19,7 @@
import org.hibernate.mediator.Messages;
import org.hibernate.mediator.ConsoleQueryParameter;
import org.hibernate.mediator.QueryInputModel;
+import org.hibernate.mediator.base.HObject;
import org.hibernate.mediator.util.CollectionPropertySource;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.metadata.CollectionMetadata;
@@ -29,30 +29,22 @@
import bsh.EvalError;
import bsh.Interpreter;
-public class SessionStub {
+public class SessionStub extends HObject {
public static final String CL = "org.hibernate.Session"; //$NON-NLS-1$
- protected Session session;
-
- protected SessionStub(Session session) {
- if (session == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.session = session;
+ protected SessionStub(Object session) {
+ super(session, CL);
}
public boolean isOpen() {
- boolean res = false;
- if (session != null) {
- res = session.isOpen();
- }
+ boolean res = (Boolean)invoke(mn());
return res;
}
public void close(List<Throwable> exceptions) {
- if (session != null && session.isOpen()) {
+ if (isOpen()) {
try {
- session.close();
+ invoke(mn());
} catch (HibernateException e) {
exceptions.add(e);
}
@@ -60,88 +52,75 @@
}
public boolean contains(Object obj) {
- boolean res = false;
- if (session != null) {
- res = session.contains(obj);
- }
+ boolean res = (Boolean)invoke(mn(), obj);
return res;
}
public boolean hasMetaData(Object obj) {
- boolean res = false;
- if (session != null) {
- res = session.getSessionFactory().getClassMetadata(
- HibernateProxyHelper.getClassWithoutInitializingProxy(obj)) != null;
- }
+ SessionFactory sf = (SessionFactory)invoke("getSessionFactory");
//$NON-NLS-1$
+ boolean res = sf.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);
- }
+ try {
+ SessionFactory sf = (SessionFactory)invoke("getSessionFactory");
//$NON-NLS-1$
+ res = sf.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);
- }
+ String res = (String)invoke(mn(), 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);
- }
+ try {
+ res = (String)invoke(mn(), 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));
+ SessionFactory sf = (SessionFactory)invoke("getSessionFactory");
//$NON-NLS-1$
+ ClassMetadata classMetadata;
+ if (isOpen()) {
+ classMetadata = sf.getClassMetadata(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);
}
- 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();
+ SessionFactory sf = (SessionFactory)invoke("getSessionFactory");
//$NON-NLS-1$
ClassMetadata classMetadata;
- if (session.isOpen()) {
- classMetadata = sf.getClassMetadata(session.getEntityName(obj));
+ if (isOpen()) {
+ classMetadata = sf.getClassMetadata(getEntityName(obj));
} else {
classMetadata = sf.getClassMetadata(HibernateProxyHelper
.getClassWithoutInitializingProxy(obj));
@@ -221,9 +200,9 @@
private Interpreter setupInterpreter() throws EvalError, HibernateException {
Interpreter interpreter = new Interpreter();
- interpreter.set("session", session); //$NON-NLS-1$
+ interpreter.set("session", Obj()); //$NON-NLS-1$
interpreter.setClassLoader(Thread.currentThread().getContextClassLoader());
- SessionImplementor si = (SessionImplementor) session;
+ SessionImplementor si = (SessionImplementor)Obj();
Map<String, ?> map = si.getFactory().getAllClassMetadata();
@@ -248,7 +227,7 @@
List<Object> res = Collections.emptyList();
Query query = null;
try {
- query = session.createQuery(queryString);
+ query = (Query)invoke("createQuery", queryString); //$NON-NLS-1$
} catch (HibernateException e) {
exceptions.add(e);
} catch (Exception e) {
@@ -301,7 +280,7 @@
List<String> res = Collections.emptyList();
Query query = null;
try {
- query = session.createQuery(queryString);
+ query = (Query)invoke("createQuery", queryString); //$NON-NLS-1$
} catch (HibernateException e) {
exceptions.add(e);
} catch (Exception e) {
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,29 +1,23 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.Settings;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class SettingsStub {
+public class SettingsStub extends HObject {
public static final String CL = "org.hibernate.cfg.Settings"; //$NON-NLS-1$
- protected Settings settings;
-
protected SettingsStub(Object settings) {
- if (settings == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.settings = (Settings)settings;
+ super(settings, CL);
}
public ConnectionProviderStub getConnectionProvider() {
- return new ConnectionProviderStub(settings.getConnectionProvider());
+ return new ConnectionProviderStub(invoke(mn()));
}
public String getDefaultCatalogName() {
- return settings.getDefaultCatalogName();
+ return (String)invoke(mn());
}
public String getDefaultSchemaName() {
- return settings.getDefaultSchemaName();
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -18,31 +18,31 @@
}
public void setTypeName(String type) {
- invoke("setTypeName", type); //$NON-NLS-1$
+ invoke(mn(), type);
}
public void addColumn(ColumnStub column) {
- invoke("addColumn", column.column); //$NON-NLS-1$
+ invoke(mn(), column);
}
public void setTable(TableStub table) {
- invoke("setTable", table); //$NON-NLS-1$
+ invoke(mn(), table);
}
public void setTypeParameters(Properties parameterMap) {
- invoke("setTypeParameters" ,parameterMap); //$NON-NLS-1$
+ invoke(mn() ,parameterMap);
}
public String getForeignKeyName() {
- return (String)invoke("getForeignKeyName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getTypeName() {
- return (String)invoke("getTypeName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public boolean isTypeSpecified() {
- return (Boolean)invoke("isTypeSpecified"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
@Override
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,26 +1,9 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mapping.SingleTableSubclass;
-import org.hibernate.mediator.Messages;
-
public class SingleTableSubclassStub extends SubclassStub {
public static final String CL = "org.hibernate.mapping.SingleTableSubclass";
//$NON-NLS-1$
- protected SingleTableSubclass singleTableSubclass;
-
protected SingleTableSubclassStub(Object singleTableSubclass) {
- super(singleTableSubclass);
- if (singleTableSubclass == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.singleTableSubclass = (SingleTableSubclass)singleTableSubclass;
+ super(singleTableSubclass, CL);
}
-
- public static SingleTableSubclassStub newInstance(Object singleTableSubclass) {
- if (singleTableSubclass == null) {
- return null;
- }
- return new SingleTableSubclassStub(singleTableSubclass);
- }
-
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,27 +12,27 @@
}
public void setClassName(String className) {
- invoke("setClassName", className); //$NON-NLS-1$
+ invoke(mn(), className);
}
public void setEntityName(String entityName) {
- invoke("setEntityName", entityName); //$NON-NLS-1$
+ invoke(mn(), entityName);
}
public void setDiscriminatorValue(String discriminatorValue) {
- invoke("setDiscriminatorValue", discriminatorValue); //$NON-NLS-1$
+ invoke(mn(), discriminatorValue);
}
public void setAbstract(Boolean isAbstract) {
- invoke("setAbstract", isAbstract); //$NON-NLS-1$
+ invoke(mn(), isAbstract);
}
public void addProperty(PropertyStub p) {
- invoke("addProperty", p); //$NON-NLS-1$
+ invoke(mn(), p);
}
public TableStub getRootTable() {
- Object obj = invoke("getRootTable"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -40,6 +40,6 @@
}
public boolean isJoinedSubclass() {
- return (Boolean)invoke("isJoinedSubclass"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,54 +1,48 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.reveng.TableFilter;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class TableFilterStub {
+public class TableFilterStub extends HObject {
public static final String CL = "org.hibernate.cfg.reveng.TableFilter";
//$NON-NLS-1$
- protected TableFilter tableFilter;
-
protected TableFilterStub(Object tableFilter) {
- if (tableFilter == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.tableFilter = (TableFilter)tableFilter;
+ super(tableFilter, CL);
}
public static TableFilterStub newInstance() {
- return new TableFilterStub(new TableFilter());
+ return new TableFilterStub(newInstance(CL));
}
public void setExclude(Boolean exclude) {
- tableFilter.setExclude(exclude);
+ invoke(mn(), exclude);
}
public void setMatchCatalog(String matchCatalog) {
- tableFilter.setMatchCatalog(matchCatalog);
+ invoke(mn(), matchCatalog);
}
public void setMatchName(String matchName) {
- tableFilter.setMatchName(matchName);
+ invoke(mn(), matchName);
}
public void setMatchSchema(String matchSchema) {
- tableFilter.setMatchSchema(matchSchema);
+ invoke(mn(), matchSchema);
}
public Boolean getExclude() {
- return tableFilter.getExclude();
+ return (Boolean)invoke(mn());
}
public String getMatchCatalog() {
- return tableFilter.getMatchCatalog();
+ return (String)invoke(mn());
}
public String getMatchSchema() {
- return tableFilter.getMatchSchema();
+ return (String)invoke(mn());
}
public String getMatchName() {
- return tableFilter.getMatchName();
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,18 +1,12 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.cfg.reveng.TableIdentifier;
-import org.hibernate.mediator.Messages;
+import org.hibernate.mediator.base.HObject;
-public class TableIdentifierStub {
+public class TableIdentifierStub extends HObject {
public static final String CL = "org.hibernate.cfg.reveng.TableIdentifier";
//$NON-NLS-1$
- protected TableIdentifier tableIdentifier;
-
protected TableIdentifierStub(Object tableIdentifier) {
- if (tableIdentifier == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.tableIdentifier = (TableIdentifier)tableIdentifier;
+ super(tableIdentifier, CL);
}
public static TableIdentifierStub create(TableStub table) {
@@ -20,10 +14,10 @@
}
public static TableIdentifierStub newInstance(String catalog, String schema, String
name) {
- return new TableIdentifierStub(new TableIdentifier(catalog, schema, name));
+ return new TableIdentifierStub(HObject.newInstance(CL, catalog, schema, name));
}
public String getName() {
- return tableIdentifier.getName();
+ return (String)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,8 +3,6 @@
import java.util.ArrayList;
import java.util.Iterator;
-import org.hibernate.mapping.Column;
-import org.hibernate.mapping.ForeignKey;
import org.hibernate.mediator.Messages;
import org.hibernate.mediator.base.HObject;
@@ -20,11 +18,11 @@
}
public String getName() {
- return (String)invoke("getName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public PrimaryKeyStub getPrimaryKey() {
- Object obj = invoke("getPrimaryKey"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -33,7 +31,7 @@
@SuppressWarnings("unchecked")
public Iterator<ForeignKeyStub> getForeignKeyIterator() {
- Iterator<ForeignKey> it =
(Iterator<ForeignKey>)invoke("getForeignKeyIterator"); //$NON-NLS-1$
+ Iterator it = (Iterator)invoke(mn());
ArrayList<ForeignKeyStub> al = new ArrayList<ForeignKeyStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -45,15 +43,15 @@
}
public String getCatalog() {
- return (String)invoke("getCatalog"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getSchema() {
- return (String)invoke("getSchema"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public KeyValueStub getIdentifierValue() {
- Object obj = invoke("getIdentifierValue"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -66,7 +64,7 @@
@SuppressWarnings("unchecked")
public Iterator<ColumnStub> getColumnIterator() {
- Iterator<Column> it =
(Iterator<Column>)invoke("getColumnIterator"); //$NON-NLS-1$
+ Iterator it = (Iterator)invoke(mn());
ArrayList<ColumnStub> al = new ArrayList<ColumnStub>();
while (it.hasNext()) {
Object obj = it.next();
@@ -78,30 +76,30 @@
}
public String getComment() {
- return (String)invoke("getComment"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getRowId() {
- return (String)invoke("getRowId"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public String getSubselect() {
- return (String)invoke("getSubselect"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
public boolean hasDenormalizedTables() {
- return (Boolean)invoke("hasDenormalizedTables"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isAbstract() {
- return (Boolean)invoke("isAbstract"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isAbstractUnionTable() {
- return (Boolean)invoke("isAbstractUnionTable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isPhysicalTable() {
- return (Boolean)invoke("isPhysicalTable"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,18 +12,18 @@
}
public void setReferencedEntityName(String referencedEntityName) {
- invoke("setReferencedEntityName", referencedEntityName); //$NON-NLS-1$
+ invoke(mn(), referencedEntityName);
}
public void setReferencedPropertyName(String name) {
- invoke("setReferencedPropertyName", name); //$NON-NLS-1$
+ invoke(mn(), name);
}
public void setFetchMode(FetchModeStub fetchMode) {
- invoke("setFetchMode", fetchMode); //$NON-NLS-1$
+ invoke(mn(), fetchMode);
}
public boolean isEmbedded() {
- return (Boolean)invoke("isEmbedded"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -15,26 +15,26 @@
@SuppressWarnings("unchecked")
public Class getReturnedClass() {
- return (Class)invoke("getReturnedClass"); //$NON-NLS-1$
+ return (Class)invoke(mn());
}
public boolean isCollectionType() {
- return (Boolean)invoke("isCollectionType"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isEntityType() {
- return (Boolean)invoke("isEntityType"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isAnyType() {
- return (Boolean)invoke("isAnyType"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public boolean isComponentType() {
- return (Boolean)invoke("isComponentType"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public String getName() {
- return (String)invoke("getName"); //$NON-NLS-1$
+ return (String)invoke(mn());
}
}
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/UnionSubclassStub.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/UnionSubclassStub.java 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/UnionSubclassStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -1,18 +1,9 @@
package org.hibernate.mediator.stubs;
-import org.hibernate.mapping.UnionSubclass;
-import org.hibernate.mediator.Messages;
-
public class UnionSubclassStub extends SubclassStub {
public static final String CL = "org.hibernate.mapping.UnionSubclass";
//$NON-NLS-1$
- protected UnionSubclass unionSubclass;
-
protected UnionSubclassStub(Object unionSubclass) {
- super(unionSubclass);
- if (unionSubclass == null) {
- throw new HibernateConsoleRuntimeException(Messages.Stub_create_null_stub_prohibit);
- }
- this.unionSubclass = (UnionSubclass)unionSubclass;
+ super(unionSubclass, CL);
}
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.Iterator;
-import org.hibernate.mapping.Selectable;
import org.hibernate.mediator.base.HObject;
public abstract class ValueStub extends HObject {
@@ -18,7 +17,7 @@
}
public TableStub getTable() {
- Object obj = invoke("getTable"); //$NON-NLS-1$
+ Object obj = invoke(mn());
if (obj == null) {
return null;
}
@@ -26,19 +25,19 @@
}
public boolean isSimpleValue() {
- return (Boolean)invoke("isSimpleValue"); //$NON-NLS-1$
+ return (Boolean)invoke(mn());
}
public TypeStub getType() {
- return TypeStubFactory.createTypeStub(invoke("getType")); //$NON-NLS-1$
+ return TypeStubFactory.createTypeStub(invoke(mn()));
}
@SuppressWarnings("unchecked")
public Iterator<SelectableStub> getColumnIterator() {
- Iterator<Selectable> it =
(Iterator<Selectable>)invoke("getColumnIterator"); //$NON-NLS-1$
+ Iterator it = (Iterator)invoke(mn());
ArrayList<SelectableStub> al = new ArrayList<SelectableStub>();
while (it.hasNext()) {
- Selectable obj = it.next();
+ Object obj = it.next();
if (obj != null) {
al.add(SelectableStubFactory.createSelectableStub(obj));
}
Modified:
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 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -4,13 +4,13 @@
import java.io.InputStream;
import java.io.OutputStream;
-import org.hibernate.tool.hbm2x.XMLPrettyPrinter;
+import org.hibernate.mediator.base.HObject;
public class XMLPrettyPrinterStub {
public static final String CL = "org.hibernate.tool.hbm2x.XMLPrettyPrinter";
//$NON-NLS-1$
public static void prettyPrint(InputStream in, OutputStream writer) throws IOException
{
- XMLPrettyPrinter.prettyPrint(in, writer);
+ HObject.invokeStaticMethod(CL, "prettyPrint", in, writer); //$NON-NLS-1$
}
}
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ClassHelper.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ClassHelper.java 2010-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/util/ClassHelper.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -12,13 +12,22 @@
}
Type[] types = cl.getInterfaces();
for (Type type : types) {
- if (0 == name.compareTo(((Class<?>)type).getName())) {
- return true;
+ if (type instanceof Class<?>) {
+ if (0 == name.compareTo(((Class<?>)type).getName())) {
+ return true;
+ }
+ boolean b = isClassOrOffspring((Class<?>)type, name);
+ if (b) {
+ return true;
+ }
}
}
Type type = cl.getGenericSuperclass();
if (type instanceof Class<?>) {
- return isClassOrOffspring((Class<?>)type, name);
+ boolean b = isClassOrOffspring((Class<?>)type, name);
+ if (b) {
+ return true;
+ }
}
return false;
}
Added:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/MReflectionUtils.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/MReflectionUtils.java
(rev 0)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/util/MReflectionUtils.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -0,0 +1,40 @@
+package org.hibernate.mediator.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
+import org.hibernate.mediator.stubs.util.ReflectHelper;
+
+public class MReflectionUtils {
+
+ @SuppressWarnings("unchecked")
+ public static Method getMethod(Class targetClass, String methodName, Class[] argClasses)
{
+ Class<?> clazz;
+ try {
+ clazz = ReflectHelper.classForName("java.beans.ReflectionUtils");
//$NON-NLS-1$
+ } catch (ClassNotFoundException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ Method method = null;
+ try {
+ method = clazz.getMethod("getMethod", new Class[] { Class.class,
String.class, Class[].class } ); //$NON-NLS-1$
+ } catch (SecurityException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ method.setAccessible(true);
+ Method res;
+ try {
+ res = (Method)method.invoke(null, targetClass, methodName, argClasses);
+ } catch (IllegalArgumentException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new HibernateConsoleRuntimeException(e);
+ }
+ return res;
+ }
+}
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-04-06
11:13:35 UTC (rev 21285)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java 2010-04-06
12:34:30 UTC (rev 21286)
@@ -30,6 +30,7 @@
import org.hibernate.mediator.stubs.ConfigurationStub;
import org.hibernate.mediator.stubs.DialectStub;
import org.hibernate.mediator.stubs.EnvironmentStub;
+import org.hibernate.mediator.stubs.HibernateConsoleRuntimeException;
import org.hibernate.mediator.stubs.MappingStub;
import org.hibernate.mediator.stubs.PropertyStub;
import org.hibernate.mediator.stubs.RootClassStub;
@@ -152,12 +153,8 @@
if (dialectName != null) {
try {
dialect = DialectStub.newInstance(dialectName);
- } catch (InstantiationException e) {
+ } catch (HibernateConsoleRuntimeException e) {
HibernateConsolePlugin.getDefault().logErrorMessage("Exception: ", e);
//$NON-NLS-1$
- } catch (IllegalAccessException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Exception: ", e);
//$NON-NLS-1$
- } catch (ClassNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Exception: ", e);
//$NON-NLS-1$
}
}
}