@Override
public DynamicResultSet inspect(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, InspectHelper helper) throws ServiceException {
String ceilingEntityFullyQualifiedClassname = persistencePackage.getCeilingEntityFullyQualifiedClassname();
try {
String pageTemplateId = persistencePackage.getCustomCriteria()[3];
PageTemplate template = pageService.findPageTemplateById(Long.valueOf(pageTemplateId));
ClassMetadata metadata = new ClassMetadata();
metadata.setCeilingType(PageTemplate.class.getName());
ClassTree entities = new ClassTree(PageTemplateImpl.class.getName());
metadata.setPolymorphicEntities(entities);
Property[] properties = dynamicFieldUtil.buildDynamicPropertyList(template.getFieldGroups(), PageTemplate.class);
metadata.setProperties(properties);
DynamicResultSet results = new DynamicResultSet(metadata);
return results;
} catch (Exception e) {