Community
Participate
Working Groups
I have a specific use case with the new eclipselink multitenant support, but this is a general problem in the 3.1 release. 1. Create a JPA 2.0 project with the EclipseLInik 2.3.x platform. 2. Create an entity: @Entity @TenantDiscriminatorColumns(@TenantDiscriminatorColumn(name="TENANT_ID")) public class Foo { @Id int id; } 3. Validate and you will see the warning "Tenant discriminator columns cannot be specified without the Multitenant annotation" 4. Remove the outer annotation @TenantDiscriminatorColumns and save and validate again. The warning does not appear again and if you look in the error log you will see an exception: java.lang.IllegalArgumentException: Null text range for message ID: MULTIENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS at org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages.buildMessage(DefaultEclipseLinkJpaValidationMessages.java:48) at org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.context.java.JavaEclipseLinkMultitenancyImpl.validate(JavaEclipseLinkMultitenancyImpl.java:394) Our resource model is still holding on to the TenantDiscriminatorColumns annotation object even though it has been removed. That is the underlying cause of this particular exception. This could cause other difficult to diagnose problems as well. If you clean the project, the validation message appears correctly.
Another container annotation issue was found by Nan in bug 357941. Will address this in this bug. If you have a java 1-1 mapping with a JoinTable on it and try to change the mapping type in the JPA structure or Details view to 1-many you get an exception: java.util.NoSuchElementException at java.util.AbstractList$Itr.next(AbstractList.java:350) at org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator.nestedNext(CloneListIterator.java:177) at org.eclipse.jpt.common.utility.internal.iterators.CloneListIterator.next(CloneListIterator.java:112) at org.eclipse.jpt.common.core.internal.resource.java.source.SourceMember.setPrimaryAnnotation(SourceMember.java:95) at org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaPersistentAttribute.setMappingAnnotation(AbstractJavaPersistentAttribute.java:291)
I can reproduce the issue in comment 1 if I set the strategy to pk join columns, then mappedBy, then change the mapping type to 1-m.
fixed for M2