mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Description: Adding a new class AnnotationHelper, that provides routines to read annotations from a VO class. Cloudstack does the mapping between cloudstack java VO objects and the database tables using cglib. cglib creates proxy objects as the maps between VO objects and the database. A VO (value object) class is populated after querying from the MYSQL database. Ideally, a getAnnotation() issued on a cglib proxy object should get a list of all the annotations in all classes in the inheritence chain. However, this functionality seems to be currently broken in cglib. Hence, when querying for annotations given the object of a VO class, we need to get to the corresponding VO class of that cglib proxy class and issue a getAnnotation() on that class. To get the VO class, we simply need to get the super class of the proxy object. Also, we need to recurse to the root VO class in case the VO class extends another VO class. Note that the cache used by CS is ehcache.