JBoss Tools SVN: r28303 - branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-17 09:49:35 -0500 (Mon, 17 Jan 2011)
New Revision: 28303
Modified:
branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
corrected typo
Modified: branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:32:07 UTC (rev 28302)
+++ branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:49:35 UTC (rev 28303)
@@ -140,7 +140,7 @@
.openWarning(
getShell(),
"Instance key is not private key",
- "The instance key you have chosen is not known as private key to the ssh subsystem. If you need this key to connect to your instance, you'll have to download it and add it to the private keys in the SSH preferences.");
+ "The instance key you have chosen is not known to the ssh subsystem. If you need this key to connect to your instance, you'll have to download it and add it to the private keys in the SSH preferences.");
}
} catch (FileNotFoundException e) {
15 years, 2 months
JBoss Tools SVN: r28302 - branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-17 09:32:07 -0500 (Mon, 17 Jan 2011)
New Revision: 28302
Modified:
branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
corrected typo
Modified: branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:31:50 UTC (rev 28301)
+++ branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:32:07 UTC (rev 28302)
@@ -140,7 +140,7 @@
.openWarning(
getShell(),
"Instance key is not private key",
- "The instance key is not a key that's know as private key to the ssh-subsystem. If you need this key to connect to your instance, you'll have to download it and add it to the private keys in the SSH preferences.");
+ "The instance key you have chosen is not known as private key to the ssh subsystem. If you need this key to connect to your instance, you'll have to download it and add it to the private keys in the SSH preferences.");
}
} catch (FileNotFoundException e) {
15 years, 2 months
JBoss Tools SVN: r28301 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-17 09:31:50 -0500 (Mon, 17 Jan 2011)
New Revision: 28301
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
corrected typo
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:20:49 UTC (rev 28300)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:31:50 UTC (rev 28301)
@@ -140,7 +140,7 @@
.openWarning(
getShell(),
"Instance key is not private key",
- "The instance key is not a key that's know as private key to the ssh-subsystem. If you need this key to connect to your instance, you'll have to download it and add it to the private keys in the SSH preferences.");
+ "The instance key you have chosen is not known as private key to the ssh subsystem. If you need this key to connect to your instance, you'll have to download it and add it to the private keys in the SSH preferences.");
}
} catch (FileNotFoundException e) {
15 years, 2 months
JBoss Tools SVN: r28300 - branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-17 09:20:49 -0500 (Mon, 17 Jan 2011)
New Revision: 28300
Modified:
branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
corrected typo
Modified: branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:20:11 UTC (rev 28299)
+++ branches/jbosstools-3.2.0.CR1/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:20:49 UTC (rev 28300)
@@ -140,7 +140,7 @@
.openWarning(
getShell(),
"Instance key is not private key",
- "The instance key is not a key that's know as private key to the ssh-subsystem. If the instance key is what you need to connect to you instance, you'll have to download it and add it to the private keys in the SSH preferences.");
+ "The instance key is not a key that's know as private key to the ssh-subsystem. If you need this key to connect to your instance, you'll have to download it and add it to the private keys in the SSH preferences.");
}
} catch (FileNotFoundException e) {
15 years, 2 months
JBoss Tools SVN: r28299 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-17 09:20:11 -0500 (Mon, 17 Jan 2011)
New Revision: 28299
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
corrected typo
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:17:50 UTC (rev 28298)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-17 14:20:11 UTC (rev 28299)
@@ -140,7 +140,7 @@
.openWarning(
getShell(),
"Instance key is not private key",
- "The instance key is not a key that's know as private key to the ssh-subsystem. If the instance key is what you need to connect to you instance, you'll have to download it and add it to the private keys in the SSH preferences.");
+ "The instance key is not a key that's know as private key to the ssh-subsystem. If you need this key to connect to your instance, you'll have to download it and add it to the private keys in the SSH preferences.");
}
} catch (FileNotFoundException e) {
15 years, 2 months
JBoss Tools SVN: r28298 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-17 09:17:50 -0500 (Mon, 17 Jan 2011)
New Revision: 28298
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java
Log:
[JBIDE-8126] close manage keys dialog on double click on a key
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java 2011-01-17 13:56:21 UTC (rev 28297)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java 2011-01-17 14:17:50 UTC (rev 28298)
@@ -41,7 +41,7 @@
* the invocation target exception
* @throws InterruptedException
* the interrupted exception
- *
+ *
* @author André Dietisheim
*/
public static void runInWizard(final Job job, IWizardContainer container) throws InvocationTargetException,
@@ -67,16 +67,19 @@
/**
* Flips to the next wizard page or finishes the current wizard.
- *
- * @param wizardPage the wizard page this call is executed in
+ *
+ * @param wizardPage
+ * the wizard page this call is executed in
*/
public static void nextPageOrFinish(IWizardPage wizardPage) {
IWizard wizard = wizardPage.getWizard();
if (wizardPage.canFlipToNextPage()) {
IWizardPage nextPage = wizard.getNextPage(wizardPage);
wizard.getContainer().showPage(nextPage);
- } else if (wizard.canFinish()) {
- wizard.getContainer().getShell().close();
- }
+ } else if (wizard.canFinish()) {
+ if (wizard.performFinish()) {
+ wizard.getContainer().getShell().close();
+ }
+ }
}
}
15 years, 2 months
JBoss Tools SVN: r28297 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model: loaders/impl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-01-17 08:56:21 -0500 (Mon, 17 Jan 2011)
New Revision: 28297
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java
Log:
JBIDE-8067
https://issues.jboss.org/browse/JBIDE-8067
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2011-01-17 13:47:39 UTC (rev 28296)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2011-01-17 13:56:21 UTC (rev 28297)
@@ -49,9 +49,11 @@
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.model.impl.XModelObjectImpl;
import org.jboss.tools.common.model.loaders.AuxiliaryLoader;
+import org.jboss.tools.common.model.loaders.EntityRecognizer;
import org.jboss.tools.common.model.loaders.EntityRecognizerContext;
import org.jboss.tools.common.model.loaders.Reloadable;
import org.jboss.tools.common.model.loaders.XObjectLoader;
+import org.jboss.tools.common.model.loaders.impl.ModelEntityRecognizer;
import org.jboss.tools.common.model.loaders.impl.PropertiesLoader;
import org.jboss.tools.common.model.markers.ResourceMarkers;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -231,20 +233,29 @@
parseFileName(p, f.getName());
String ext = p.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION);
String body = null;
- String entity = getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(f.getName(), ext, body));
+ EntityRecognizer recognizer = getModel().getEntityRecognizer();
+ EntityRecognizerContext context = new EntityRecognizerContext(f.getName(), ext, body);
+ String entity = recognizer.getEntityName(context);
if("FileAny".equals(entity)) { //$NON-NLS-1$
boolean isText = XModelObjectLoaderUtil.isTextFile(f, 100);
if(f.length() > 100000 || !isText) entity = XModelObjectConstants.ENT_FILE_ANY_LONG;
else if(isText) entity = "FileTXT"; //$NON-NLS-1$
- } else /*if(entity == null)*/ {
+ } else if(isRecognizerNeedingBody(entity, recognizer, context)) {
body = getBodySource(f).get();
- entity = getModel().getEntityRecognizer().getEntityName(new EntityRecognizerContext(f.getName(), ext, body));
+ entity = recognizer.getEntityName(new EntityRecognizerContext(f.getName(), ext, body));
}
if(entity == null || getModel().getMetaData().getEntity(entity) == null) entity = "FileAny"; //$NON-NLS-1$
p.setProperty(XMetaDataConstants.ENTITY, entity);
if(body != null) p.setProperty(XModelObjectConstants.ATTR_NAME_BODY, body);
return p;
}
+
+ private boolean isRecognizerNeedingBody(String entityForNullBody, EntityRecognizer recognizer, EntityRecognizerContext context) {
+ if(recognizer instanceof ModelEntityRecognizer) {
+ return ((ModelEntityRecognizer)recognizer).isBodyRequired(context, entityForNullBody);
+ }
+ return true;
+ }
private XModelObject createFileObject(File f, boolean add) {
return createFileObject(f, getEntityProperties(f), add);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java 2011-01-17 13:47:39 UTC (rev 28296)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/ModelEntityRecognizer.java 2011-01-17 13:56:21 UTC (rev 28297)
@@ -19,6 +19,7 @@
public class ModelEntityRecognizer implements EntityRecognizer {
private XModelMetaData meta = null;
private HashMap<String,EntityRecognizer[]> recognizers = new HashMap<String,EntityRecognizer[]>();
+ private Set<String> umbiguousExtensions = new HashSet<String>();
public ModelEntityRecognizer() {}
@@ -42,6 +43,11 @@
return null;
}
+ public boolean isBodyRequired(EntityRecognizerContext context, String entityForNullBody) {
+ return entityForNullBody == null
+ || (context.getExtension() != null && umbiguousExtensions.contains(context.getExtension()));
+ }
+
private void load() {
XMapping m = meta.getMapping("Recognizers"); //$NON-NLS-1$
if(m == null) return;
@@ -77,6 +83,12 @@
recognizers.put(ks[i], rs);
}
}
+ for (String ext: recognizers.keySet()) {
+ EntityRecognizer[] rs = recognizers.get(ext);
+ if(rs != null && rs.length > 1) {
+ umbiguousExtensions.add(ext);
+ }
+ }
}
private EntityRecognizer find(String clsname) {
15 years, 2 months
JBoss Tools SVN: r28296 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/utils and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-17 08:47:39 -0500 (Mon, 17 Jan 2011)
New Revision: 28296
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java
Log:
[JBIDE-8126] close manage keys dialog on double click on a key
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-17 13:15:06 UTC (rev 28295)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-17 13:47:39 UTC (rev 28296)
@@ -1,5 +1,8 @@
2011-01-17 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ * src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java (nextPageOrFinish):
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java (onKeyDoubleclick):
+ [JBIDE-8126] close manage keys dialog on double click on a key
* src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceViewLabelAndContentProvider.java:
* src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageViewLabelAndContentProvider.java:
* src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementViewLabelAndContentProvider.java:
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java 2011-01-17 13:15:06 UTC (rev 28295)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/WizardUtils.java 2011-01-17 13:47:39 UTC (rev 28296)
@@ -18,7 +18,9 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.jface.wizard.IWizardPage;
/**
* @author André Dietisheim
@@ -62,4 +64,19 @@
}
});
}
+
+ /**
+ * Flips to the next wizard page or finishes the current wizard.
+ *
+ * @param wizardPage the wizard page this call is executed in
+ */
+ public static void nextPageOrFinish(IWizardPage wizardPage) {
+ IWizard wizard = wizardPage.getWizard();
+ if (wizardPage.canFlipToNextPage()) {
+ IWizardPage nextPage = wizard.getNextPage(wizardPage);
+ wizard.getContainer().showPage(nextPage);
+ } else if (wizard.canFinish()) {
+ wizard.getContainer().getShell().close();
+ }
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java 2011-01-17 13:15:06 UTC (rev 28295)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java 2011-01-17 13:47:39 UTC (rev 28296)
@@ -42,9 +42,11 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.log.StatusFactory;
@@ -266,6 +268,9 @@
BeanProperties.value(ManageKeysPageModel.PROP_SELECTED_KEY).observe(model),
new UpdateValueStrategy().setConverter(new Id2KeyConverter()),
new UpdateValueStrategy().setConverter(new Key2IdConverter()));
+
+ keyList.addListener(SWT.MouseDoubleClick, onKeyDoubleclick());
+
return keyList;
}
@@ -293,6 +298,16 @@
};
}
+ private Listener onKeyDoubleclick() {
+ return new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ WizardUtils.nextPageOrFinish(ManageKeysPage.this);
+ }
+ };
+ }
+
private void refreshKeys() {
Job job = new AbstractCloudElementJob("Get keys", model.getCloud(), CLOUDELEMENT.KEYS) {
15 years, 2 months
JBoss Tools SVN: r28295 - in branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test: res/project/src/annotations and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2011-01-17 08:15:06 -0500 (Mon, 17 Jan 2011)
New Revision: 28295
Added:
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations.hibernate.cfg.xml
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/CVgeneric.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNames.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNamesId.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleId.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleInReferenceSystemProcess.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/PhysicalGeneGenericIdType.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceGeneProduct.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceOrganism.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferencePhysicalGene.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcess.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcessType.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsAnnotations.java
Modified:
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsJpa.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/TestProject.java
branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java
Log:
https://issues.jboss.org/browse/JBIDE-8112 - fixed
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/CVgeneric.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/CVgeneric.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/CVgeneric.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,147 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+@Entity
+@Table(name="CVgeneric")
+public class CVgeneric implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+ private CV_TYPE type;
+ private String category;
+ private CV_STATUS status;
+ private String term;
+ private String description;
+ private Long oboId;
+ private String oboNs;
+ private String oboPrefix;
+
+ public enum CV_TYPE {
+ processPhenotype,
+ pathogenPhenotype,
+ chemicalPhenotype,
+ dnastructurePhenotype,
+ genePhenotype,
+ geneproductPhenotype,
+ cmode,
+ processCharacterization,
+ organismCharacterization,
+ chemicalCharacterization,
+ dnastructureCharacterization,
+ geneCharacterization,
+ geneproductCharacterization,
+ modeOfAction,
+ experimentalConditions,
+ biologicalProcess,
+ comparativeValue,
+ disease,
+ hostPhenotype
+ }
+
+ public enum CV_STATUS {
+ accepted,proposed,toRefine
+ }
+
+ public CVgeneric() { }
+
+ @Id
+ @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="type", nullable=false)
+ @Enumerated(EnumType.STRING)
+ public CV_TYPE getType() {
+ return type;
+ }
+
+ public void setType(CV_TYPE type) {
+ this.type = type;
+ }
+
+ @Column(name="Category", length=45)
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ @Column(name="status", nullable=false)
+ @Enumerated(EnumType.STRING)
+ public CV_STATUS getStatus() {
+ return status;
+ }
+
+ public void setStatus(CV_STATUS status) {
+ this.status = status;
+ }
+
+ @Column(name="term", length=255, nullable=false)
+ public String getTerm() {
+ return term;
+ }
+
+ public void setTerm(String term) {
+ this.term = term;
+ }
+
+ @Column(name="Description")
+ @Type(type="text")
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Column(name="oboID", precision=11)
+ public Long getOboId() {
+ return oboId;
+ }
+
+ public void setOboId(Long oboId) {
+ this.oboId = oboId;
+ }
+
+ @Column(name="oboNS", length=255)
+ public String getOboNs() {
+ return oboNs;
+ }
+
+ public void setOboNs(String oboNs) {
+ this.oboNs = oboNs;
+ }
+
+ @Column(name="oboPrefix", length=10)
+ public String getOboPrefix() {
+ return oboPrefix;
+ }
+
+ public void setOboPrefix(String oboPrefix) {
+ this.oboPrefix = oboPrefix;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNames.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNames.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNames.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,65 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Column;
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+
+@Entity
+@Table(name="GeneNames")
+public class GeneNames implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private GeneNamesId id;
+ private ReferencePhysicalGene referenceGene;
+ private boolean pragmaDisplay;
+
+ public GeneNames() { }
+
+ @EmbeddedId
+ @AttributeOverrides({
+ @AttributeOverride(name="referenceGeneId", column = @Column(name="referenceGeneID", nullable=false)),
+ @AttributeOverride(name="name", column= @Column(name="name", nullable=false, length=255))
+ })
+ public GeneNamesId getId() {
+ return id;
+ }
+
+ public void setId(GeneNamesId id) {
+ this.id = id;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="referenceGeneID", nullable=false, updatable=false, insertable=false)
+ public ReferencePhysicalGene getReferenceGene() {
+ return referenceGene;
+ }
+
+ public void setReferenceGene(ReferencePhysicalGene referenceGene) {
+ this.referenceGene = referenceGene;
+ }
+
+ @Column(name="pragmaDisplay", nullable=false)
+ public boolean isPragmaDisplay() {
+ return pragmaDisplay;
+ }
+
+
+ public void setPragmaDisplay(boolean pragmaDisplay) {
+ this.pragmaDisplay = pragmaDisplay;
+ }
+
+
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNamesId.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNamesId.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNamesId.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,68 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Embeddable;
+
+@Embeddable
+public class GeneNamesId implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private String name;
+ private Long referenceGeneId;
+
+ public GeneNamesId() { }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getReferenceGeneId() {
+ return referenceGeneId;
+ }
+
+ public void setReferenceGeneId(Long referenceGeneId) {
+ this.referenceGeneId = referenceGeneId;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ GeneNamesId other = (GeneNamesId) obj;
+
+ if (obj == null)
+ return false;
+ // check if tested object is the same class as the original one
+ if (obj.getClass() != GeneNamesId.class)
+ return false;
+
+ // check nulls
+ if (this.getName() == null | this.getReferenceGeneId() == null)
+ return false;
+ if (other.getName() == null | other.getReferenceGeneId() == null)
+ return false;
+
+ // compare values
+ if (this.getName().equals(other.getName()) & other.getName().equals(this.getName()))
+ return true;
+ if (this.getReferenceGeneId().equals(other.getReferenceGeneId()) & other.getReferenceGeneId().equals(this.getReferenceGeneId()))
+ return true;
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+
+ int hash = this.name.hashCode();
+ hash ^= 41*hash+this.referenceGeneId.hashCode();
+
+ return hash;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleId.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleId.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleId.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,91 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Embeddable;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+
+import annotations.database.schema.OrganismRoleInReferenceSystemProcess.ROLE_TYPE;
+
+@Embeddable
+public class OrganismRoleId implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Long referenceOrganismId;
+ private Long referenceSystemProcessId;
+ private ROLE_TYPE roleType;
+
+ public OrganismRoleId() { }
+
+ public Long getReferenceOrganismId() {
+ return referenceOrganismId;
+ }
+
+ public void setReferenceOrganismId(Long referenceOrganismId) {
+ this.referenceOrganismId = referenceOrganismId;
+ }
+
+ public Long getReferenceSystemProcessId() {
+ return referenceSystemProcessId;
+ }
+
+ public void setReferenceSystemProcessId(Long referenceSystemProcessId) {
+ this.referenceSystemProcessId = referenceSystemProcessId;
+ }
+
+ @Enumerated(EnumType.STRING)
+ public ROLE_TYPE getRoleType() {
+ return roleType;
+ }
+
+ public void setRoleType(ROLE_TYPE roleType) {
+ this.roleType = roleType;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+
+ if (obj==null)
+ return false;
+
+ // check if tested object is the same class as the original one
+ if (obj.getClass() != OrganismRoleId.class)
+ return false;
+
+ OrganismRoleId tested = (OrganismRoleId) obj;
+ // check nulls
+ if (this.referenceOrganismId == null | this.referenceSystemProcessId == null | this.roleType == null)
+ return false;
+ if (tested.getReferenceOrganismId() == null |
+ tested.getReferenceSystemProcessId() == null |
+ tested.getRoleType() == null)
+ return false;
+
+ // check values
+ if (this.referenceOrganismId.equals(tested.getReferenceOrganismId()) &
+ tested.getReferenceOrganismId().equals(this.referenceOrganismId))
+ return true;
+ if (this.referenceSystemProcessId.equals(tested.getReferenceSystemProcessId()) &
+ tested.getReferenceSystemProcessId().equals(this.referenceSystemProcessId))
+ return true;
+ if (this.roleType.equals(tested.getRoleType()) & tested.getRoleType().equals(this.roleType))
+ return true;
+
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+
+ int hash = referenceOrganismId.hashCode();
+ hash ^= 41*hash+referenceSystemProcessId.hashCode();
+ hash ^= 41*hash+roleType.hashCode();
+
+ return hash;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleInReferenceSystemProcess.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleInReferenceSystemProcess.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleInReferenceSystemProcess.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,97 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Column;
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+@Entity
+@Table(name="OrganismRoleInReferenceSystemProcess")
+public class OrganismRoleInReferenceSystemProcess implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private OrganismRoleId id;
+ private ROLE_TYPE roleType;
+ private String description;
+ private ReferenceOrganism referenceOrganism;
+ private ReferenceSystemProcess referenecSystemProcess;
+
+ public enum ROLE_TYPE {
+ host,
+ pathogen,
+ participant
+ }
+
+ public OrganismRoleInReferenceSystemProcess() { }
+
+ @EmbeddedId
+ @AttributeOverrides({
+ @AttributeOverride(name="referenceOrganism", column=@Column(name="referenceOrganism", nullable=false)),
+ @AttributeOverride(name="referenceSystemProcess", column=@Column(name="referenceSystemProcess", nullable=false)),
+ @AttributeOverride(name="roleType", column=@Column(name="roleType", nullable=false))
+ })
+ public OrganismRoleId getId() {
+ return id;
+ }
+
+
+ public void setId(OrganismRoleId id) {
+ this.id = id;
+ }
+
+ @Column(name="roleType", nullable=false, updatable=false, insertable=false)
+ @Enumerated(EnumType.STRING)
+ public ROLE_TYPE getRoleType() {
+ return roleType;
+ }
+
+ public void setRoleType(ROLE_TYPE roleType) {
+ this.roleType = roleType;
+ }
+
+ @Column(name="description")
+ @Type(type="text")
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="referenceOrganism", nullable=false, updatable=false, insertable=false)
+ public ReferenceOrganism getReferenceOrganism() {
+ return referenceOrganism;
+ }
+
+ public void setReferenceOrganism(ReferenceOrganism referenceOrganism) {
+ this.referenceOrganism = referenceOrganism;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="referenceSystemProcess", nullable=false, updatable=false, insertable=false)
+ public ReferenceSystemProcess getReferenecSystemProcess() {
+ return referenecSystemProcess;
+ }
+
+ public void setReferenecSystemProcess(
+ ReferenceSystemProcess referenecSystemProcess) {
+ this.referenecSystemProcess = referenecSystemProcess;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/PhysicalGeneGenericIdType.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/PhysicalGeneGenericIdType.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/PhysicalGeneGenericIdType.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,57 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="PhysicalGeneGenericIDType")
+public class PhysicalGeneGenericIdType implements Serializable {
+
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private long id;
+ private String name;
+ private String description;
+
+ public PhysicalGeneGenericIdType() { }
+
+
+ @Id
+ @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+
+ @Column(name="name", nullable=false, length=45)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Column(name="description", length=45)
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceGeneProduct.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceGeneProduct.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceGeneProduct.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,85 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+@Entity
+@Table(name="ReferenceGeneProduct")
+public class ReferenceGeneProduct implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Long id;
+ private String UniprotId;
+ private String AASequence;
+ private PRODUCT_TYPE type;
+ private Set<ReferencePhysicalGene> referenceGene;
+
+ public enum PRODUCT_TYPE {
+ protein
+ };
+
+ public ReferenceGeneProduct() { }
+
+ @Id @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="UniprotID", nullable=true, unique=true, length=20)
+ public String getUniprotId() {
+ return UniprotId;
+ }
+
+ public void setUniprotId(String uniprotId) {
+ UniprotId = uniprotId;
+ }
+
+ @Column(name="amminoacidSequence")
+ @Type(type="text")
+ public String getAASequence() {
+ return AASequence;
+ }
+
+ public void setAASequence(String aASequence) {
+ AASequence = aASequence;
+ }
+
+ @Enumerated(EnumType.STRING)
+ @Column(name="type")
+ public PRODUCT_TYPE getType() {
+ return type;
+ }
+
+ public void setType(PRODUCT_TYPE type) {
+ this.type = type;
+ }
+
+ @ManyToMany(fetch=FetchType.LAZY, mappedBy="geneProducts")
+ public Set<ReferencePhysicalGene> getReferenceGene() {
+ return referenceGene;
+ }
+
+ public void setReferenceGene(Set<ReferencePhysicalGene> referenceGene) {
+ this.referenceGene = referenceGene;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceOrganism.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceOrganism.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceOrganism.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,118 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Index;
+
+@Entity
+@Table(name="ReferenceOrganism")
+public class ReferenceOrganism implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+ private Long ncbiId;
+ private COTILEDON_TYPE cotiledonType;
+ private String systematicName;
+ private String commonName;
+ private String tempName;
+ private String strain;
+ private Set<ReferencePhysicalGene> referenceGenes;
+
+ public enum COTILEDON_TYPE {
+ monocotiledon,
+ dicotiledon
+ }
+
+ public ReferenceOrganism() { }
+
+ @Id
+ @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="NCBI_Taxonomy_ID", nullable=false, unique=true, precision=11)
+ @Index(name = "nvbiTax")
+ public Long getNcbiId() {
+ return ncbiId;
+ }
+
+ public void setNcbiId(Long ncbiId) {
+ this.ncbiId = ncbiId;
+ }
+
+ @Column(name="cotiledonType")
+ @Enumerated(EnumType.STRING)
+ public COTILEDON_TYPE getCotiledonType() {
+ return cotiledonType;
+ }
+
+ public void setCotiledonType(COTILEDON_TYPE cotiledonType) {
+ this.cotiledonType = cotiledonType;
+ }
+
+ @Column(name="systematicName", length=255)
+ public String getSystematicName() {
+ return systematicName;
+ }
+
+ public void setSystematicName(String systematicName) {
+ this.systematicName = systematicName;
+ }
+
+ @Column(name="commonName", length=255)
+ public String getCommonName() {
+ return commonName;
+ }
+
+ public void setCommonName(String commonName) {
+ this.commonName = commonName;
+ }
+
+ @Column(name="tempName", nullable=false, length=255)
+ public String getTempName() {
+ return tempName;
+ }
+
+ public void setTempName(String tempName) {
+ this.tempName = tempName;
+ }
+
+ @Column(name="strain", length=255)
+ public String getStrain() {
+ return strain;
+ }
+
+ public void setStrain(String strain) {
+ this.strain = strain;
+ }
+
+ @OneToMany(mappedBy="referenceOrganism", fetch=FetchType.LAZY)
+ public Set<ReferencePhysicalGene> getReferenceGenes() {
+ return referenceGenes;
+ }
+
+ public void setReferenceGenes(Set<ReferencePhysicalGene> refGenes) {
+ this.referenceGenes = refGenes;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferencePhysicalGene.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferencePhysicalGene.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferencePhysicalGene.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,122 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+
+
+
+@Entity
+@Table(name="ReferencePhysicalGene")
+public class ReferencePhysicalGene implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+ private String genericId;
+ private PhysicalGeneGenericIdType idType;
+ private String nucleotideSequence;
+ private ReferenceOrganism referenceOrganism;
+ private String tempGeneName;
+ private Set<GeneNames> geneNames;
+ private Set<ReferenceGeneProduct> geneProducts;
+
+ public ReferencePhysicalGene() { }
+
+ @Id @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="GenericID", length=255)
+ public String getGenericId() {
+ return genericId;
+ }
+
+ public void setGenericId(String genericId) {
+ this.genericId = genericId;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="IDType", nullable=false, updatable=false, insertable=false)
+ public PhysicalGeneGenericIdType getIdType() {
+ return idType;
+ }
+
+ public void setIdType(PhysicalGeneGenericIdType idType) {
+ this.idType = idType;
+ }
+
+ @Type(type="text")
+ @Column(name="nucleotideSequence")
+ public String getNucleotideSequence() {
+ return nucleotideSequence;
+ }
+
+ public void setNucleotideSequence(String nucleotideSequence) {
+ this.nucleotideSequence = nucleotideSequence;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @JoinColumn(name="referenceOrganismID", nullable=false)
+ public ReferenceOrganism getReferenceOrganism() {
+ return referenceOrganism;
+ }
+
+ public void setReferenceOrganism(ReferenceOrganism referenceOrganism) {
+ this.referenceOrganism = referenceOrganism;
+ }
+
+ @Column(name="tempGeneName", nullable=false, length=50)
+ public String getTempGeneName() {
+ return tempGeneName;
+ }
+ public void setTempGeneName(String tempGeneName) {
+ this.tempGeneName = tempGeneName;
+ }
+
+ @OneToMany(fetch=FetchType.LAZY, mappedBy="referenceGene")
+ public Set<GeneNames> getGeneNames() {
+ return geneNames;
+ }
+
+ public void setGeneNames(Set<GeneNames> geneNames) {
+ this.geneNames = geneNames;
+ }
+
+ @ManyToMany(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @JoinTable(name="ReferencePhysicalGeneEncodesReferenceGeneProduct",
+ joinColumns= @JoinColumn(name="referenceGeneID", referencedColumnName="ID"),
+ inverseJoinColumns= @JoinColumn(name="referenceGeneProductID", referencedColumnName="ID")
+ )
+ public Set<ReferenceGeneProduct> getGeneProducts() {
+ return geneProducts;
+ }
+
+ public void setGeneProducts(Set<ReferenceGeneProduct> geneProducts) {
+ this.geneProducts = geneProducts;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcess.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcess.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcess.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,78 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+@Entity
+@Table(name="ReferenceSystemProcess")
+public class ReferenceSystemProcess implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Long id;
+ private String name;
+ private ReferenceSystemProcessType type;
+ private String description;
+ private Long tempToVerify;
+
+ public ReferenceSystemProcess() { }
+
+ @Id @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="name", length=255)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Column(name="type")
+ @Enumerated(EnumType.STRING)
+ public ReferenceSystemProcessType getType() {
+ return type;
+ }
+
+ public void setType(ReferenceSystemProcessType type) {
+ this.type = type;
+ }
+
+ @Type(type="text")
+ @Column(name="description")
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Column(name="tempToVerify", precision=11)
+ public Long getTempToVerify() {
+ return tempToVerify;
+ }
+
+ public void setTempToVerify(Long tempToVerify) {
+ this.tempToVerify = tempToVerify;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcessType.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcessType.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcessType.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,42 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+@SuppressWarnings("unused")
+public class ReferenceSystemProcessType implements Serializable {
+
+ /**
+ * host-pathogen,host-pathogen-disease,host-pathogen-disease-chemical,host-pathogen-chemical,pathogen-disease
+ */
+ private static final long serialVersionUID = 1L;
+
+ private static final Map<String, ReferenceSystemProcessType> types =
+ new HashMap<String, ReferenceSystemProcessType>(0);
+
+ /**
+ * Create list of all cases according the column type:
+ * enum('host-pathogen','host-pathogen-disease','host-pathogen-disease-chemical','host-pathogen-chemical','pathogen-disease')
+ */
+ private static final ReferenceSystemProcessType host_pathogen = new ReferenceSystemProcessType("host-pathogen");
+ private static final ReferenceSystemProcessType host_pathogen_disease = new ReferenceSystemProcessType("host-pathogen-disease");
+ private static final ReferenceSystemProcessType host_pathogen_disease_chemical = new ReferenceSystemProcessType("host-pathogen-disease-chemical");
+ private static final ReferenceSystemProcessType host_pathogen_chemical = new ReferenceSystemProcessType("host-pathogen-chemical");
+ private static final ReferenceSystemProcessType pathogen_disease = new ReferenceSystemProcessType("pathogen-disease");
+
+ private String name;
+
+ public ReferenceSystemProcessType(String name) {
+ this.name = name;
+ ReferenceSystemProcessType.types.put(name, this);
+ }
+
+ public static ReferenceSystemProcessType valueOf(String name) {
+ return types.get(name);
+ }
+
+ public String toString() {
+ return name;
+ }
+}
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations.hibernate.cfg.xml
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations.hibernate.cfg.xml (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations.hibernate.cfg.xml 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+ <mapping class="annotations.database.schema.GeneNames"/>
+ <mapping class="annotations.database.schema.GeneNamesId"/>
+ <mapping class="annotations.database.schema.PhysicalGeneGenericIdType"/>
+ <mapping class="annotations.database.schema.ReferenceOrganism"/>
+ <mapping class="annotations.database.schema.ReferencePhysicalGene"/>
+ <mapping class="annotations.database.schema.ReferenceSystemProcess"/>
+ <mapping class="annotations.database.schema.ReferenceGeneProduct"/>
+ <mapping class="annotations.database.schema.CVgeneric"/>
+ <mapping class="annotations.database.schema.OrganismRoleId"/>
+ <mapping class="annotations.database.schema.OrganismRoleInReferenceSystemProcess"/>
+ <mapping class="annotations.database.schema.OrganismRoleInReferenceSystemProcess$ROLE_TYPE"/>
+ </session-factory>
+</hibernate-configuration>
Modified: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2011-01-17 13:14:51 UTC (rev 28294)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -5,6 +5,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.hibernate.eclipse.console.test.mappingproject.MappingTestsAnnotations;
import org.hibernate.eclipse.console.test.mappingproject.MappingTestsCore;
import org.hibernate.eclipse.console.test.mappingproject.MappingTestsJpa;
import org.hibernate.eclipse.console.views.test.QueryPageViewerTest;
@@ -30,6 +31,7 @@
suite.addTestSuite(MappingTestsCore.class);
suite.addTestSuite(MappingTestsJpa.class);
+ suite.addTestSuite(MappingTestsAnnotations.class);
suite.addTestSuite(HQLEditorPreferencePageTest.class);
suite.addTestSuite(QueryPageViewerTest.class);
Added: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsAnnotations.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsAnnotations.java (rev 0)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsAnnotations.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.project.ConfigurableTestProject;
+import org.hibernate.eclipse.console.test.project.TestProject;
+import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
+
+/**
+ *
+ * @author vitali
+ */
+public class MappingTestsAnnotations extends MappingTestsBase {
+
+ public MappingTestsAnnotations(String name) {
+ super(name);
+ }
+
+ protected void setUpConsoleConfig() throws Exception {
+ createCfgXml();
+ final String projName = testProject.getIProject().getName();
+ ConsoleConfigUtils.createAnnotationsConsoleConfig(consoleConfigName,
+ projName, File.separator + projName + File.separator + annotationsMarkerCfgXml);
+ }
+
+ static final String annotationsMarkerStr = TestProject.SRC_FOLDER + File.separator + "annotations"; //$NON-NLS-1$
+
+ public static final FileFilter filterFoldersAnnotations = new FileFilter() {
+ public boolean accept(File f) {
+ return f.exists() && f.isDirectory() && !f.isHidden() &&
+ (f.getAbsolutePath().toLowerCase().contains(annotationsMarkerStr));
+ }
+ };
+
+ static final String annotationsMarkerCfgXml = TestProject.SRC_FOLDER + File.separator + ConsoleConfigUtils.CFG_FILE_NAME;
+ static final String annotationsMarkerAnnotationsCfgXml = TestProject.SRC_FOLDER + File.separator + "annotations.hibernate.cfg.xml"; //$NON-NLS-1$
+
+ public static final FileFilter filterFilesJavaXmlPlus = new FileFilter() {
+ public boolean accept(File f) {
+ return f.exists() && f.isFile() && !f.isHidden() &&
+ ((f.getName().toLowerCase().endsWith(".java") || f.getName().toLowerCase().endsWith(".xml")) && //$NON-NLS-1$ //$NON-NLS-2$
+ !(f.getAbsolutePath().toLowerCase().contains(annotationsMarkerCfgXml)) &&
+ !(f.getAbsolutePath().toLowerCase().contains(annotationsMarkerAnnotationsCfgXml)));
+ }
+ };
+
+ public void testEachPackWithTestSet() throws CoreException, IOException {
+ long start_time = System.currentTimeMillis();
+ boolean createListRes = testProject.createTestFoldersList(
+ filterFilesJavaXmlPlus, filterFoldersAnnotations);
+ assertTrue(createListRes);
+ boolean useSelRes = testProject.useSelectedFolders();
+ assertTrue(useSelRes);
+ testProject.restartTestFolders();
+ executions = 0;
+ allTestsRunForProject();
+ if (Customization.USE_CONSOLE_OUTPUT) {
+ System.out.println("====================================================="); //$NON-NLS-1$
+ System.out.print(result.errorCount() + ConsoleTestMessages.HibernateAllMappingTests_errors + " \t"); //$NON-NLS-1$
+ System.out.print(result.failureCount() + ConsoleTestMessages.HibernateAllMappingTests_fails + "\t"); //$NON-NLS-1$
+ System.out.print((System.currentTimeMillis() - start_time) / 1000 + ConsoleTestMessages.HibernateAllMappingTests_seconds + "\t" ); //$NON-NLS-1$
+ System.out.println(executions + ConsoleTestMessages.HibernateAllMappingTests_packages_tested );
+ }
+ }
+
+ protected void customizeCfgXml(IPackageFragment pack) {
+ // do not customize cfg hml
+ createCfgXml();
+ }
+
+ protected void createCfgXml() {
+ File fileHibernateCfgXml = null;
+ try {
+ fileHibernateCfgXml = TestProject.getFolder(ConfigurableTestProject.RESOURCE_SRC_PATH +
+ File.separator + "annotations.hibernate.cfg.xml"); //$NON-NLS-1$
+ } catch (IOException e) {
+ // ignore
+ }
+ if (fileHibernateCfgXml == null) {
+ return;
+ }
+ FileInputStream fis = null;
+ BufferedInputStream bis = null;
+ try {
+ fis = new FileInputStream(fileHibernateCfgXml);
+ bis = new BufferedInputStream(fis);
+ //
+ IFolder srcFolder = (IFolder) testProject.createSourceFolder().getResource();
+ IFile iFile = srcFolder.getFile(ConsoleConfigUtils.CFG_FILE_NAME);
+ if (iFile.exists()) {
+ iFile.delete(true, null);
+ }
+ iFile.create(bis, true, null);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ } finally {
+ if (bis != null) {
+ try {
+ bis.close();
+ } catch (IOException e) {}
+ }
+ if (fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {}
+ }
+ }
+ }
+}
Modified: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsJpa.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsJpa.java 2011-01-17 13:14:51 UTC (rev 28294)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsJpa.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -46,13 +46,15 @@
}
};
- static final String jpaMarkerCfgXml = TestProject.SRC_FOLDER + File.separator + "hibernate.cfg.xml"; //$NON-NLS-1$
+ static final String jpaMarkerCfgXml = TestProject.SRC_FOLDER + File.separator + ConsoleConfigUtils.CFG_FILE_NAME;
+ static final String jpaMarkerAnnotationsCfgXml = TestProject.SRC_FOLDER + File.separator + "annotations.hibernate.cfg.xml"; //$NON-NLS-1$
public static final FileFilter filterFilesJavaXmlPlus = new FileFilter() {
public boolean accept(File f) {
return f.exists() && f.isFile() && !f.isHidden() &&
((f.getName().toLowerCase().endsWith(".java") || f.getName().toLowerCase().endsWith(".xml")) && //$NON-NLS-1$ //$NON-NLS-2$
- !(f.getAbsolutePath().toLowerCase().contains(jpaMarkerCfgXml)));
+ !(f.getAbsolutePath().toLowerCase().contains(jpaMarkerCfgXml)) &&
+ !(f.getAbsolutePath().toLowerCase().contains(jpaMarkerAnnotationsCfgXml)));
}
};
Modified: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java 2011-01-17 13:14:51 UTC (rev 28294)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -84,7 +84,7 @@
public IPackageFragment getCurrentPackage() throws JavaModelException{
if (activePackage < foldersList.size()) {
- final String pack = foldersList.get(activePackage).replaceAll("\\\\", ".");
+ final String pack = foldersList.get(activePackage).replaceAll("\\\\", "."); //$NON-NLS-1$ //$NON-NLS-2$
IPackageFragment[] packageFragments = javaProject.getPackageFragments();
for (IPackageFragment iPackageFragment : packageFragments) {
if (iPackageFragment.getKind() == IPackageFragmentRoot.K_SOURCE
Modified: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/TestProject.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/TestProject.java 2011-01-17 13:14:51 UTC (rev 28294)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/TestProject.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -210,7 +210,7 @@
javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[0]), null);
}
- protected File getFolder(String path) throws IOException {
+ static public File getFolder(String path) throws IOException {
URL entry = HibernateConsoleTestPlugin.getDefault().getBundle().getEntry(path);
URL resProject = FileLocator.resolve(entry);
String resolvePath = FileLocator.resolve(resProject).getFile();
Modified: branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java
===================================================================
--- branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java 2011-01-17 13:14:51 UTC (rev 28294)
+++ branches/jbosstools-3.2.0.CR1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java 2011-01-17 13:15:06 UTC (rev 28295)
@@ -180,6 +180,49 @@
}
/**
+ * "Launch" the wizard and create hibernate annotations console configuration in the current workspace.
+ * @param name - console configuration name
+ * @param cfgFilePath - path to hibernate.cfg.xml
+ * @param project - name of java project selected for console configuration
+ * @throws CoreException
+ * @throws NoSuchFieldException
+ * @throws IllegalAccessException
+ */
+ public static void createAnnotationsConsoleConfig(String name, String project, String cfgFilePath) throws CoreException, NoSuchFieldException, IllegalAccessException {
+ final IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ final ConsoleConfigurationCreationWizard wiz = new ConsoleConfigurationCreationWizard();
+ final WizardDialog wdialog = new WizardDialog(win.getShell(), wiz);
+ wdialog.create();
+ ConsoleConfigurationWizardPage page = ((ConsoleConfigurationWizardPage)wiz.getPages()[0]);
+ ILaunchConfigurationTab[] tabs = page.getTabs();
+ ConsoleConfigurationMainTab main = (ConsoleConfigurationMainTab) tabs[0];
+ Class<? extends ConsoleConfigurationMainTab> clazz = main.getClass();
+ //
+ Field projectName = clazz.getDeclaredField("projectNameText"); //$NON-NLS-1$
+ projectName.setAccessible(true);
+ Text text = (Text)projectName.get(main);
+ text.setText(project);
+ //
+ Field configurationFile = clazz.getDeclaredField("configurationFileText"); //$NON-NLS-1$
+ configurationFile.setAccessible(true);
+ text = (Text)configurationFile.get(main);
+ text.setText(cfgFilePath);
+ //
+ Field annotationsMode = clazz.getDeclaredField("annotationsMode"); //$NON-NLS-1$
+ Field coreMode = clazz.getDeclaredField("coreMode"); //$NON-NLS-1$
+ annotationsMode.setAccessible(true);
+ coreMode.setAccessible(true);
+ Button button = (Button)coreMode.get(main);
+ button.setSelection(false);
+ button = (Button)annotationsMode.get(main);
+ button.setSelection(true);
+ //
+ page.setName(name);
+ page.performFinish();
+ wdialog.close();
+ }
+
+ /**
* Delete console configuration with given name.
* @param name
*/
15 years, 2 months
JBoss Tools SVN: r28294 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test: res/project/src/annotations and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2011-01-17 08:14:51 -0500 (Mon, 17 Jan 2011)
New Revision: 28294
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations.hibernate.cfg.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/CVgeneric.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNames.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNamesId.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleId.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleInReferenceSystemProcess.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/PhysicalGeneGenericIdType.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceGeneProduct.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceOrganism.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferencePhysicalGene.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcess.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcessType.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsAnnotations.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsJpa.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/TestProject.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java
Log:
https://issues.jboss.org/browse/JBIDE-8112 - fixed
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/CVgeneric.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/CVgeneric.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/CVgeneric.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,147 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+@Entity
+@Table(name="CVgeneric")
+public class CVgeneric implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+ private CV_TYPE type;
+ private String category;
+ private CV_STATUS status;
+ private String term;
+ private String description;
+ private Long oboId;
+ private String oboNs;
+ private String oboPrefix;
+
+ public enum CV_TYPE {
+ processPhenotype,
+ pathogenPhenotype,
+ chemicalPhenotype,
+ dnastructurePhenotype,
+ genePhenotype,
+ geneproductPhenotype,
+ cmode,
+ processCharacterization,
+ organismCharacterization,
+ chemicalCharacterization,
+ dnastructureCharacterization,
+ geneCharacterization,
+ geneproductCharacterization,
+ modeOfAction,
+ experimentalConditions,
+ biologicalProcess,
+ comparativeValue,
+ disease,
+ hostPhenotype
+ }
+
+ public enum CV_STATUS {
+ accepted,proposed,toRefine
+ }
+
+ public CVgeneric() { }
+
+ @Id
+ @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="type", nullable=false)
+ @Enumerated(EnumType.STRING)
+ public CV_TYPE getType() {
+ return type;
+ }
+
+ public void setType(CV_TYPE type) {
+ this.type = type;
+ }
+
+ @Column(name="Category", length=45)
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ @Column(name="status", nullable=false)
+ @Enumerated(EnumType.STRING)
+ public CV_STATUS getStatus() {
+ return status;
+ }
+
+ public void setStatus(CV_STATUS status) {
+ this.status = status;
+ }
+
+ @Column(name="term", length=255, nullable=false)
+ public String getTerm() {
+ return term;
+ }
+
+ public void setTerm(String term) {
+ this.term = term;
+ }
+
+ @Column(name="Description")
+ @Type(type="text")
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Column(name="oboID", precision=11)
+ public Long getOboId() {
+ return oboId;
+ }
+
+ public void setOboId(Long oboId) {
+ this.oboId = oboId;
+ }
+
+ @Column(name="oboNS", length=255)
+ public String getOboNs() {
+ return oboNs;
+ }
+
+ public void setOboNs(String oboNs) {
+ this.oboNs = oboNs;
+ }
+
+ @Column(name="oboPrefix", length=10)
+ public String getOboPrefix() {
+ return oboPrefix;
+ }
+
+ public void setOboPrefix(String oboPrefix) {
+ this.oboPrefix = oboPrefix;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNames.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNames.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNames.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,65 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Column;
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+
+@Entity
+@Table(name="GeneNames")
+public class GeneNames implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private GeneNamesId id;
+ private ReferencePhysicalGene referenceGene;
+ private boolean pragmaDisplay;
+
+ public GeneNames() { }
+
+ @EmbeddedId
+ @AttributeOverrides({
+ @AttributeOverride(name="referenceGeneId", column = @Column(name="referenceGeneID", nullable=false)),
+ @AttributeOverride(name="name", column= @Column(name="name", nullable=false, length=255))
+ })
+ public GeneNamesId getId() {
+ return id;
+ }
+
+ public void setId(GeneNamesId id) {
+ this.id = id;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="referenceGeneID", nullable=false, updatable=false, insertable=false)
+ public ReferencePhysicalGene getReferenceGene() {
+ return referenceGene;
+ }
+
+ public void setReferenceGene(ReferencePhysicalGene referenceGene) {
+ this.referenceGene = referenceGene;
+ }
+
+ @Column(name="pragmaDisplay", nullable=false)
+ public boolean isPragmaDisplay() {
+ return pragmaDisplay;
+ }
+
+
+ public void setPragmaDisplay(boolean pragmaDisplay) {
+ this.pragmaDisplay = pragmaDisplay;
+ }
+
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNamesId.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNamesId.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/GeneNamesId.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,68 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Embeddable;
+
+@Embeddable
+public class GeneNamesId implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private String name;
+ private Long referenceGeneId;
+
+ public GeneNamesId() { }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Long getReferenceGeneId() {
+ return referenceGeneId;
+ }
+
+ public void setReferenceGeneId(Long referenceGeneId) {
+ this.referenceGeneId = referenceGeneId;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ GeneNamesId other = (GeneNamesId) obj;
+
+ if (obj == null)
+ return false;
+ // check if tested object is the same class as the original one
+ if (obj.getClass() != GeneNamesId.class)
+ return false;
+
+ // check nulls
+ if (this.getName() == null | this.getReferenceGeneId() == null)
+ return false;
+ if (other.getName() == null | other.getReferenceGeneId() == null)
+ return false;
+
+ // compare values
+ if (this.getName().equals(other.getName()) & other.getName().equals(this.getName()))
+ return true;
+ if (this.getReferenceGeneId().equals(other.getReferenceGeneId()) & other.getReferenceGeneId().equals(this.getReferenceGeneId()))
+ return true;
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+
+ int hash = this.name.hashCode();
+ hash ^= 41*hash+this.referenceGeneId.hashCode();
+
+ return hash;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleId.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleId.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleId.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,91 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Embeddable;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+
+import annotations.database.schema.OrganismRoleInReferenceSystemProcess.ROLE_TYPE;
+
+@Embeddable
+public class OrganismRoleId implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Long referenceOrganismId;
+ private Long referenceSystemProcessId;
+ private ROLE_TYPE roleType;
+
+ public OrganismRoleId() { }
+
+ public Long getReferenceOrganismId() {
+ return referenceOrganismId;
+ }
+
+ public void setReferenceOrganismId(Long referenceOrganismId) {
+ this.referenceOrganismId = referenceOrganismId;
+ }
+
+ public Long getReferenceSystemProcessId() {
+ return referenceSystemProcessId;
+ }
+
+ public void setReferenceSystemProcessId(Long referenceSystemProcessId) {
+ this.referenceSystemProcessId = referenceSystemProcessId;
+ }
+
+ @Enumerated(EnumType.STRING)
+ public ROLE_TYPE getRoleType() {
+ return roleType;
+ }
+
+ public void setRoleType(ROLE_TYPE roleType) {
+ this.roleType = roleType;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+
+ if (obj==null)
+ return false;
+
+ // check if tested object is the same class as the original one
+ if (obj.getClass() != OrganismRoleId.class)
+ return false;
+
+ OrganismRoleId tested = (OrganismRoleId) obj;
+ // check nulls
+ if (this.referenceOrganismId == null | this.referenceSystemProcessId == null | this.roleType == null)
+ return false;
+ if (tested.getReferenceOrganismId() == null |
+ tested.getReferenceSystemProcessId() == null |
+ tested.getRoleType() == null)
+ return false;
+
+ // check values
+ if (this.referenceOrganismId.equals(tested.getReferenceOrganismId()) &
+ tested.getReferenceOrganismId().equals(this.referenceOrganismId))
+ return true;
+ if (this.referenceSystemProcessId.equals(tested.getReferenceSystemProcessId()) &
+ tested.getReferenceSystemProcessId().equals(this.referenceSystemProcessId))
+ return true;
+ if (this.roleType.equals(tested.getRoleType()) & tested.getRoleType().equals(this.roleType))
+ return true;
+
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+
+ int hash = referenceOrganismId.hashCode();
+ hash ^= 41*hash+referenceSystemProcessId.hashCode();
+ hash ^= 41*hash+roleType.hashCode();
+
+ return hash;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleInReferenceSystemProcess.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleInReferenceSystemProcess.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/OrganismRoleInReferenceSystemProcess.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,97 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+import javax.persistence.Column;
+import javax.persistence.EmbeddedId;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+@Entity
+@Table(name="OrganismRoleInReferenceSystemProcess")
+public class OrganismRoleInReferenceSystemProcess implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private OrganismRoleId id;
+ private ROLE_TYPE roleType;
+ private String description;
+ private ReferenceOrganism referenceOrganism;
+ private ReferenceSystemProcess referenecSystemProcess;
+
+ public enum ROLE_TYPE {
+ host,
+ pathogen,
+ participant
+ }
+
+ public OrganismRoleInReferenceSystemProcess() { }
+
+ @EmbeddedId
+ @AttributeOverrides({
+ @AttributeOverride(name="referenceOrganism", column=@Column(name="referenceOrganism", nullable=false)),
+ @AttributeOverride(name="referenceSystemProcess", column=@Column(name="referenceSystemProcess", nullable=false)),
+ @AttributeOverride(name="roleType", column=@Column(name="roleType", nullable=false))
+ })
+ public OrganismRoleId getId() {
+ return id;
+ }
+
+
+ public void setId(OrganismRoleId id) {
+ this.id = id;
+ }
+
+ @Column(name="roleType", nullable=false, updatable=false, insertable=false)
+ @Enumerated(EnumType.STRING)
+ public ROLE_TYPE getRoleType() {
+ return roleType;
+ }
+
+ public void setRoleType(ROLE_TYPE roleType) {
+ this.roleType = roleType;
+ }
+
+ @Column(name="description")
+ @Type(type="text")
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="referenceOrganism", nullable=false, updatable=false, insertable=false)
+ public ReferenceOrganism getReferenceOrganism() {
+ return referenceOrganism;
+ }
+
+ public void setReferenceOrganism(ReferenceOrganism referenceOrganism) {
+ this.referenceOrganism = referenceOrganism;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="referenceSystemProcess", nullable=false, updatable=false, insertable=false)
+ public ReferenceSystemProcess getReferenecSystemProcess() {
+ return referenecSystemProcess;
+ }
+
+ public void setReferenecSystemProcess(
+ ReferenceSystemProcess referenecSystemProcess) {
+ this.referenecSystemProcess = referenecSystemProcess;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/PhysicalGeneGenericIdType.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/PhysicalGeneGenericIdType.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/PhysicalGeneGenericIdType.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,57 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="PhysicalGeneGenericIDType")
+public class PhysicalGeneGenericIdType implements Serializable {
+
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private long id;
+ private String name;
+ private String description;
+
+ public PhysicalGeneGenericIdType() { }
+
+
+ @Id
+ @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+
+ @Column(name="name", nullable=false, length=45)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Column(name="description", length=45)
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceGeneProduct.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceGeneProduct.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceGeneProduct.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,85 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+@Entity
+@Table(name="ReferenceGeneProduct")
+public class ReferenceGeneProduct implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Long id;
+ private String UniprotId;
+ private String AASequence;
+ private PRODUCT_TYPE type;
+ private Set<ReferencePhysicalGene> referenceGene;
+
+ public enum PRODUCT_TYPE {
+ protein
+ };
+
+ public ReferenceGeneProduct() { }
+
+ @Id @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="UniprotID", nullable=true, unique=true, length=20)
+ public String getUniprotId() {
+ return UniprotId;
+ }
+
+ public void setUniprotId(String uniprotId) {
+ UniprotId = uniprotId;
+ }
+
+ @Column(name="amminoacidSequence")
+ @Type(type="text")
+ public String getAASequence() {
+ return AASequence;
+ }
+
+ public void setAASequence(String aASequence) {
+ AASequence = aASequence;
+ }
+
+ @Enumerated(EnumType.STRING)
+ @Column(name="type")
+ public PRODUCT_TYPE getType() {
+ return type;
+ }
+
+ public void setType(PRODUCT_TYPE type) {
+ this.type = type;
+ }
+
+ @ManyToMany(fetch=FetchType.LAZY, mappedBy="geneProducts")
+ public Set<ReferencePhysicalGene> getReferenceGene() {
+ return referenceGene;
+ }
+
+ public void setReferenceGene(Set<ReferencePhysicalGene> referenceGene) {
+ this.referenceGene = referenceGene;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceOrganism.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceOrganism.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceOrganism.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,118 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Index;
+
+@Entity
+@Table(name="ReferenceOrganism")
+public class ReferenceOrganism implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+ private Long ncbiId;
+ private COTILEDON_TYPE cotiledonType;
+ private String systematicName;
+ private String commonName;
+ private String tempName;
+ private String strain;
+ private Set<ReferencePhysicalGene> referenceGenes;
+
+ public enum COTILEDON_TYPE {
+ monocotiledon,
+ dicotiledon
+ }
+
+ public ReferenceOrganism() { }
+
+ @Id
+ @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="NCBI_Taxonomy_ID", nullable=false, unique=true, precision=11)
+ @Index(name = "nvbiTax")
+ public Long getNcbiId() {
+ return ncbiId;
+ }
+
+ public void setNcbiId(Long ncbiId) {
+ this.ncbiId = ncbiId;
+ }
+
+ @Column(name="cotiledonType")
+ @Enumerated(EnumType.STRING)
+ public COTILEDON_TYPE getCotiledonType() {
+ return cotiledonType;
+ }
+
+ public void setCotiledonType(COTILEDON_TYPE cotiledonType) {
+ this.cotiledonType = cotiledonType;
+ }
+
+ @Column(name="systematicName", length=255)
+ public String getSystematicName() {
+ return systematicName;
+ }
+
+ public void setSystematicName(String systematicName) {
+ this.systematicName = systematicName;
+ }
+
+ @Column(name="commonName", length=255)
+ public String getCommonName() {
+ return commonName;
+ }
+
+ public void setCommonName(String commonName) {
+ this.commonName = commonName;
+ }
+
+ @Column(name="tempName", nullable=false, length=255)
+ public String getTempName() {
+ return tempName;
+ }
+
+ public void setTempName(String tempName) {
+ this.tempName = tempName;
+ }
+
+ @Column(name="strain", length=255)
+ public String getStrain() {
+ return strain;
+ }
+
+ public void setStrain(String strain) {
+ this.strain = strain;
+ }
+
+ @OneToMany(mappedBy="referenceOrganism", fetch=FetchType.LAZY)
+ public Set<ReferencePhysicalGene> getReferenceGenes() {
+ return referenceGenes;
+ }
+
+ public void setReferenceGenes(Set<ReferencePhysicalGene> refGenes) {
+ this.referenceGenes = refGenes;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferencePhysicalGene.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferencePhysicalGene.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferencePhysicalGene.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,122 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+
+
+
+@Entity
+@Table(name="ReferencePhysicalGene")
+public class ReferencePhysicalGene implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+ private String genericId;
+ private PhysicalGeneGenericIdType idType;
+ private String nucleotideSequence;
+ private ReferenceOrganism referenceOrganism;
+ private String tempGeneName;
+ private Set<GeneNames> geneNames;
+ private Set<ReferenceGeneProduct> geneProducts;
+
+ public ReferencePhysicalGene() { }
+
+ @Id @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="GenericID", length=255)
+ public String getGenericId() {
+ return genericId;
+ }
+
+ public void setGenericId(String genericId) {
+ this.genericId = genericId;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="IDType", nullable=false, updatable=false, insertable=false)
+ public PhysicalGeneGenericIdType getIdType() {
+ return idType;
+ }
+
+ public void setIdType(PhysicalGeneGenericIdType idType) {
+ this.idType = idType;
+ }
+
+ @Type(type="text")
+ @Column(name="nucleotideSequence")
+ public String getNucleotideSequence() {
+ return nucleotideSequence;
+ }
+
+ public void setNucleotideSequence(String nucleotideSequence) {
+ this.nucleotideSequence = nucleotideSequence;
+ }
+
+ @ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @JoinColumn(name="referenceOrganismID", nullable=false)
+ public ReferenceOrganism getReferenceOrganism() {
+ return referenceOrganism;
+ }
+
+ public void setReferenceOrganism(ReferenceOrganism referenceOrganism) {
+ this.referenceOrganism = referenceOrganism;
+ }
+
+ @Column(name="tempGeneName", nullable=false, length=50)
+ public String getTempGeneName() {
+ return tempGeneName;
+ }
+ public void setTempGeneName(String tempGeneName) {
+ this.tempGeneName = tempGeneName;
+ }
+
+ @OneToMany(fetch=FetchType.LAZY, mappedBy="referenceGene")
+ public Set<GeneNames> getGeneNames() {
+ return geneNames;
+ }
+
+ public void setGeneNames(Set<GeneNames> geneNames) {
+ this.geneNames = geneNames;
+ }
+
+ @ManyToMany(fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @JoinTable(name="ReferencePhysicalGeneEncodesReferenceGeneProduct",
+ joinColumns= @JoinColumn(name="referenceGeneID", referencedColumnName="ID"),
+ inverseJoinColumns= @JoinColumn(name="referenceGeneProductID", referencedColumnName="ID")
+ )
+ public Set<ReferenceGeneProduct> getGeneProducts() {
+ return geneProducts;
+ }
+
+ public void setGeneProducts(Set<ReferenceGeneProduct> geneProducts) {
+ this.geneProducts = geneProducts;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcess.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcess.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcess.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,78 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Type;
+
+@Entity
+@Table(name="ReferenceSystemProcess")
+public class ReferenceSystemProcess implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Long id;
+ private String name;
+ private ReferenceSystemProcessType type;
+ private String description;
+ private Long tempToVerify;
+
+ public ReferenceSystemProcess() { }
+
+ @Id @GeneratedValue
+ @Column(name="ID", nullable=false, unique=true, precision=11)
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name="name", length=255)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Column(name="type")
+ @Enumerated(EnumType.STRING)
+ public ReferenceSystemProcessType getType() {
+ return type;
+ }
+
+ public void setType(ReferenceSystemProcessType type) {
+ this.type = type;
+ }
+
+ @Type(type="text")
+ @Column(name="description")
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Column(name="tempToVerify", precision=11)
+ public Long getTempToVerify() {
+ return tempToVerify;
+ }
+
+ public void setTempToVerify(Long tempToVerify) {
+ this.tempToVerify = tempToVerify;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcessType.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcessType.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations/database/schema/ReferenceSystemProcessType.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,42 @@
+package annotations.database.schema;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+@SuppressWarnings("unused")
+public class ReferenceSystemProcessType implements Serializable {
+
+ /**
+ * host-pathogen,host-pathogen-disease,host-pathogen-disease-chemical,host-pathogen-chemical,pathogen-disease
+ */
+ private static final long serialVersionUID = 1L;
+
+ private static final Map<String, ReferenceSystemProcessType> types =
+ new HashMap<String, ReferenceSystemProcessType>(0);
+
+ /**
+ * Create list of all cases according the column type:
+ * enum('host-pathogen','host-pathogen-disease','host-pathogen-disease-chemical','host-pathogen-chemical','pathogen-disease')
+ */
+ private static final ReferenceSystemProcessType host_pathogen = new ReferenceSystemProcessType("host-pathogen");
+ private static final ReferenceSystemProcessType host_pathogen_disease = new ReferenceSystemProcessType("host-pathogen-disease");
+ private static final ReferenceSystemProcessType host_pathogen_disease_chemical = new ReferenceSystemProcessType("host-pathogen-disease-chemical");
+ private static final ReferenceSystemProcessType host_pathogen_chemical = new ReferenceSystemProcessType("host-pathogen-chemical");
+ private static final ReferenceSystemProcessType pathogen_disease = new ReferenceSystemProcessType("pathogen-disease");
+
+ private String name;
+
+ public ReferenceSystemProcessType(String name) {
+ this.name = name;
+ ReferenceSystemProcessType.types.put(name, this);
+ }
+
+ public static ReferenceSystemProcessType valueOf(String name) {
+ return types.get(name);
+ }
+
+ public String toString() {
+ return name;
+ }
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations.hibernate.cfg.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations.hibernate.cfg.xml (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/annotations.hibernate.cfg.xml 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+ <mapping class="annotations.database.schema.GeneNames"/>
+ <mapping class="annotations.database.schema.GeneNamesId"/>
+ <mapping class="annotations.database.schema.PhysicalGeneGenericIdType"/>
+ <mapping class="annotations.database.schema.ReferenceOrganism"/>
+ <mapping class="annotations.database.schema.ReferencePhysicalGene"/>
+ <mapping class="annotations.database.schema.ReferenceSystemProcess"/>
+ <mapping class="annotations.database.schema.ReferenceGeneProduct"/>
+ <mapping class="annotations.database.schema.CVgeneric"/>
+ <mapping class="annotations.database.schema.OrganismRoleId"/>
+ <mapping class="annotations.database.schema.OrganismRoleInReferenceSystemProcess"/>
+ <mapping class="annotations.database.schema.OrganismRoleInReferenceSystemProcess$ROLE_TYPE"/>
+ </session-factory>
+</hibernate-configuration>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2011-01-17 12:52:20 UTC (rev 28293)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -5,6 +5,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.hibernate.eclipse.console.test.mappingproject.MappingTestsAnnotations;
import org.hibernate.eclipse.console.test.mappingproject.MappingTestsCore;
import org.hibernate.eclipse.console.test.mappingproject.MappingTestsJpa;
import org.hibernate.eclipse.console.views.test.QueryPageViewerTest;
@@ -30,6 +31,7 @@
suite.addTestSuite(MappingTestsCore.class);
suite.addTestSuite(MappingTestsJpa.class);
+ suite.addTestSuite(MappingTestsAnnotations.class);
suite.addTestSuite(HQLEditorPreferencePageTest.class);
suite.addTestSuite(QueryPageViewerTest.class);
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsAnnotations.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsAnnotations.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsAnnotations.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.hibernate.eclipse.console.test.ConsoleTestMessages;
+import org.hibernate.eclipse.console.test.project.ConfigurableTestProject;
+import org.hibernate.eclipse.console.test.project.TestProject;
+import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
+
+/**
+ *
+ * @author vitali
+ */
+public class MappingTestsAnnotations extends MappingTestsBase {
+
+ public MappingTestsAnnotations(String name) {
+ super(name);
+ }
+
+ protected void setUpConsoleConfig() throws Exception {
+ createCfgXml();
+ final String projName = testProject.getIProject().getName();
+ ConsoleConfigUtils.createAnnotationsConsoleConfig(consoleConfigName,
+ projName, File.separator + projName + File.separator + annotationsMarkerCfgXml);
+ }
+
+ static final String annotationsMarkerStr = TestProject.SRC_FOLDER + File.separator + "annotations"; //$NON-NLS-1$
+
+ public static final FileFilter filterFoldersAnnotations = new FileFilter() {
+ public boolean accept(File f) {
+ return f.exists() && f.isDirectory() && !f.isHidden() &&
+ (f.getAbsolutePath().toLowerCase().contains(annotationsMarkerStr));
+ }
+ };
+
+ static final String annotationsMarkerCfgXml = TestProject.SRC_FOLDER + File.separator + ConsoleConfigUtils.CFG_FILE_NAME;
+ static final String annotationsMarkerAnnotationsCfgXml = TestProject.SRC_FOLDER + File.separator + "annotations.hibernate.cfg.xml"; //$NON-NLS-1$
+
+ public static final FileFilter filterFilesJavaXmlPlus = new FileFilter() {
+ public boolean accept(File f) {
+ return f.exists() && f.isFile() && !f.isHidden() &&
+ ((f.getName().toLowerCase().endsWith(".java") || f.getName().toLowerCase().endsWith(".xml")) && //$NON-NLS-1$ //$NON-NLS-2$
+ !(f.getAbsolutePath().toLowerCase().contains(annotationsMarkerCfgXml)) &&
+ !(f.getAbsolutePath().toLowerCase().contains(annotationsMarkerAnnotationsCfgXml)));
+ }
+ };
+
+ public void testEachPackWithTestSet() throws CoreException, IOException {
+ long start_time = System.currentTimeMillis();
+ boolean createListRes = testProject.createTestFoldersList(
+ filterFilesJavaXmlPlus, filterFoldersAnnotations);
+ assertTrue(createListRes);
+ boolean useSelRes = testProject.useSelectedFolders();
+ assertTrue(useSelRes);
+ testProject.restartTestFolders();
+ executions = 0;
+ allTestsRunForProject();
+ if (Customization.USE_CONSOLE_OUTPUT) {
+ System.out.println("====================================================="); //$NON-NLS-1$
+ System.out.print(result.errorCount() + ConsoleTestMessages.HibernateAllMappingTests_errors + " \t"); //$NON-NLS-1$
+ System.out.print(result.failureCount() + ConsoleTestMessages.HibernateAllMappingTests_fails + "\t"); //$NON-NLS-1$
+ System.out.print((System.currentTimeMillis() - start_time) / 1000 + ConsoleTestMessages.HibernateAllMappingTests_seconds + "\t" ); //$NON-NLS-1$
+ System.out.println(executions + ConsoleTestMessages.HibernateAllMappingTests_packages_tested );
+ }
+ }
+
+ protected void customizeCfgXml(IPackageFragment pack) {
+ // do not customize cfg hml
+ createCfgXml();
+ }
+
+ protected void createCfgXml() {
+ File fileHibernateCfgXml = null;
+ try {
+ fileHibernateCfgXml = TestProject.getFolder(ConfigurableTestProject.RESOURCE_SRC_PATH +
+ File.separator + "annotations.hibernate.cfg.xml"); //$NON-NLS-1$
+ } catch (IOException e) {
+ // ignore
+ }
+ if (fileHibernateCfgXml == null) {
+ return;
+ }
+ FileInputStream fis = null;
+ BufferedInputStream bis = null;
+ try {
+ fis = new FileInputStream(fileHibernateCfgXml);
+ bis = new BufferedInputStream(fis);
+ //
+ IFolder srcFolder = (IFolder) testProject.createSourceFolder().getResource();
+ IFile iFile = srcFolder.getFile(ConsoleConfigUtils.CFG_FILE_NAME);
+ if (iFile.exists()) {
+ iFile.delete(true, null);
+ }
+ iFile.create(bis, true, null);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ } finally {
+ if (bis != null) {
+ try {
+ bis.close();
+ } catch (IOException e) {}
+ }
+ if (fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {}
+ }
+ }
+ }
+}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsJpa.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsJpa.java 2011-01-17 12:52:20 UTC (rev 28293)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/MappingTestsJpa.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -46,13 +46,15 @@
}
};
- static final String jpaMarkerCfgXml = TestProject.SRC_FOLDER + File.separator + "hibernate.cfg.xml"; //$NON-NLS-1$
+ static final String jpaMarkerCfgXml = TestProject.SRC_FOLDER + File.separator + ConsoleConfigUtils.CFG_FILE_NAME;
+ static final String jpaMarkerAnnotationsCfgXml = TestProject.SRC_FOLDER + File.separator + "annotations.hibernate.cfg.xml"; //$NON-NLS-1$
public static final FileFilter filterFilesJavaXmlPlus = new FileFilter() {
public boolean accept(File f) {
return f.exists() && f.isFile() && !f.isHidden() &&
((f.getName().toLowerCase().endsWith(".java") || f.getName().toLowerCase().endsWith(".xml")) && //$NON-NLS-1$ //$NON-NLS-2$
- !(f.getAbsolutePath().toLowerCase().contains(jpaMarkerCfgXml)));
+ !(f.getAbsolutePath().toLowerCase().contains(jpaMarkerCfgXml)) &&
+ !(f.getAbsolutePath().toLowerCase().contains(jpaMarkerAnnotationsCfgXml)));
}
};
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java 2011-01-17 12:52:20 UTC (rev 28293)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/ConfigurableTestProject.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -84,7 +84,7 @@
public IPackageFragment getCurrentPackage() throws JavaModelException{
if (activePackage < foldersList.size()) {
- final String pack = foldersList.get(activePackage).replaceAll("\\\\", ".");
+ final String pack = foldersList.get(activePackage).replaceAll("\\\\", "."); //$NON-NLS-1$ //$NON-NLS-2$
IPackageFragment[] packageFragments = javaProject.getPackageFragments();
for (IPackageFragment iPackageFragment : packageFragments) {
if (iPackageFragment.getKind() == IPackageFragmentRoot.K_SOURCE
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/TestProject.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/TestProject.java 2011-01-17 12:52:20 UTC (rev 28293)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/project/TestProject.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -210,7 +210,7 @@
javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[0]), null);
}
- protected File getFolder(String path) throws IOException {
+ static public File getFolder(String path) throws IOException {
URL entry = HibernateConsoleTestPlugin.getDefault().getBundle().getEntry(path);
URL resProject = FileLocator.resolve(entry);
String resolvePath = FileLocator.resolve(resProject).getFile();
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java 2011-01-17 12:52:20 UTC (rev 28293)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/ConsoleConfigUtils.java 2011-01-17 13:14:51 UTC (rev 28294)
@@ -180,6 +180,49 @@
}
/**
+ * "Launch" the wizard and create hibernate annotations console configuration in the current workspace.
+ * @param name - console configuration name
+ * @param cfgFilePath - path to hibernate.cfg.xml
+ * @param project - name of java project selected for console configuration
+ * @throws CoreException
+ * @throws NoSuchFieldException
+ * @throws IllegalAccessException
+ */
+ public static void createAnnotationsConsoleConfig(String name, String project, String cfgFilePath) throws CoreException, NoSuchFieldException, IllegalAccessException {
+ final IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ final ConsoleConfigurationCreationWizard wiz = new ConsoleConfigurationCreationWizard();
+ final WizardDialog wdialog = new WizardDialog(win.getShell(), wiz);
+ wdialog.create();
+ ConsoleConfigurationWizardPage page = ((ConsoleConfigurationWizardPage)wiz.getPages()[0]);
+ ILaunchConfigurationTab[] tabs = page.getTabs();
+ ConsoleConfigurationMainTab main = (ConsoleConfigurationMainTab) tabs[0];
+ Class<? extends ConsoleConfigurationMainTab> clazz = main.getClass();
+ //
+ Field projectName = clazz.getDeclaredField("projectNameText"); //$NON-NLS-1$
+ projectName.setAccessible(true);
+ Text text = (Text)projectName.get(main);
+ text.setText(project);
+ //
+ Field configurationFile = clazz.getDeclaredField("configurationFileText"); //$NON-NLS-1$
+ configurationFile.setAccessible(true);
+ text = (Text)configurationFile.get(main);
+ text.setText(cfgFilePath);
+ //
+ Field annotationsMode = clazz.getDeclaredField("annotationsMode"); //$NON-NLS-1$
+ Field coreMode = clazz.getDeclaredField("coreMode"); //$NON-NLS-1$
+ annotationsMode.setAccessible(true);
+ coreMode.setAccessible(true);
+ Button button = (Button)coreMode.get(main);
+ button.setSelection(false);
+ button = (Button)annotationsMode.get(main);
+ button.setSelection(true);
+ //
+ page.setName(name);
+ page.performFinish();
+ wdialog.close();
+ }
+
+ /**
* Delete console configuration with given name.
* @param name
*/
15 years, 2 months