Author: dgeraskov
Date: 2009-08-06 06:32:46 -0400 (Thu, 06 Aug 2009)
New Revision: 16976
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4716
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-08-06
08:42:43 UTC (rev 16975)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-08-06
10:32:46 UTC (rev 16976)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal;
+import org.eclipse.jpt.core.context.java.JavaEmbeddable;
import org.eclipse.jpt.core.context.java.JavaEntity;
import org.eclipse.jpt.core.context.java.JavaIdMapping;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
@@ -22,6 +23,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.HibernateJavaEmbeddable;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntity;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntityImpl;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaIdMapping;
@@ -76,5 +78,9 @@
HibernateJavaEntity hibernateJavaEntity) {
return new JavaDiscriminatorFormulaImpl(hibernateJavaEntity);
}
+
+ public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent) {
+ return new HibernateJavaEmbeddable(parent);
+ }
}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java 2009-08-06
10:32:46 UTC (rev 16976)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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 org.eclipse.jpt.core.MappingKeys;
+import org.eclipse.jpt.core.context.java.JavaPersistentType;
+import org.eclipse.jpt.core.internal.context.java.AbstractJavaEmbeddable;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateJavaEmbeddable extends AbstractJavaEmbeddable
+{
+ public HibernateJavaEmbeddable(JavaPersistentType parent) {
+ super(parent);
+ }
+
+ @Override
+ public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
+ //hibernate allows basic, transient and many-to-one within an Embeddable
+ return attributeMappingKey == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY
+ || attributeMappingKey == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY
+ || attributeMappingKey == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
+ }
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native