/*
 * Copyright 2015 University of Oxford
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package uk.ac.ox.it.ords.api.database.data;

import uk.ac.ox.it.ords.api.database.model.TableView;

public class TableViewInfo {
	private int	id;
	private String viewName;
	private String viewTable;
	private String viewDescription;
	private String viewQuery;
	private String viewAuthorization;

	public TableViewInfo(){
		
	}
	
	public TableViewInfo(TableView dataset){
		this.setId(dataset.getId());
		this.setViewAuthorization(dataset.getTvAuthorization());
		this.setViewDescription(dataset.getViewDescription());
		this.setViewName(dataset.getViewName());
		this.setViewQuery(dataset.getQuery());
		this.setViewTable(dataset.getAssociatedTable());
	}
	
	public String getViewName() {
		return viewName;
	}
	public void setViewName(String viewName) {
		this.viewName = viewName;
	}
	public String getViewDescription() {
		return viewDescription;
	}
	public void setViewDescription(String viewDescription) {
		this.viewDescription = viewDescription;
	}
	public String getViewQuery() {
		return viewQuery;
	}
	public void setViewQuery(String viewQuery) {
		this.viewQuery = viewQuery;
	}
	public String getViewAuthorization() {
		return viewAuthorization;
	}
	public void setViewAuthorization(String viewAuthorization) {
		this.viewAuthorization = viewAuthorization;
	}
	public String getViewTable() {
		return viewTable;
	}
	public void setViewTable(String viewTable) {
		this.viewTable = viewTable;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}



}
@@ -893,16 +893,41 @@
 ization;
+%0A%09private int databaseId;
 %0A%0A%09publi
@@ -1277,16 +1277,71 @@
 ble());%0A
+%09%09this.setDatabaseId(dataset.getPhysicalDatabaseId());%0A
 %09%7D%0A%09%0A%09pu
@@ -2174,11 +2174,147 @@
 id;%0A%09%7D%0A%0A
+%09public int getDatabaseId() %7B%0A%09%09return databaseId;%0A%09%7D%0A%0A%09public void setDatabaseId(int databaseId) %7B%0A%09%09this.databaseId = databaseId;%0A%09%7D%0A%0A
 %0A%0A%7D

include database id with view information to support public API