|
@@ -76,4 +76,11 @@ public class SimpleFileInfoService extends GenericEntityService<FileInfoEntity,
|
|
if (null == md5) return null;
|
|
if (null == md5) return null;
|
|
return createQuery().where(FileInfoEntity.md5, md5).single();
|
|
return createQuery().where(FileInfoEntity.md5, md5).single();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Cacheable(key = "'id-or-md5:'+#idOrMd5", condition = "#idOrMd5!=null")
|
|
|
|
+ public FileInfoEntity selectByIdOrMd5(String idOrMd5) {
|
|
|
|
+ if (null == idOrMd5) return null;
|
|
|
|
+ return createQuery().where(FileInfoEntity.md5,idOrMd5).or(FileInfoEntity.id,idOrMd5).single();
|
|
|
|
+ }
|
|
}
|
|
}
|