Hi,
i migrate from hibernate, and need a little bit help...
@Entity
UserIdentity
{
@OneToMany
@MapKeyColumn(length = 8)
@MapKeyEnumerated(EnumType.STRING)
public Map<AddressType, PostalAddress> getPostalAddress()
}
@Entity
public class PostalAddress implements Serializable {...}
public enum AddressType { HOME, WORK, OTHER... }
Eclipselink create the table correct, with 3 columns:
[UserIdentity_ID | PostalAddress_ID | PostalAddress_KEY]
but wrong querys:
INSERT INTO USERIDENTITY_POSTALADDRESS (UserIdentity_ID, PostalAddress_ID) VALUES (?, ?)
i try and search several hours, @MapKeyClass, @MapKeyConvert and many more, but without success...
now i am very frustrated, this looks for me more than a eclipselink bug? i hope someone can help...
in use: eclipselink 2.3.3, persistence 2.0.3 and org.eclipse.persistence.jpa.PersistenceProvider
p.s. Map<Enum, String> works great:
@ElementCollection
@MapKeyColumn(length = 8)
@MapKeyEnumerated(EnumType.STRING)
public Map<PhoneType, String> getPhoneNumber()