You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Sean Dockery <sd...@securac.net> on 2004/04/06 16:17:19 UTC

Re: Behavior of ODMG personality and many-to-many relationships and default cache implementation

Still no takers?  :-(

Sean Dockery wrote:

> No takers?
> 
> Sean Dockery wrote:
> 
>> Consider the following classes that represent a many-to-many 
>> relationship:
>>
>> public class Category {
>>
>>     private Collection products;
>>
>>     public Collection getProducts() {
>>         return products;
>>     }
>>
>>     public void setProducts(Collection newProducts) {
>>         products = newProducts;
>>     }
>>
>> }
>>
>> public class Products {
>>
>>     private Collection categories;
>>
>>     public Collection getCategories() {
>>         return categories;
>>     }
>>
>>     public void setCategories(Collection newCategories) {
>>         categories = newCategories;
>>     }
>>
>> }
>>
>> If I have categories A and B, and products X and Y.  Initially 
>> category A contains only product X, and category B contains only 
>> product Y.
>>
>> If I have fetched category A into the cache, then load product Y, and 
>> modify it thusly...
>>
>> productY.getCategories().add(categoryA);
>>
>> ...and save it, the correct record is inserted into the indirection 
>> table describing the relationship between categoryA and productY. 
>> However, the cached copy of A is not updated with the new 
>> relationship.  If categoryA is purged from the cache and 
>> re-materialized, it contains both X and Y in its products collection.
>>
>> Is this correct behavior or is this a bug?  If it is a bug, will it be 
>> fixed before 1.0 final is released?
>>
>> Thanks...


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org