Author: dgeraskov
Date: 2009-10-07 08:28:43 -0400 (Wed, 07 Oct 2009)
New Revision: 17954
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Generated.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/GenerationTime.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateNamedColumn.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GeneratedComposite.java
Removed:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateBaseColumn.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateColumn.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateDiscriminatorColumn.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateEntity.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateJoinColumn.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaColumnImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntity.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateBasicMappingComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateDiscriminatorColumnComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateUIMappingMessages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4665
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaAnnotationDefinitionProvider.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -20,6 +20,7 @@
import
org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueriesAnnotationDefinition;
import
org.jboss.tools.hibernate.jpt.core.internal.resource.java.HibernateNamedQueryAnnotationDefinition;
import
org.jboss.tools.hibernate.jpt.core.internal.resource.java.DiscriminatorFormulaAnnotationImpl.DiscriminatorFormulaAnnotationDefinition;
+import
org.jboss.tools.hibernate.jpt.core.internal.resource.java.GeneratedAnnotationImpl.GeneratedAnnotationDefinition;
import
org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotationImpl.GenericGeneratorAnnotationDefinition;
import
org.jboss.tools.hibernate.jpt.core.internal.resource.java.SourceGenericGeneratorsAnnotation.GenericGeneratorsAnnotationDefinition;
@@ -68,5 +69,6 @@
@Override
protected void
addAttributeSupportingAnnotationDefinitionsTo(List<AnnotationDefinition>
definitions) {
definitions.add(GenericGeneratorAnnotationDefinition.instance());
+ definitions.add(GeneratedAnnotationDefinition.instance());
}
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -13,6 +13,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jpt.core.JpaProject;
import org.eclipse.jpt.core.context.XmlContextNode;
+import org.eclipse.jpt.core.context.java.JavaBasicMapping;
import org.eclipse.jpt.core.context.java.JavaColumn;
import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
import org.eclipse.jpt.core.context.java.JavaEmbeddable;
@@ -60,6 +61,7 @@
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
+import
org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaBasicMappingImpl;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaColumnImpl;
import
org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaDiscriminatorColumnImpl;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEmbeddable;
@@ -206,6 +208,10 @@
return new HibernateJavaTableImpl(parent);
}
+ public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
+ return new HibernateJavaBasicMappingImpl(parent);
+ }
+
// ********** ORM Context Model **********
@Override
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Generated.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Generated.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Generated.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import org.eclipse.jpt.core.context.JpaContextNode;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface Generated extends JpaContextNode {
+
+ GenerationTime getGenerationTime();
+
+ void setGenerationTime(GenerationTime value);
+ String GENERATION_TIME_PROPERTY = "value"; //$NON-NLS-1$
+
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/Generated.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/GenerationTime.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/GenerationTime.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/GenerationTime.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ * Corresponds to the Hibernate enum
+ * org.hibernate.annotations.GenerationTime
+ *
+ * Provisional API: This interface is part of an interim API that is still under
+ * development and expected to change significantly before reaching stability.
+ * It is available at this early stage to solicit feedback from pioneering
+ * adopters on the understanding that any code that uses this API will almost
+ * certainly be broken (repeatedly) as the API evolves.
+ */
+public enum GenerationTime {
+
+ NEVER(Hibernate.GENERATION_TIME__NEVER),
+ INSERT(Hibernate.GENERATION_TIME__INSERT),
+ ALWAYS(Hibernate.GENERATION_TIME__ALWAYS);
+
+ private String javaAnnotationValue;
+
+ GenerationTime(String javaAnnotationValue) {
+ if (javaAnnotationValue == null) {
+ throw new NullPointerException();
+ }
+ this.javaAnnotationValue = javaAnnotationValue;
+ }
+
+ public String getJavaAnnotationValue() {
+ return this.javaAnnotationValue;
+ }
+
+ // ********** static methods **********
+
+ public static GenerationTime fromJavaAnnotationValue(Object javaAnnotationValue) {
+ return (javaAnnotationValue == null) ? null :
fromJavaAnnotationValue_(javaAnnotationValue);
+ }
+
+ private static GenerationTime fromJavaAnnotationValue_(Object javaAnnotationValue) {
+ for (GenerationTime generationTime : GenerationTime.values()) {
+ if (generationTime.getJavaAnnotationValue().equals(javaAnnotationValue)) {
+ return generationTime;
+ }
+ }
+ return null;
+ }
+
+ public static String toJavaAnnotationValue(GenerationTime generationTime) {
+ return (generationTime == null) ? null : generationTime.getJavaAnnotationValue();
+ }
+
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/GenerationTime.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Deleted:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateBaseColumn.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateBaseColumn.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateBaseColumn.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.hibernate.jpt.core.internal.context;
-
-import org.eclipse.jpt.core.context.BaseColumn;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public interface HibernateBaseColumn extends BaseColumn {
-
- String getDBColumnName();
-
- String getSpecifiedDBColumnName();
-
- String getDefaultDBColumnName();
-
-}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateColumn.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateColumn.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateColumn.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -16,13 +16,7 @@
* @author Dmitry Geraskov
*
*/
-public interface HibernateColumn extends Column {
-
- String getDBColumnName();
-
- String getSpecifiedDBColumnName();
-
- String getDefaultDBColumnName();
+public interface HibernateColumn extends Column, HibernateNamedColumn {
//**** Table ****
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateDiscriminatorColumn.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateDiscriminatorColumn.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateDiscriminatorColumn.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -17,12 +17,8 @@
* @author Dmitry Geraskov
*
*/
-public interface HibernateDiscriminatorColumn extends DiscriminatorColumn {
+public interface HibernateDiscriminatorColumn extends DiscriminatorColumn,
+HibernateNamedColumn {
- String getDBColumnName();
-
- String getSpecifiedDBColumnName();
-
- String getDefaultDBColumnName();
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateEntity.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateEntity.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateEntity.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -21,12 +21,6 @@
String DISCRIMINATOR_FORMULA_PROPERTY = "discriminatorFormula"; //$NON-NLS-1$
- DiscriminatorFormula getDiscriminatorFormula();
-
- DiscriminatorFormula addDiscriminatorFormula();
-
- void removeDiscriminatorFormula();
-
HibernateTable getTable();
//Column getPrimaryIdColumn();
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateJoinColumn.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateJoinColumn.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateJoinColumn.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -18,14 +18,8 @@
* @author Dmitry Geraskov
*
*/
-public interface HibernateJoinColumn extends JoinColumn {
+public interface HibernateJoinColumn extends JoinColumn, HibernateNamedColumn {
- String getDBColumnName();
-
- String getSpecifiedDBColumnName();
-
- String getDefaultDBColumnName();
-
//**** referenced column
String getReferencedDBColumnName();
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateNamedColumn.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateNamedColumn.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateNamedColumn.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.hibernate.jpt.core.internal.context;
+
+import org.eclipse.jpt.core.context.NamedColumn;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface HibernateNamedColumn extends NamedColumn {
+
+ String getDBColumnName();
+
+ String getSpecifiedDBColumnName();
+
+ String getDefaultDBColumnName();
+
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/HibernateNamedColumn.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+
+import java.util.Iterator;
+
+import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.core.internal.context.java.AbstractJavaBasicMapping;
+import org.eclipse.jpt.core.resource.java.JPA;
+import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
+import org.jboss.tools.hibernate.jpt.core.internal.context.Generated;
+import org.jboss.tools.hibernate.jpt.core.internal.context.GenerationTime;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GeneratedAnnotation;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateJavaBasicMappingImpl extends AbstractJavaBasicMapping
+implements Generated {
+
+ protected GenerationTime specifiedGenerationTime;
+
+ public HibernateJavaBasicMappingImpl(JavaPersistentAttribute parent) {
+ super(parent);
+ }
+
+ public Iterator<String> supportingAnnotationNames() {
+ return new ArrayIterator<String>(
+ JPA.COLUMN,
+ JPA.LOB,
+ JPA.TEMPORAL,
+ JPA.ENUMERATED,
+ Hibernate.GENERATED);
+ }
+
+ @Override
+ protected void initialize() {
+ super.initialize();
+ this.specifiedGenerationTime = this.getResourceGenerationTime();
+ }
+
+ public GeneratedAnnotation getResourceGenerated() {
+ return (GeneratedAnnotation)
getResourcePersistentAttribute().getSupportingAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
+ }
+
+ public GeneratedAnnotation addResourceGenerated() {
+ return (GeneratedAnnotation)
getResourcePersistentAttribute().addSupportingAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
+ }
+
+ public void removeResourceGenerated() {
+ getResourcePersistentAttribute().removeSupportingAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
+ }
+
+ protected GenerationTime getResourceGenerationTime(){
+ GeneratedAnnotation geneatedAnnotation = getResourceGenerated();
+ return geneatedAnnotation == null ? null : geneatedAnnotation.getValue();
+ }
+
+ public GenerationTime getGenerationTime() {
+ return this.specifiedGenerationTime;
+ }
+
+ public void setGenerationTime(GenerationTime newValue) {
+ GenerationTime oldValue = this.specifiedGenerationTime;
+ this.specifiedGenerationTime = newValue;
+ if (newValue != null){
+ GeneratedAnnotation annotation = getResourceGenerated() != null
+ ? getResourceGenerated()
+ : addResourceGenerated();
+ annotation.setValue(newValue);
+ } else {
+ removeResourceGenerated();
+ }
+ firePropertyChanged(Generated.GENERATION_TIME_PROPERTY, oldValue, newValue);
+ }
+
+ public void setGenerationTime_(GenerationTime newGenerationTime) {
+ GenerationTime oldValue = this.specifiedGenerationTime;
+ this.specifiedGenerationTime = newGenerationTime;
+ firePropertyChanged(Generated.GENERATION_TIME_PROPERTY, oldValue, newGenerationTime);
+ }
+
+ @Override
+ protected void update() {
+ super.update();
+ this.setGenerationTime_(this.getResourceGenerationTime());
+ }
+
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaBasicMappingImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaColumnImpl.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaColumnImpl.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaColumnImpl.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -13,6 +13,7 @@
import org.eclipse.jpt.core.context.java.JavaColumn;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
import org.eclipse.jpt.core.internal.context.java.GenericJavaColumn;
+import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
import org.eclipse.jpt.db.Column;
import org.eclipse.jpt.db.Table;
import org.eclipse.wst.validation.internal.core.Message;
@@ -28,7 +29,7 @@
*
*/
public class HibernateJavaColumnImpl extends GenericJavaColumn implements
HibernateJavaColumn {
-
+
public HibernateJavaColumnImpl(JavaJpaContextNode parent, JavaColumn.Owner owner) {
super(parent, owner);
}
@@ -37,6 +38,14 @@
public HibernateJpaProject getJpaProject() {
return (HibernateJpaProject) super.getJpaProject();
}
+
+ @Override
+ public void initialize(ColumnAnnotation column) {
+ super.initialize(column);
+ //this.initializGenerated();
+ }
+
+ //********* DB Column name ******************
@Override
public Column getDbColumn() {
@@ -82,6 +91,8 @@
}
return super.buildDefaultName();
}
+
+ //************ DB Table name ***********
public String getDBTableName() {
return getSpecifiedDBTableName() != null ? getSpecifiedDBTableName()
@@ -107,4 +118,31 @@
return this.getSpecifiedTable();
}
+ //********** Generated ************
+ /*private void initializGenerated() {
+ GeneratedAnnotation generatedResource = getGeneratedResource();
+ if (generatedResource != null) {
+ this.generated = buildGenerated(generatedResource);
+ }
+ }
+
+ public GeneratedAnnotation getGeneratedResource() {
+ return (GeneratedAnnotation)
this.javaResourcePersistentType.getSupportingAnnotation(GeneratedAnnotation.ANNOTATION_NAME);
+ }
+
+ public JavaGenerated addGenerated() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JavaGenerated getGenerated() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void removeGenerated() {
+ // TODO Auto-generated method stub
+
+ }*/
+
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEntity.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -22,6 +22,8 @@
JavaDiscriminatorFormula getDiscriminatorFormula();
JavaDiscriminatorFormula addDiscriminatorFormula();
+
+ void removeDiscriminatorFormula();
HibernateJavaTable getTable();
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntity.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntity.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntity.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -12,7 +12,6 @@
package org.jboss.tools.hibernate.jpt.core.internal.context.orm;
import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.jboss.tools.hibernate.jpt.core.internal.context.DiscriminatorFormula;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateEntity;
/**
@@ -21,9 +20,6 @@
*/
public interface HibernateOrmEntity extends HibernateEntity, OrmEntity {
- DiscriminatorFormula getDiscriminatorFormula();
-
- DiscriminatorFormula addDiscriminatorFormula();
-
HibernateOrmTable getTable();
+
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/orm/HibernateOrmEntityImpl.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -30,7 +30,6 @@
import org.hibernate.cfg.NamingStrategy;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
-import org.jboss.tools.hibernate.jpt.core.internal.context.DiscriminatorFormula;
import org.jboss.tools.hibernate.jpt.core.internal.context.GenericGenerator;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedQuery;
@@ -139,16 +138,6 @@
//******** TODO **********
- public DiscriminatorFormula addDiscriminatorFormula() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public DiscriminatorFormula getDiscriminatorFormula() {
- // TODO Auto-generated method stub
- return null;
- }
-
public void removeDiscriminatorFormula() {
// TODO Auto-generated method stub
}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.resource.java.Annotation;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.jboss.tools.hibernate.jpt.core.internal.context.GenerationTime;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public interface GeneratedAnnotation extends Annotation {
+ String ANNOTATION_NAME = Hibernate.GENERATED;
+
+ /**
+ * Corresponds to the 'value' element of the GeneratedAnnotation annotation.
+ * Return null if the element does not exist in the annotation
+ */
+ GenerationTime getValue();
+ String VALUE_PROPERTY = Hibernate.GENERATED__VALUE;
+
+ /**
+ * Corresponds to the 'value' element of the GeneratedAnnotation annotation.
+ * Setting to null will remove the element.
+ */
+ void setValue(GenerationTime value);
+
+ /**
+ * Return the {@link TextRange} for the 'value' element.
+ */
+ TextRange getValueTextRange(CompilationUnit astRoot);
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
+import
org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.ShortCircuitAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.resource.java.Annotation;
+import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
+import org.eclipse.jpt.core.utility.jdt.Attribute;
+import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
+import org.eclipse.jpt.core.utility.jdt.Member;
+import org.jboss.tools.hibernate.jpt.core.internal.context.GenerationTime;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class GeneratedAnnotationImpl extends SourceAnnotation<Attribute>
implements
+GeneratedAnnotation {
+
+ public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new
SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
+
+ private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER =
buildValueAdapter(DECLARATION_ANNOTATION_ADAPTER);
+ private final AnnotationElementAdapter<String> valueAdapter;
+ private GenerationTime value;
+
+ protected GeneratedAnnotationImpl(JavaResourceNode parent, Attribute attribute) {
+ super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
+ this.valueAdapter = this.buildAdapter(VALUE_ADAPTER);
+ }
+
+ public void initialize(CompilationUnit astRoot) {
+ this.value = this.buildValue(astRoot);
+ }
+
+ public void update(CompilationUnit astRoot) {
+ this.setValue(this.buildValue(astRoot));
+ }
+
+ // ***** value
+ public GenerationTime getValue() {
+ return value;
+ }
+
+ public void setValue(GenerationTime value) {
+ if (this.attributeValueHasNotChanged(this.value, value)) {
+ return;
+ }
+ GenerationTime old = this.value;
+ this.value = value;
+ this.valueAdapter.setValue(GenerationTime.toJavaAnnotationValue(value));
+ this.firePropertyChanged(VALUE_PROPERTY, old, value);
+ }
+
+ private GenerationTime buildValue(CompilationUnit astRoot) {
+ return GenerationTime.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
+ }
+
+ public TextRange getValueTextRange(CompilationUnit astRoot) {
+ return this.getElementTextRange(VALUE_ADAPTER, astRoot);
+ }
+
+ public String getAnnotationName() {
+ return ANNOTATION_NAME;
+ }
+
+ AnnotationElementAdapter<String>
buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
+ return new ShortCircuitAnnotationElementAdapter<String>(this.member, daea);
+ }
+
+ private static DeclarationAnnotationElementAdapter<String>
buildValueAdapter(DeclarationAnnotationAdapter adapter) {
+ return new EnumDeclarationAnnotationElementAdapter(adapter,
Hibernate.GENERATED__VALUE);
+ }
+
+ public static class GeneratedAnnotationDefinition implements AnnotationDefinition
+ {
+ // singleton
+ private static final GeneratedAnnotationDefinition INSTANCE = new
GeneratedAnnotationDefinition();
+
+ /**
+ * Return the singleton.
+ */
+ public static AnnotationDefinition instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure non-instantiability.
+ */
+ private GeneratedAnnotationDefinition() {
+ super();
+ }
+
+ public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member
attribute) {
+ return new GeneratedAnnotationImpl(parent, (Attribute) attribute);
+ }
+
+ public String getAnnotationName() {
+ return GeneratedAnnotation.ANNOTATION_NAME;
+ }
+
+ public Annotation buildAnnotation(JavaResourcePersistentMember arg0,
+ IAnnotation arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
+ throw new UnsupportedOperationException();
+ }
+
+ }
+
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GeneratedAnnotationImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GeneratedComposite.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GeneratedComposite.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GeneratedComposite.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.hibernate.jpt.ui.internal.mapping.details;
+
+import java.util.Collection;
+
+import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
+import org.eclipse.jpt.ui.internal.widgets.FormPane;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.hibernate.jpt.core.internal.context.Generated;
+import org.jboss.tools.hibernate.jpt.core.internal.context.GenerationTime;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class GeneratedComposite extends FormPane<Generated> {
+ /**
+ * Creates a new <code>GeneratedComposite</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param parent The parent container
+ */
+ public GeneratedComposite(FormPane<? extends Generated> parentPane,
+ Composite parent) {
+
+ super(parentPane, parent);
+ }
+
+ private EnumFormComboViewer<Generated, GenerationTime>
addGenerationTimeCombo(Composite container) {
+
+ return new EnumFormComboViewer<Generated, GenerationTime>(this, container) {
+
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(Generated.GENERATION_TIME_PROPERTY);
+ }
+
+ @Override
+ protected GenerationTime[] getChoices() {
+ return GenerationTime.values();
+ }
+
+ @Override
+ protected GenerationTime getDefaultValue() {
+ return null;
+ }
+
+ @Override
+ protected GenerationTime getValue() {
+ return getSubject().getGenerationTime();
+ }
+
+ @Override
+ protected void setValue(GenerationTime value) {
+ getSubject().setGenerationTime(value);
+ }
+
+ @Override
+ protected String displayString(GenerationTime value) {
+ return value == null ? null : value.toString();
+ }
+ };
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+
+ addLabeledComposite(
+ container,
+ HibernateUIMappingMessages.BasicGeneralSection_generated,
+ addGenerationTimeCombo(container),
+ null//TODO help
+ );
+ }
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/GeneratedComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAbstractInheritanceComposite.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -19,6 +19,7 @@
import org.eclipse.jpt.ui.internal.mappings.db.ColumnCombo;
import org.eclipse.jpt.ui.internal.mappings.details.AbstractEntityComposite;
import org.eclipse.jpt.ui.internal.mappings.details.AbstractInheritanceComposite;
+import org.eclipse.jpt.ui.internal.mappings.details.DiscriminatorColumnComposite;
import org.eclipse.jpt.ui.internal.util.ControlEnabler;
import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
import org.eclipse.jpt.ui.internal.widgets.FormPane;
@@ -32,6 +33,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateEntity;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntity;
/**
* Here the layout of this pane:
@@ -103,6 +105,7 @@
super(parentPane, parent, false);
}
+ @SuppressWarnings("unchecked")
@Override
protected void initializeLayout(Composite container) {
@@ -141,7 +144,12 @@
new ControlEnabler(buildDiscriminatorValueEnabledHolder(), discriminatorValueCombo,
discriminatorValueLabel);
- new HibernateDiscriminatorColumnComposite<HibernateEntity>(this, container);
+ if (getSubject() instanceof HibernateJavaEntity) {
+ new HibernateDiscriminatorColumnComposite((FormPane<? extends
HibernateJavaEntity>) this, container);
+ } else {
+ new DiscriminatorColumnComposite<Entity>(this, container);
+ }
+
// Primary Key Join Columns widgets
addPrimaryKeyJoinColumnsComposite(addSubPane(container, 5));
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateBasicMappingComposite.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateBasicMappingComposite.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateBasicMappingComposite.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -33,6 +33,7 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.hibernate.jpt.core.internal.context.Generated;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateColumn;
/**
@@ -106,6 +107,7 @@
initializeTypePane(container);
}
+ @SuppressWarnings("unchecked")
private void initializeGeneralPane(Composite container) {
int groupBoxMargin = getGroupBoxMargin();
@@ -114,6 +116,10 @@
// Align the widgets under the ColumnComposite
container = addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
+ if (getSubject() instanceof Generated) {
+ new GeneratedComposite((FormPane<? extends Generated>) this, container);
+ }
+
new FetchTypeComposite(this, container);
new OptionalComposite(this, addSubPane(container, 4));
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateDiscriminatorColumnComposite.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateDiscriminatorColumnComposite.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateDiscriminatorColumnComposite.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -38,7 +38,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Spinner;
import org.jboss.tools.hibernate.jpt.core.internal.context.DiscriminatorFormula;
-import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateEntity;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntity;
import org.jboss.tools.hibernate.jpt.ui.internal.mappings.db.xpl.ColumnCombo;
/**
@@ -74,7 +74,7 @@
* @version 2.0
* @since 2.0
*/
-public class HibernateDiscriminatorColumnComposite <T extends HibernateEntity>
extends FormPane<T> {
+public class HibernateDiscriminatorColumnComposite extends
FormPane<HibernateJavaEntity> {
private WritablePropertyValueModel<DiscriminatorFormula>
discriminatorFormulaHolder;
@@ -84,7 +84,7 @@
* @param parentPane The parent container of this one
* @param parent The parent container
*/
- public HibernateDiscriminatorColumnComposite(FormPane<? extends T> parentPane,
+ public HibernateDiscriminatorColumnComposite(FormPane<? extends
HibernateJavaEntity> parentPane,
Composite parent) {
super(parentPane, parent, false);
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateUIMappingMessages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateUIMappingMessages.java 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateUIMappingMessages.java 2009-10-07
12:28:43 UTC (rev 17954)
@@ -44,6 +44,7 @@
public static String HibernateIdMappingComposite_genericGeneratorSection;
public static String HibernateIdMappingComposite_genericGeneratorCheckBox;
public static String HibernateDiscriminatorColumnComposite_formula;
+ public static String BasicGeneralSection_generated;
private HibernateUIMappingMessages() {}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/messages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/messages.properties 2009-10-07
11:21:00 UTC (rev 17953)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/messages.properties 2009-10-07
12:28:43 UTC (rev 17954)
@@ -21,4 +21,5 @@
NameStateObject_nameAlreadyExists=The name already exists.
HibernateIdMappingComposite_genericGeneratorSection=Generic Generator
HibernateIdMappingComposite_genericGeneratorCheckBox=Generic generator
-HibernateDiscriminatorColumnComposite_formula=Formula:
\ No newline at end of file
+HibernateDiscriminatorColumnComposite_formula=Formula:
+BasicGeneralSection_generated = Generation Time:
\ No newline at end of file