All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tinygroup.database.config.table.Table Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
/**
 *  Copyright (c) 1997-2013, www.tinygroup.org ([email protected]).
 *
 *  Licensed under the GPL, Version 3.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.gnu.org/licenses/gpl.html
 *
 *  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 org.tinygroup.database.config.table;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
import org.tinygroup.metadata.config.BaseObject;

import java.util.ArrayList;
import java.util.List;

@XStreamAlias("table")
public class Table extends BaseObject {
	@XStreamAsAttribute
	private String schema;
	@XStreamImplicit
	private List fieldList;
	@XStreamImplicit
	private List indexList;
	@XStreamAsAttribute
	@XStreamAlias("package-name")
	private String packageName;
	@XStreamImplicit
	private List foreignReferences;
	
	public String getNameWithOutSchema() {
		return super.getName();
	}
	
	public String getName() {
		if (getSchema() == null || "".equals(getSchema())) {
			return super.getName();
		}
		return String.format("%s.%s", getSchema(), super.getName());
	}

	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public String getSchema() {
		return schema;
	}

	public void setSchema(String schema) {
		this.schema = schema;
	}

	public List getFieldList() {
		if (fieldList == null) {
			fieldList = new ArrayList();
		}
		return fieldList;
	}

	public void setFieldList(List fieldList) {
		this.fieldList = fieldList;
	}

	public List getIndexList() {
		if (indexList == null) {
			indexList = new ArrayList();
		}
		return indexList;
	}

	public void setIndexList(List indexList) {
		this.indexList = indexList;
	}

	public List getForeignReferences() {
		if(foreignReferences==null){
			foreignReferences=new ArrayList();
		}
		return foreignReferences;
	}

	public void setForeignReferences(List foreignReferences) {
		this.foreignReferences = foreignReferences;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy