类 DatabaseResource
java.lang.Object
org.ssssssss.magicapi.core.resource.KeyValueResource
org.ssssssss.magicapi.core.resource.DatabaseResource
- 所有已实现的接口:
Resource
数据库资源存储
- 作者:
- mxd
-
字段概要
字段修饰符和类型字段说明private static final org.slf4j.Loggerprivate final Stringprivate final org.springframework.jdbc.core.JdbcTemplate从类继承的字段 org.ssssssss.magicapi.core.resource.KeyValueResource
parent, path, readonly, separator -
构造器概要
构造器构造器说明DatabaseResource(org.springframework.jdbc.core.JdbcTemplate template, String tableName) DatabaseResource(org.springframework.jdbc.core.JdbcTemplate template, String tableName, boolean readonly) DatabaseResource(org.springframework.jdbc.core.JdbcTemplate template, String tableName, String path, boolean readonly) DatabaseResource(org.springframework.jdbc.core.JdbcTemplate template, String tableName, String path, boolean readonly, Map<String, String> cachedContent, KeyValueResource parent) DatabaseResource(org.springframework.jdbc.core.JdbcTemplate template, String tableName, String path, boolean readonly, KeyValueResource parent) -
方法概要
从类继承的方法 org.ssssssss.magicapi.core.resource.KeyValueResource
deleteByKey, dirs, files, getAbsolutePath, getDirectory, getFilePath, getResource, isDirectory, mkdir, name, parent, readonly, renameTo, resources, separator, write从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 org.ssssssss.magicapi.core.resource.Resource
export, processExport
-
字段详细资料
-
logger
private static final org.slf4j.Logger logger -
template
private final org.springframework.jdbc.core.JdbcTemplate template -
tableName
-
cachedContent
-
-
构造器详细资料
-
DatabaseResource
-
DatabaseResource
public DatabaseResource(org.springframework.jdbc.core.JdbcTemplate template, String tableName, boolean readonly) -
DatabaseResource
-
DatabaseResource
public DatabaseResource(org.springframework.jdbc.core.JdbcTemplate template, String tableName, String path, boolean readonly, KeyValueResource parent) -
DatabaseResource
-
-
方法详细资料
-
read
public byte[] read()从接口复制的说明:Resource读取- 返回:
- 读取的资源内容
-
readAll
public void readAll()从接口复制的说明:Resource读取当前资源下的所有内容,主要是缓存作用。 -
exists
public boolean exists()从接口复制的说明:Resource判断是否存在- 返回:
- 返回资源是否存在
-
write
从接口复制的说明:Resource写入- 参数:
content- 写入的内容- 返回:
- 是否写入成功
-
keys
从类复制的说明:KeyValueResource该资源下的keys- 指定者:
keys在类中KeyValueResource- 返回:
- 返回该资源下的keys
-
renameTo
从类复制的说明:KeyValueResource需要做修改的key,原key: 新key- 指定者:
renameTo在类中KeyValueResource- 参数:
renameKeys- 需重命名的key- 返回:
- 是否修改成功
-
delete
public boolean delete()从接口复制的说明:Resource删除- 指定者:
delete在接口中Resource- 覆盖:
delete在类中KeyValueResource- 返回:
- 返回是否删除成功
-
mappedFunction
从类复制的说明:KeyValueResourcemapped函数,用于根据路径创建资源对象- 指定者:
mappedFunction在类中KeyValueResource- 返回:
- mapped函数
-
toString
-