[jbosstools-commits] JBoss Tools SVN: r23382 - in trunk/hibernatetools/plugins: org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic and 5 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Jul 13 05:07:28 EDT 2010


Author: dgeraskov
Date: 2010-07-13 05:07:26 -0400 (Tue, 13 Jul 2010)
New Revision: 23382

Added:
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceUnitPropertiesBuilder.java
Modified:
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernatePersistenceUnitProperties.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceXmlContextNodeFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlContextNodeFactory.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlDefinition.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/plugin.xml
   trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpa2_0PlatformUiProvider.java
Log:
https://jira.jboss.org/browse/JBIDE-6473

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java	2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernatePersistenceUnit.java	2010-07-13 09:07:26 UTC (rev 23382)
@@ -31,7 +31,7 @@
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.BasicHibernateProperties;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
-import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceXmlContextNodeFactory;
+import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceUnitPropertiesBuilder;
 
 /**
  * @author Dmitry Geraskov
@@ -52,14 +52,10 @@
 	}
 	
 	@Override
-	public HibernatePersistenceXmlContextNodeFactory getContextNodeFactory() {
-		return (HibernatePersistenceXmlContextNodeFactory) super.getContextNodeFactory();
-	}
-	
-	@Override
 	protected void initializeProperties() {
 		super.initializeProperties();
-		this.hibernateProperties = this.getContextNodeFactory().buildHibernatePersistenceUnitProperties(this);
+		this.hibernateProperties = ((HibernatePersistenceUnitPropertiesBuilder)this.getContextNodeFactory())
+			.buildHibernatePersistenceUnitProperties(this);
 	}
 	
 	@Override

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernatePersistenceUnitProperties.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernatePersistenceUnitProperties.java	2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/HibernatePersistenceUnitProperties.java	2010-07-13 09:07:26 UTC (rev 23382)
@@ -82,21 +82,21 @@
 	}
 	
 	public void propertyRemoved(String propertyName) {
-		if (propertyName.equals(CONFIG_FILE_PROPERTY)) {
+		if (propertyName.equals(HIBERNATE_CONFIG_FILE)) {
 			this.configurationFileChanged(null);
-		} else if (propertyName.equals(DIALECT_PROPERTY)) {
+		} else if (propertyName.equals(HIBERNATE_DIALECT)) {
 			this.dialectChanged(null);
-		} else if (propertyName.equals(DRIVER_PROPERTY)) {
+		} else if (propertyName.equals(HIBERNATE_DRIVER)) {
 			this.driverChanged(null);
-		} else if (propertyName.equals(URL_PROPERTY)) {
+		} else if (propertyName.equals(HIBERNATE_URL)) {
 			this.urlChanged(null);
-		} else if (propertyName.equals(SCHEMA_DEFAULT_PROPERTY)) {
+		} else if (propertyName.equals(HIBERNATE_SCHEMA_DEFAULT)) {
 			this.schemaDefaultChanged(null);
-		} else if (propertyName.equals(CATALOG_DEFAULT_PROPERTY)) {
+		} else if (propertyName.equals(HIBERNATE_CATALOG)) {
 			this.catalogDefaultChanged(null);
-		} else if (propertyName.equals(USERNAME_PROPERTY)) {
+		} else if (propertyName.equals(HIBERNATE_USERNAME)) {
 			this.usernameChanged(null);
-		} else if (propertyName.equals(PASSWORD_PROPERTY)) {
+		} else if (propertyName.equals(HIBERNATE_PASSWORD)) {
 			this.passwordChanged(null);
 		}
 	}

Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceUnitPropertiesBuilder.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceUnitPropertiesBuilder.java	                        (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceUnitPropertiesBuilder.java	2010-07-13 09:07:26 UTC (rev 23382)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.jboss.tools.hibernate.jpt.core.internal.context.persistence;
+
+import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface HibernatePersistenceUnitPropertiesBuilder {
+	
+	public HibernatePersistenceUnitProperties buildHibernatePersistenceUnitProperties(PersistenceUnit parent);
+
+}

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceXmlContextNodeFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceXmlContextNodeFactory.java	2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernatePersistenceXmlContextNodeFactory.java	2010-07-13 09:07:26 UTC (rev 23382)
@@ -22,7 +22,7 @@
  *
  */
 public class HibernatePersistenceXmlContextNodeFactory extends
-		GenericPersistenceXmlContextNodeFactory {
+		GenericPersistenceXmlContextNodeFactory implements HibernatePersistenceUnitPropertiesBuilder {
 
 	public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
 		return new HibernatePersistenceUnit(parent, xmlPersistenceUnit);

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlContextNodeFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlContextNodeFactory.java	2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlContextNodeFactory.java	2010-07-13 09:07:26 UTC (rev 23382)
@@ -12,17 +12,18 @@
 
 import org.eclipse.jpt.core.context.persistence.Persistence;
 import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceXmlContextNodeFactory;
+import org.eclipse.jpt.core.internal.jpa2.context.persistence.Generic2_0PersistenceXmlContextNodeFactory;
 import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
 import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
 import org.jboss.tools.hibernate.jpt.core.internal.context.basic.HibernatePersistenceUnitProperties;
+import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceUnitPropertiesBuilder;
 
 /**
  * @author Dmitry Geraskov
  *
  */
 public class Hibernate2_0PersistenceXmlContextNodeFactory extends
-		GenericPersistenceXmlContextNodeFactory {
+		Generic2_0PersistenceXmlContextNodeFactory implements HibernatePersistenceUnitPropertiesBuilder {
 
 	public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
 		return new HibernatePersistenceUnit(parent, xmlPersistenceUnit);

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlDefinition.java	2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/jpa2/Hibernate2_0PersistenceXmlDefinition.java	2010-07-13 09:07:26 UTC (rev 23382)
@@ -56,7 +56,7 @@
 	}
 	
 	public JpaResourceType getResourceType() {
-		return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
+		return JptCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
 	}
 
 }

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java	2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java	2010-07-13 09:07:26 UTC (rev 23382)
@@ -36,7 +36,9 @@
 import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingDefinition;
 import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
 import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
+import org.jboss.tools.hibernate.jpt.core.internal.context.orm.HibernateOrmXmlDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.context.orm.jpa2.HibernateOrmXml2_0Definition;
+import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.HibernatePersistenceXmlDefinition;
 import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.jpa2.Hibernate2_0PersistenceXmlDefinition;
 
 /**
@@ -143,7 +145,9 @@
 	@Override
 	protected ResourceDefinition[] buildResourceDefinitions() {
 		return new ResourceDefinition[] {
+			HibernatePersistenceXmlDefinition.instance(),
 			Hibernate2_0PersistenceXmlDefinition.instance(),
+			HibernateOrmXmlDefinition.instance(),
 			HibernateOrmXml2_0Definition.instance()};
 	}
 	

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/plugin.xml	2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/plugin.xml	2010-07-13 09:07:26 UTC (rev 23382)
@@ -14,7 +14,7 @@
          id="org.jboss.tools.hibernate2_0.jpt"
          point="org.eclipse.jpt.ui.jpaPlatformUis">
       <jpaPlatformUi
-            factoryClass="org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernateJpaPlatformUiFactory"
+            factoryClass="org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernateJpa2_0PlatformUiFactory"
             jpaPlatform="hibernate2_0"
             id="hibernate2_0">
       </jpaPlatformUi>

Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpa2_0PlatformUiProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpa2_0PlatformUiProvider.java	2010-07-13 07:32:12 UTC (rev 23381)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/HibernateJpa2_0PlatformUiProvider.java	2010-07-13 09:07:26 UTC (rev 23382)
@@ -12,7 +12,6 @@
 
 import java.util.List;
 
-import org.eclipse.jpt.ui.JpaPlatformUi;
 import org.eclipse.jpt.ui.JpaPlatformUiProvider;
 import org.eclipse.jpt.ui.ResourceUiDefinition;
 import org.eclipse.jpt.ui.details.JpaDetailsProvider;
@@ -23,13 +22,11 @@
 import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
 import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
 import org.eclipse.jpt.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.ui.internal.platform.generic.GenericNavigatorProvider;
 import org.jboss.tools.hibernate.jpt.ui.internal.jpa2.mapping.details.orm.Hibernate2_0OrmXmlUiDefinition;
 import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.java.Hibernate2_0JavaResourceUiDefinition;
 import org.jboss.tools.hibernate.jpt.ui.internal.mapping.details.orm.HibernateOrmXmlUiDefinition;
 import org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.HibernatePersistenceXmlUiDefinition;
 import org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.jpa2.HibernatePersistenceXml2_0UiDefinition;
-import org.jboss.tools.hibernate.jpt.ui.internal.platform.HibernateJpaPlatformUi;
 
 /**
  * @author Dmitry Geraskov
@@ -55,11 +52,6 @@
 		super();
 	}
 
-	public JpaPlatformUi buildJpaPlatformUi() {
-		return new HibernateJpaPlatformUi(new GenericNavigatorProvider(),
-				HibernateJpa2_0PlatformUiProvider.instance());
-	}
-
 	// ********** details providers **********
 
 	@Override



More information about the jbosstools-commits mailing list