Package com.mckoi.database

## Class ViewManager

- java.lang.Object
- - com.mckoi.database.ViewManager

    public class ViewManager
    extends java.lang.Object

A DatabaseConnection view manager. This controls adding, updating, deleting, and processing views inside the system view table.

Author:
  Tobias Downer

### Method Summary

All Methods Instance Methods Concrete Methods
`QueryPlanNode` `createViewQueryPlanNode​(TableName view_name)` Returns a freshly deserialized QueryPlanNode object for the given view object.
`void` `defineView​(ViewDef view, SQLQuery query, User user)` Defines a view.
`boolean` `deleteView​(TableName view_name)` Deletes the view with the given name, or returns false if no entries were deleted from the view table.
`boolean` `viewExists​(TableName view_name)` Returns true if the view with the given name exists.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### viewExists

    public boolean viewExists​(TableName view_name)

Returns true if the view with the given name exists.

#### defineView

    public void defineView​(ViewDef view,
                           SQLQuery query,
                           User user)
                    throws DatabaseException

Defines a view. If the view with the name has not been defined it is defined. If the view has been defined then it is overwritten with this information.

Parameters:
  `view` - information that defines the view.
  `query` - the query that forms the view.
  `user` - the user that owns this view being defined.
Throws:
  `DatabaseException`

#### deleteView

    public boolean deleteView​(TableName view_name)
                       throws DatabaseException

Deletes the view with the given name, or returns false if no entries were deleted from the view table.

Throws:
  `DatabaseException`

#### createViewQueryPlanNode

    public QueryPlanNode createViewQueryPlanNode​(TableName view_name)

Returns a freshly deserialized QueryPlanNode object for the given view object.