Skip to main content

How to access "Join Table" Fields?

2 replies [Last post]
Joined: 2006-02-09

Hei -

I have a simple scenario of:
*Item - item_id, description
*Stock - stock_id, item_id, warehouse_id, numberOfItems
*Warehouse - warehouse_id, description

I want to define OneToMany or ManyToMany relationship between Warehouse and Item.

I can easily access Items from Warehouses or vice-versus, but cannot access the Stock field, numberOfItems.

This seems so simple, but I haven't seen any examples that retrieve the join table fields.


Best Regards,

Message was edited by: chillier

Message was edited by: chillier

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-03-30

Are Item, Stock, Warehouse tables or are they Java classes?

I don't think there is any provison to access columns of JoinTable. Have you explored the option of modeling Stock as a separate entity and having bidirectional relationships between Item and Stock and Warehouse and Stock?


Joined: 2006-02-09

Hei Sahoo -

Thanks again. Yes, those are the underlying tables - you've already answered on the problems of using bidirectional relationships in webservices...

Yes, what I want is bidirectional ManyToMany between Item and Warehouse, with the Stock attibrutes available, somehow...

What I am looking at is unidirectional (works with webservices), but I still need those stock attributes. I suppose a OneToMany unidirectional in addition to OneToMany to Warehouse is what I need...

Best Regards