|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.graph.query.validate.ImmutableSchemata.Builder
@NotThreadSafe public static class ImmutableSchemata.Builder
A builder of immutable Schemata
objects.
Method Summary | |
---|---|
ImmutableSchemata.Builder |
addColumn(String tableName,
String columnName,
String type)
Add a column with the supplied name and type to the named table. |
ImmutableSchemata.Builder |
addColumn(String tableName,
String columnName,
String type,
boolean fullTextSearchable)
Add a column with the supplied name and type to the named table. |
ImmutableSchemata.Builder |
addKey(String tableName,
String... columnNames)
Add to the specified table a key that references the existing named columns. |
ImmutableSchemata.Builder |
addTable(String name,
String... columnNames)
Add a table with the supplied name and column names. |
ImmutableSchemata.Builder |
addTable(String name,
String[] columnNames,
String[] types)
Add a table with the supplied name and column names and types. |
ImmutableSchemata.Builder |
addView(String name,
QueryCommand definition)
Add a view with the supplied name and definition. |
ImmutableSchemata.Builder |
addView(String name,
String definition)
Add a view with the supplied name and SQL string definition. |
Schemata |
build()
Build the Schemata instance, using the current state of the builder. |
ImmutableSchemata.Builder |
makeSearchable(String tableName,
String columnName)
Make sure the column on the named table is searchable. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public ImmutableSchemata.Builder addTable(String name, String... columnNames)
name
- the name of the new tablecolumnNames
- the names of the columns.
IllegalArgumentException
- if the table name is null or empty, any column name is null or empty, or if no column
names are givenpublic ImmutableSchemata.Builder addTable(String name, String[] columnNames, String[] types)
name
- the name of the new tablecolumnNames
- the names of the columnstypes
- the types for the columns
IllegalArgumentException
- if the table name is null or empty, any column name is null or empty, if no column
names are given, or if the number of types does not match the number of columnspublic ImmutableSchemata.Builder addView(String name, String definition)
name
- the name of the new viewdefinition
- the SQL definition of the view
IllegalArgumentException
- if the view name is null or empty or the definition is null
ParsingException
- if the supplied definition is cannot be parsed as a SQL querypublic ImmutableSchemata.Builder addView(String name, QueryCommand definition)
name
- the name of the new viewdefinition
- the definition of the view
IllegalArgumentException
- if the view name is null or empty or the definition is nullpublic ImmutableSchemata.Builder addColumn(String tableName, String columnName, String type)
tableName
- the name of the new tablecolumnName
- the names of the columntype
- the type for the column
IllegalArgumentException
- if the table name is null or empty, any column name is null or empty, if no column
names are given, or if the number of types does not match the number of columnspublic ImmutableSchemata.Builder addColumn(String tableName, String columnName, String type, boolean fullTextSearchable)
tableName
- the name of the new tablecolumnName
- the names of the columntype
- the type for the columnfullTextSearchable
- true if the column should be full-text searchable, or false if not
IllegalArgumentException
- if the table name is null or empty, the column name is null or empty, or if the
property type is nullpublic ImmutableSchemata.Builder makeSearchable(String tableName, String columnName)
tableName
- the name of the new tablecolumnName
- the names of the column
IllegalArgumentException
- if the table name is null or empty or if the column name is null or emptypublic ImmutableSchemata.Builder addKey(String tableName, String... columnNames)
tableName
- the name of the new tablecolumnNames
- the names of the (existing) columns that make up the key
IllegalArgumentException
- if the table name is null or empty, the array of column names is null or empty, or if
the column names do not reference existing columns in the tablepublic Schemata build()
Schemata
instance, using the current state of the builder. This method creates a snapshot of the
tables (with their columns) as they exist at the moment this method is called.
InvalidQueryException
- if any of the view definitions is invalid and cannot be resolved
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |