Unfortunately, that is not possible. While the bootstrap code in hibernate iterates over fields or methods depending on the access type, the bytecode enhancer iterates over fields only (by design). There is already code in the enhancer that tries to lookup annotations in methods (for a given field 'property', lookup for 'getProperty' or 'isPropperty' methods) that could be used to better determine if a field represents a mapped collection. I think that using that code on the enhancement context will be a good improvement, as it can pick the annotations in many cases, but I'm not seeing a definitive solution for this, like I mentioned before. The support for properties on the bytecode enhancer has always been a 'best effort' anyway. |