What about the proprietary @PersistentMap annotation? I'd guess that this will do exactly what you're looking for (table with three columns, one for the fk, one for the key, and one for the value).
-Patrick On Dec 31, 2007 1:37 AM, Alexander Saint Croix <[EMAIL PROTECTED]> wrote: > In response to my own question: > > I found, buried near the bottom of the JPA spec, the section on the > @MapKey annotation, and think that I'd be better off implementing > another entity for this purpose rather than relying on the default > behavior of the java.util.Map. In addition to a key, I need to map > TWO values, so it makes little sense to use a Map. > > Cheers, > -- > Alex > > > > > > > On Dec 30, 2007 6:12 PM, Alexander Saint Croix > > <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I'm curious--for a simple Map field like the following: > > > > private Map<String, String> m = new HashMap<String, String>(); > > > > What would be the best way to annotate this? I'm getting odd errors > > with a simple @OneToMany annotation. > > > > Cheers, and once again--thank you guys for the amazing job in 2007--I > > eagerly await what 2008 will bring. > > > > Regards, > > -- > > Alexander Saint Croix > > . > > > -- Patrick Linskey 202 669 5907
