Let's say Factory.java and Product.java are entity classes.
There is a one-to-many unidirectional relationship from Factory to Product.

  | @Entity
  | public class Factory implements Serializable {
  |     @Id
  |     private Long id;
  | 
  |     // This is a collection of Product ids.  How to map this???
  |     private List<Long> productIds;
  |     ......
  | }
  | 
  | @Entity
  | public class Product implements Serializable {
  | 
  |     @Id
  |     private Long id;
  |     ......
  | }
  | 

My question is: how to write the mapping metadata for Factory.productIds?
(I know List< Long > can't be persisted. But how can JPA solve this simple 
case?)

TIA.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047789#4047789

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047789
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to