Package com.nickbenn.room.model
Class Database
- java.lang.Object
-
- com.nickbenn.room.model.Database
-
- All Implemented Interfaces:
Streamable
public class Database extends Object implements Streamable
Represents thedatabase
in a Room SQLite database schema. This will generally be read from a JSON file with the structure described inParser
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Entity>
getEntities()
int
getVersion()
Returns theint
-valued version number of the database schema, as declared in theversion
attribute of the@Database
annotation, and serialized as thedatabase.version
property in the JSON schema.List<View>
getViews()
void
setEntities(List<Entity> entities)
void
setVersion(int version)
Sets the version number of the database schema.void
setViews(List<View> views)
Stream<String>
stream()
Gathers into aStream
and returns the DDL statements capable of creating the database corresponding to this instance, along with all of its tables, indices, and views.
-
-
-
Method Detail
-
getVersion
public int getVersion()
Returns theint
-valued version number of the database schema, as declared in theversion
attribute of the@Database
annotation, and serialized as thedatabase.version
property in the JSON schema.
-
setVersion
public void setVersion(int version)
Sets the version number of the database schema.- Parameters:
version
-
-
stream
public Stream<String> stream()
Gathers into aStream
and returns the DDL statements capable of creating the database corresponding to this instance, along with all of its tables, indices, and views.- Specified by:
stream
in interfaceStreamable
-
-