diff options
author | nhauge | 2011-11-09 18:56:26 +0000 |
---|---|---|
committer | nhauge | 2011-11-09 18:56:26 +0000 |
commit | cf785105b9127a56e628ad0db37a17edd0b9e836 (patch) | |
tree | 6f4d8585b8da9d0da9afc6efc00fe27aea1c2950 | |
parent | e2ed977d8426b2f0d5a0d1814c5b226d300ff8bb (diff) | |
download | webtools.dali-cf785105b9127a56e628ad0db37a17edd0b9e836.tar.gz webtools.dali-cf785105b9127a56e628ad0db37a17edd0b9e836.tar.xz webtools.dali-cf785105b9127a56e628ad0db37a17edd0b9e836.zip |
This change restores compatibility for adopters who were using JpaPersistencecUnit and need their code to run on both Dali 3.0 and 3.1. This is a short term fix which will be undone for Juno.
2 files changed, 47 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpql/JpaManagedTypeProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpql/JpaManagedTypeProvider.java index 2a8aedd8a2..d332d82d54 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpql/JpaManagedTypeProvider.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpql/JpaManagedTypeProvider.java @@ -46,7 +46,10 @@ import org.eclipse.persistence.jpa.jpql.spi.IType; * @since 3.0 * @author Pascal Filion */ -public final class JpaManagedTypeProvider implements IManagedTypeProvider { + +//TODO This class has been altered to provide compatibility to Dali 3.0. These changes should be removed in Dali 3.2 stream. +//class should be final and persistenceTypes() method should be removed. +public class JpaManagedTypeProvider implements IManagedTypeProvider { /** * The filtered collection of managed types that are the abstract schema types. @@ -249,7 +252,9 @@ public final class JpaManagedTypeProvider implements IManagedTypeProvider { * * @return The managed types that are defined only in the provider */ -// abstract Iterable<? extends PersistentType> persistenceTypes(); + Iterable<? extends PersistentType> persistenceTypes(){ + return this.persistentTypeContainer.getPersistentTypes(); + } private static class EntityCollector implements IManagedTypeVisitor { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpql/JpaPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpql/JpaPersistenceUnit.java new file mode 100644 index 0000000000..61bde80b3c --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpql/JpaPersistenceUnit.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2011 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Oracle - initial API and implementation + * + ******************************************************************************/ +package org.eclipse.jpt.jpa.core.internal.jpql; + +import org.eclipse.jpt.jpa.core.JpaProject; +import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit; + +/** + * This class was removed and then added back as a stub to provide compatibility with Dali 3.0. + * It is a legacy class that should be removed in 3.2 stream for Juno. + * The concrete implementation that is wrapping the design-time representation of a persistence unit. + * + * @version 3.0 + * @since 3.0 + * @author Pascal Filion + */ +public final class JpaPersistenceUnit extends JpaManagedTypeProvider { + + /** + * Creates a new <code>JpaPersistenceUnit</code>. + * + * @param jpaProject The project that gives access to the application's metadata + * @param persistentUnit The design-time persistence unit + */ + public JpaPersistenceUnit(JpaProject jpaProject, PersistenceUnit persistentUnit) { + super(jpaProject, persistentUnit); + } + +}
\ No newline at end of file |