Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-06-16 08:56:44 +0000
committerEike Stepper2008-06-16 08:56:44 +0000
commitb93a1cfec296dcafc0e37f2fe38f100ef6ef042c (patch)
treec4dbd05390596c7e790513dd754a95eae450e220
parent436df47a7a7656426b6adc0aa478fa8e9e8de601 (diff)
downloadcdo-b93a1cfec296dcafc0e37f2fe38f100ef6ef042c.tar.gz
cdo-b93a1cfec296dcafc0e37f2fe38f100ef6ef042c.tar.xz
cdo-b93a1cfec296dcafc0e37f2fe38f100ef6ef042c.zip
[234829] [Hibernate] Problem with containingClass of CDOFeatures
https://bugs.eclipse.org/bugs/show_bug.cgi?id=234829
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java103
2 files changed, 2 insertions, 109 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
index 080c30c4b4..b3f5b8a031 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
@@ -16,9 +16,9 @@ import org.eclipse.emf.cdo.common.model.CDOClassProxy;
import org.eclipse.emf.cdo.common.model.CDOFeature;
import org.eclipse.emf.cdo.common.model.CDOPackage;
import org.eclipse.emf.cdo.common.model.CDOPackageInfo;
-import org.eclipse.emf.cdo.internal.common.model.CDOClassImpl;
import org.eclipse.emf.cdo.server.IStoreWriter.CommitContext;
import org.eclipse.emf.cdo.server.internal.hibernate.bundle.OM;
+import org.eclipse.emf.cdo.spi.common.InternalCDOClass;
import org.eclipse.emf.cdo.spi.common.InternalCDOFeature;
import org.eclipse.emf.cdo.spi.common.InternalCDOPackage;
@@ -262,11 +262,7 @@ public class HibernatePackageHandler extends Lifecycle
for (CDOClass cdoClass : dbPackage.getClasses())
{
cdoClasses.add(cdoClass);
-
- // TODO: cast to CDOClassImpl is not to nice, getSuperTypeProxies should
- // be added to the interface of CDOClass or another way of setting the
- // packagemanager in the CDOClassProxy should be developed (how?)
- for (CDOClassProxy proxy : ((CDOClassImpl)cdoClass).getSuperTypeProxies())
+ for (CDOClassProxy proxy : ((InternalCDOClass)cdoClass).getSuperTypeProxies())
{
proxy.setCDOPackageManager(hibernateStore.getRepository().getPackageManager());
}
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java
deleted file mode 100644
index 2bfc5f78fa..0000000000
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDOFeatureReferenceTypePropertyHandler.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2005, 2006, 2007, 2008 Springsite BV (The Netherlands) and others
- * All rights reserved. This program and the accompanying materials
- * are 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
- *
- * Contributors:
- * Martin Taal
- * </copyright>
- *
- * $Id: CDOFeatureReferenceTypePropertyHandler.java,v 1.4 2008-06-15 20:32:15 mtaal Exp $
- */
-
-package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;
-
-import org.eclipse.emf.cdo.common.model.CDOClass;
-import org.eclipse.emf.cdo.common.model.CDOFeature;
-import org.eclipse.emf.cdo.common.model.CDOType;
-import org.eclipse.emf.cdo.internal.common.model.CDOFeatureImpl;
-import org.eclipse.emf.cdo.spi.common.InternalCDOFeature;
-
-import org.hibernate.HibernateException;
-import org.hibernate.PropertyNotFoundException;
-import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.engine.SessionImplementor;
-import org.hibernate.property.Getter;
-import org.hibernate.property.PropertyAccessor;
-import org.hibernate.property.Setter;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-/**
- * Is only used for synthetic id's.
- *
- * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.4 $
- */
-@SuppressWarnings("unchecked")
-public class CDOFeatureReferenceTypePropertyHandler implements Getter, Setter, PropertyAccessor
-{
- private static final long serialVersionUID = 1L;
-
- public CDOFeatureReferenceTypePropertyHandler()
- {
- }
-
- public Object get(Object owner) throws HibernateException
- {
- CDOFeature cdoFeature = (CDOFeature)owner;
- if (cdoFeature.getType() != CDOType.OBJECT)
- {
- return null;
- }
-
- // TODO: ugly cast
- return ((CDOFeatureImpl)cdoFeature).getReferenceTypeProxy();
- }
-
- public Object getForInsert(Object arg0, Map arg1, SessionImplementor arg2) throws HibernateException
- {
- return get(arg0);
- }
-
- public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException
- {
- InternalCDOFeature cdoFeature = (InternalCDOFeature)target;
- if (cdoFeature.getType() != CDOType.OBJECT)
- {
- return;
- }
-
- cdoFeature.setReferenceType((CDOClass)value);
- }
-
- public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException
- {
- return this;
- }
-
- public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException
- {
- return this;
- }
-
- public Method getMethod()
- {
- return null;
- }
-
- public String getMethodName()
- {
- return null;
- }
-
- public Class getReturnType()
- {
- return null;
- }
-}

Back to the top