3.6.6.4.1. Smart Proxies
Most proxies only track whether or not they have been modified. Smart proxies for collection and map fields, however, keep a record of which elements have been added, removed, and changed. This record enables the OpenJPA runtime to make more efficient database updates on these fields.
When designing your persistent classes, keep in mind that you can optimize for OpenJPA smart proxies by using fields of type java.util.Set, java.util.TreeSet, and java.util.HashSet for your collections whenever possible.
Smart proxies for these types are more efficient than proxies for Lists.
You can also design your own smart proxies to further optimize OpenJPA for your usage patterns.
See the section on custom proxies for details.