persistence@glassfish.java.net

Re: Fixing issue #520

From: Tom Ware <tom.ware_at_oracle.com>
Date: Mon, 03 Apr 2006 09:09:05 -0400

HI Marina,

  It looks like we need to change the name of one of the Entities in our
testing.

oracle.toplink.essentials.testing.models.cmp3.xml.merge.incompletemappings.owning.Employee


and

oracle.toplink.essentials.testing.models.cmp3.xml.merge.advanced.Employee

Have the same name.

-Tom

Marina Vatkina wrote:

>Tom, Guy,
>
>If I fix this issue (see below for the proposed fix and attached changes), I
>get an error running unit tests:
>
>toplink.essentials.exceptions.ValidationException
> [junit] Exception Description: Entity name must be unique in a persistence
>unit. Entity name [XMLMergeEmployee] is used for the entity classes
>[oracle.toplink.essentials.testing.models.cmp3.xml.merge.incompletemappings.owning.Employee]
>and [oracle.toplink.essentials.testing.models.cmp3.xml.merge.advanced.Employee].
> [junit] at
>oracle.toplink.essentials.exceptions.ValidationException.nonUniqueEntityName(ValidationException.java:510)
>
>
>The exception seems to be correct, but I'm afraid I missed something...
>
>Please help!
>
>----------------
>The proposed fix (other than validation message itself) is this:
>
>Index:
>src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataProcessor.java
>===================================================================
>RCS file:
>/cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataProcessor.java,v
>retrieving revision 1.12
>diff -r1.12 MetadataProcessor.java
>33a34
> > import oracle.toplink.essentials.descriptors.ClassDescriptor;
>947a949,956
> > }
> >
> > // Verify that entity name is not a duplicate
> > ClassDescriptor d =
>m_session.getProject().getDescriptorForAlias(alias);
> > if (d != null) {
> > throw ValidationException.nonUniqueEntityName(
> > d.getJavaClassName(),
>md.getDescriptor().getJavaClassName(),
> > alias);
>
>thanks,
>-marina
>
>