Package cc.carm.lib.easysql.api.table
Class NamedSQLTable
- java.lang.Object
-
- cc.carm.lib.easysql.api.table.NamedSQLTable
-
-
Field Summary
Fields Modifier and Type Field Description protected @Nullable SQLManager
manager
protected @Nullable java.lang.String
tablePrefix
-
Constructor Summary
Constructors Constructor Description NamedSQLTable(@NotNull java.lang.String tableName)
请调用NamedSQLTable
下的静态方法进行对象的初始化。
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
create(@NotNull SQLManager sqlManager)
以指定的SQLManager
实例初始化并创建该表abstract boolean
create(@NotNull SQLManager sqlManager, @Nullable java.lang.String tablePrefix)
使用指定 SQLManager 进行本示例的初始化。@Nullable SQLManager
getSQLManager()
得到SQLTable.create(SQLManager)
用于初始化本实例的SQLManager
实例@NotNull java.lang.String
getTableName()
得到本表表名,不得为空。-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cc.carm.lib.easysql.api.SQLTable
alter, alter, createDelete, createDelete, createInsert, createInsert, createInsertBatch, createInsertBatch, createQuery, createQuery, createReplace, createReplace, createReplaceBatch, createReplaceBatch, createUpdate, createUpdate
-
-
-
-
Field Detail
-
tablePrefix
@Nullable protected @Nullable java.lang.String tablePrefix
-
manager
@Nullable protected @Nullable SQLManager manager
-
-
Constructor Detail
-
NamedSQLTable
public NamedSQLTable(@NotNull @NotNull java.lang.String tableName)
请调用NamedSQLTable
下的静态方法进行对象的初始化。- Parameters:
tableName
- 该表的名称
-
-
Method Detail
-
getTableName
@NotNull public @NotNull java.lang.String getTableName()
Description copied from interface:SQLTable
得到本表表名,不得为空。- Specified by:
getTableName
in interfaceSQLTable
- Returns:
- 本表表名
-
getSQLManager
@Nullable public @Nullable SQLManager getSQLManager()
Description copied from interface:SQLTable
得到SQLTable.create(SQLManager)
用于初始化本实例的SQLManager
实例- Specified by:
getSQLManager
in interfaceSQLTable
- Returns:
SQLManager
实例
-
create
public abstract boolean create(@NotNull @NotNull SQLManager sqlManager, @Nullable @Nullable java.lang.String tablePrefix) throws java.sql.SQLException
使用指定 SQLManager 进行本示例的初始化。- Parameters:
sqlManager
-SQLManager
tablePrefix
- 表名前缀- Returns:
- 本表是否为首次创建
- Throws:
java.sql.SQLException
- 出现任何错误时抛出
-
create
public boolean create(@NotNull @NotNull SQLManager sqlManager) throws java.sql.SQLException
Description copied from interface:SQLTable
以指定的SQLManager
实例初始化并创建该表- Specified by:
create
in interfaceSQLTable
- Parameters:
sqlManager
-SQLManager
实例- Returns:
- 是否新创建了本表 (若已创建或创建失败则返回false)
- Throws:
java.sql.SQLException
- 当数据库返回异常时抛出
-
-