Re: Behavior of ODMG personality and many-to-many relationships and default cache implementation
hi sean, when you add a category to the a products you should also make the vece-versa connection categoryA.getProducts().add(productY). ojb does not do this automatically (at least it did not before i went on vacation...) hth jakob 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Behavior of ODMG personality and many-to-many relationships and default cache implementation
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Behavior of ODMG personality and many-to-many relationships and default cache implementation
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]