Package com.nickbenn.room.model
Class View
- java.lang.Object
-
- com.nickbenn.room.model.View
-
- All Implemented Interfaces:
Streamable
public class View extends Object implements Streamable
Represents a view in a Room SQLite database schema. This will generally be read from one of the elements of thedatabase.views
array property in a JSON file with the structure described inParser
.
-
-
Constructor Summary
Constructors Constructor Description View()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDdl()
Returns theCREATE VIEW
SQL statement used to create the SQLite view represented by this instance.String
getName()
Returns the name of the Room view (also the SQLite view name) that this instance represents.void
setDdl(String ddl)
Sets theCREATE VIEW
SQL statement used to create the SQLite table represented by this instance.void
setName(String name)
Sets the name of the Room view (also the SQLite view name) that this instance represents.Stream<String>
stream()
Returns aStream
containing the DDL statement capable of creating the SQLite view corresponding to this instance.
-
-
-
Method Detail
-
getName
public String getName()
Returns the name of the Room view (also the SQLite view name) that this instance represents. This value will generally be read from adatabase.views[].viewName
property in a Room-generated JSON schema file.
-
setName
public void setName(String name)
Sets the name of the Room view (also the SQLite view name) that this instance represents.- Parameters:
name
-
-
getDdl
public String getDdl()
-
setDdl
public void setDdl(String ddl)
Sets theCREATE VIEW
SQL statement used to create the SQLite table represented by this instance. Ifddl
contains any${VIEW_NAME}
placeholders, they'll be included in the value returned bygetDdl()
, but not by that returned bystream()
.- Parameters:
ddl
-
-
stream
public Stream<String> stream()
Returns aStream
containing the DDL statement capable of creating the SQLite view corresponding to this instance. As part of this process, all${VIEW_NAME}
placeholders in the DDL are replaced by the value returned bygetName()
.- Specified by:
stream
in interfaceStreamable
-
-