Search code examples
javajakarta-eeone-to-manytoplink

how does toplink session.refreshObject() handle one to many mappings?


am using the Session.refreshObject(Object o) method to fresh an object that has a getList() method. This list is provided by toplink using a one to many mapping. When I refresh the object, I want this list to be refreshed too. Is this possible or I have to refresh something else?

Thanks in Advance!


Solution

  • refreshObject is equivalent to calling ReadObjectQuery.

    If you want to refresh objects in cascade you can use ReadObjectQuery.cascadePrivateParts(). According to the doc this method

    Cascade the query and its properties on the queries object(s) and all privately owned objects related to the queries object(s)

    .