db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Annotations for embedded Key, Value, and Element
Date Tue, 17 Jul 2007 20:55:35 GMT
One more problem. I'm mapping to an embedded Key, Value, or Element.  
For example, I have a Set<Line> and want to map this to a table with  
embedded Line instances.

I can annotate that the field is embedded, but this doesn't help. I  
need the mapping for the embedded elements:

@Field (table=LINES)
@Join (column=KEY)
@Element (embedded=@Embedded({
  @Field(name="point1.x", column="POINT1_X"),
  @Field(name="point1.y", column="POINT1_Y"),
  @Field(name="pointt2.x", column="POINT2_X"),
  @Field(name="point2.y", column="POINT2_Y")}
Set<Line> lines;

Similarly for Key and Value for mapping Maps.

The only thing needed is the Embedded[] embedded() default {} element  
of @Key, @Value, and @Element, replacing the String embedded() that I  
think has no use here.


Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!

View raw message