Package com.gengoai.sql.object
Class SQLObject
- java.lang.Object
-
- com.gengoai.sql.object.SQLObject
-
- All Implemented Interfaces:
NamedSQLElement
,SQLElement
,Serializable
- Direct Known Subclasses:
Index
,SQLiteFullTextTable
,Table
,Trigger
public abstract class SQLObject extends Object implements NamedSQLElement
Base class for SQL objects, e.g. (Tables, Columns, Triggers, etc.)- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Create
create()
Creates a newCreate
statement setting the object to be created as this object.boolean
create(@NonNull SQLContext context)
boolean
createIfNotExists(@NonNull SQLContext context)
Drop
drop()
Creates a newDrop
statement setting the object to be created as this object.boolean
drop(@NonNull SQLContext context)
boolean
dropIfExists(@NonNull SQLContext context)
abstract String
getKeyword()
Gets the SQL Keyword associated with the objectString
getName()
Gets the name of object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gengoai.sql.SQLElement
getClassName
-
-
-
-
Field Detail
-
name
protected String name
-
-
Constructor Detail
-
SQLObject
protected SQLObject()
Instantiates a new SQLObject.
-
SQLObject
protected SQLObject(String name)
Instantiates a new SQLObject.- Parameters:
name
- the name of the object
-
-
Method Detail
-
create
public boolean create(@NonNull @NonNull SQLContext context) throws SQLException
- Throws:
SQLException
-
create
public Create create()
Creates a newCreate
statement setting the object to be created as this object.- Returns:
- the create statement
-
createIfNotExists
public boolean createIfNotExists(@NonNull @NonNull SQLContext context) throws SQLException
- Throws:
SQLException
-
drop
public boolean drop(@NonNull @NonNull SQLContext context) throws SQLException
- Throws:
SQLException
-
drop
public Drop drop()
Creates a newDrop
statement setting the object to be created as this object.- Returns:
- the drop statement
-
dropIfExists
public boolean dropIfExists(@NonNull @NonNull SQLContext context) throws SQLException
- Throws:
SQLException
-
getKeyword
public abstract String getKeyword()
Gets the SQL Keyword associated with the object- Returns:
- the SQL keyword
-
getName
public final String getName()
Gets the name of object.- Specified by:
getName
in interfaceNamedSQLElement
- Returns:
- the name pf the object
-
-