*/
protected ClassDescriptor buildCacheDescriptor() {
XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(CacheMetadata.class);
XMLDirectMapping expiryMapping = new XMLDirectMapping();
expiryMapping.setAttributeName("m_expiry");
expiryMapping.setGetMethodName("getExpiry");
expiryMapping.setSetMethodName("setExpiry");
expiryMapping.setXPath("orm:expiry/text()");
descriptor.addMapping(expiryMapping);
XMLCompositeObjectMapping expiryTimeOfDayMapping = new XMLCompositeObjectMapping();
expiryTimeOfDayMapping.setAttributeName("m_expiryTimeOfDay");
expiryTimeOfDayMapping.setGetMethodName("getExpiryTimeOfDay");
expiryTimeOfDayMapping.setSetMethodName("setExpiryTimeOfDay");
expiryTimeOfDayMapping.setReferenceClass(TimeOfDayMetadata.class);
expiryTimeOfDayMapping.setXPath("orm:time-of-day");
descriptor.addMapping(expiryTimeOfDayMapping);
XMLDirectMapping sizeMapping = new XMLDirectMapping();
sizeMapping.setAttributeName("m_size");
sizeMapping.setGetMethodName("getSize");
sizeMapping.setSetMethodName("setSize");
sizeMapping.setXPath("@size");
descriptor.addMapping(sizeMapping);
XMLDirectMapping sharedMapping = new XMLDirectMapping();
sharedMapping.setAttributeName("m_shared");
sharedMapping.setGetMethodName("getShared");
sharedMapping.setSetMethodName("setShared");
sharedMapping.setXPath("@shared");
descriptor.addMapping(sharedMapping);
XMLDirectMapping cacheTypeMapping = new XMLDirectMapping();
cacheTypeMapping.setAttributeName("m_type");
cacheTypeMapping.setGetMethodName("getType");
cacheTypeMapping.setSetMethodName("setType");
cacheTypeMapping.setConverter(new EnumTypeConverter(cacheTypeMapping, CacheType.class, false));
cacheTypeMapping.setXPath("@type");
descriptor.addMapping(cacheTypeMapping);
XMLDirectMapping alwaysRefreshMapping = new XMLDirectMapping();
alwaysRefreshMapping.setAttributeName("m_alwaysRefresh");
alwaysRefreshMapping.setGetMethodName("getAlwaysRefresh");
alwaysRefreshMapping.setSetMethodName("setAlwaysRefresh");
alwaysRefreshMapping.setXPath("@always-refresh");
descriptor.addMapping(alwaysRefreshMapping);
XMLDirectMapping refreshOnlyIfNewerMapping = new XMLDirectMapping();
refreshOnlyIfNewerMapping.setAttributeName("m_refreshOnlyIfNewer");
refreshOnlyIfNewerMapping.setGetMethodName("getRefreshOnlyIfNewer");
refreshOnlyIfNewerMapping.setSetMethodName("setRefreshOnlyIfNewer");
refreshOnlyIfNewerMapping.setXPath("@refresh-only-if-newer");
descriptor.addMapping(refreshOnlyIfNewerMapping);
XMLDirectMapping disableHitsMapping = new XMLDirectMapping();
disableHitsMapping.setAttributeName("m_disableHits");
disableHitsMapping.setGetMethodName("getDisableHits");
disableHitsMapping.setSetMethodName("setDisableHits");
disableHitsMapping.setXPath("@disable-hits");
descriptor.addMapping(disableHitsMapping);
XMLDirectMapping coordinationTypeMapping = new XMLDirectMapping();
coordinationTypeMapping.setAttributeName("m_coordinationType");
coordinationTypeMapping.setGetMethodName("getCoordinationType");
coordinationTypeMapping.setSetMethodName("setCoordinationType");
coordinationTypeMapping.setConverter(new EnumTypeConverter(coordinationTypeMapping, CacheCoordinationType.class, false));
coordinationTypeMapping.setXPath("@coordination-type");
descriptor.addMapping(coordinationTypeMapping);
return descriptor;
}