openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fernando Padilla <f...@alum.mit.edu>
Subject ordered Lists, with list position in join table
Date Fri, 24 Oct 2008 17:26:50 GMT
So, again, I'm trying to port from old JDO to new JPA :)  And I'm trying 
to map a List object, where the relational table is storing the position 
of each element.  It looks like standard JPA doesn't want to support 
this, but I was wondering if OpenJPA had this as an option in some way...:




And I have this sort of relational join table.

mysql> desc FLEAG_DRAFTORDER;
+------------------+------------+------+-----+---------+-------+
| Field            | Type       | Null | Key | Default | Extra |
+------------------+------------+------+-----+---------+-------+
| DRAFTORDER_JDOID | bigint(20) | YES  | MUL | NULL    |       |
| DRAFTORDER_ORDER | int(11)    | YES  |     | NULL    |       |
| JDOID            | bigint(20) | YES  | MUL | NULL    |       |
+------------------+------------+------+-----+---------+-------+
JDOID -> FLEAGUE
DRAFTORDER_JDOID -> FTEAM
DRAFTORDER_ORDER -> LIST_INDEX_POSITION




The owning class has a field:

@Entity
public class FLeague extends HBaseIdCreateTime {
....
	@ManyToMany
	private List<FTeam> draftOrder;
....
}


@Entity
public class FTeam extends HBaseIdCreateTime {
....
}

Mime
View raw message