private static VersionInfo getVersionInfo(WebAsset currWebAsset,
Identifier identifier, List<Versionable> webAssetList, String type)
throws DotHibernateException {
VersionInfo auxVersionInfo;
Class clazz = UtilMethods.getVersionInfoType(type);
HibernateUtil dh = new HibernateUtil(clazz);
dh.setQuery("from "+clazz.getName()+" where identifier=?");
dh.setParam(identifier);
Logger.debug(BaseWebAssetAPI.class, "getVersionInfo query: "+dh.getQuery());
auxVersionInfo=(VersionInfo)dh.load();
if(UtilMethods.isSet(auxVersionInfo) && UtilMethods.isSet(auxVersionInfo.getIdentifier())) {
clazz = InodeUtils.getClassByDBType(type);
dh = new HibernateUtil(clazz);
dh.setQuery("from inode in class " + clazz.getName() + " where inode.identifier = ? and inode.type='"+type+"' order by mod_date desc");
dh.setParam(currWebAsset.getIdentifier());
Logger.debug(BaseWebAssetAPI.class, "findAllVersions query: " + dh.getQuery());
webAssetList.addAll( (List<Versionable>) dh.list() );
}
return auxVersionInfo;
}