Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Map<Enum, Entity> table creation works (3 columns), query is wrong (2 values)
icon5.gif  Map<Enum, Entity> table creation works (3 columns), query is wrong (2 values) [message #897496] Tue, 24 July 2012 09:59 Go to next message
Simon Ascender is currently offline Simon AscenderFriend
Messages: 1
Registered: July 2012
Junior Member

i migrate from hibernate, and need a little bit help...
 @MapKeyColumn(length = 8)
 public Map<AddressType, PostalAddress> getPostalAddress()

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:

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:
@MapKeyColumn(length = 8)
public Map<PhoneType, String> getPhoneNumber()

Re: Map<Enum, Entity> table creation works (3 columns), query is wrong (2 values) [message #899664 is a reply to message #897496] Wed, 01 August 2012 17:44 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I could not find any test for this case (OneToMany using JoinTable and MapKeyColumn), so it may be a bug.

Please log a bug for this and vote for it.

As a workaround your could map the join table to an object,


James : Wiki : Book : Blog : Twitter
Previous Topic:Postgresql NULLS FIRST Order by
Next Topic:The parameter name in the query's selection criteria does not match any parameter name defi
Goto Forum:

Current Time: Wed Sep 23 03:29:06 GMT 2020

Powered by FUDForum. Page generated in 0.02312 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top