blob: 8acf297bcf3803fd6a12bc37ebe4c5f1b5de139c [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006, 2013 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Oracle - initial API and implementation
*
******************************************************************************/
package org.eclipse.persistence.tools.mapping.orm.dom;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.persistence.tools.mapping.AbstractExternalForm;
import org.eclipse.persistence.tools.mapping.orm.ExternalOrderColumn;
import org.eclipse.persistence.tools.utility.TextRange;
/**
* The external form of a order column, which is a child of an element collection mapping.
*
* @see ElementCollectionMapping
*
* @version 2.6
*/
final class OrderColumn extends AbstractExternalForm
implements ExternalOrderColumn {
/**
* Creates a new <code>OrderColumn</code>.
*
* @param parent The parent of this external form
*/
OrderColumn(AbstractExternalForm parent) {
super(parent);
}
/**
* {@inheritDoc}
*/
@Override
protected List<String> buildAttributeNamesOrder() {
List<String> names = new ArrayList<String>();
names.add(NAME);
names.add(NULLABLE);
names.add(INSERTABLE);
names.add(UPDATABLE);
names.add(COLUMN_DEFINITION);
names.add(CONTIGUOUS);
names.add(BASE);
names.add(TABLE);
return names;
}
/**
* {@inheritDoc}
*/
@Override
public Integer getBase() {
return getIntegerAttribute(BASE);
}
/**
* {@inheritDoc}
*/
@Override
public TextRange getBaseTextRange() {
return getAttributeTextRange(BASE);
}
/**
* {@inheritDoc}
*/
@Override
public String getColumnDefinition() {
return getAttribute(COLUMN_DEFINITION);
}
/**
* {@inheritDoc}
*/
@Override
public TextRange getColumnDefinitionTextRange() {
return getAttributeTextRange(COLUMN_DEFINITION);
}
/**
* {@inheritDoc}
*/
@Override
public TextRange getContiguousTextRange() {
return getAttributeTextRange(CONTIGUOUS);
}
/**
* {@inheritDoc}
*/
@Override
protected String getElementName() {
return ORDER_COLUMN;
}
/**
* {@inheritDoc}
*/
@Override
public TextRange getInstertableTextRange() {
return getAttributeTextRange(INSERTABLE);
}
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return getAttribute(NAME);
}
/**
* {@inheritDoc}
*/
@Override
public TextRange getNameTextRange() {
return getAttributeTextRange(NAME);
}
/**
* {@inheritDoc}
*/
@Override
public TextRange getNullableTextRange() {
return getAttributeTextRange(NULLABLE);
}
/**
* {@inheritDoc}
*/
@Override
public String getTable() {
return getAttribute(TABLE);
}
/**
* {@inheritDoc}
*/
@Override
public TextRange getTableTextRange() {
return getAttributeTextRange(TABLE);
}
/**
* {@inheritDoc}
*/
@Override
public TextRange getUpdatableTextRange() {
return getAttributeTextRange(UPDATABLE);
}
/**
* {@inheritDoc}
*/
@Override
public Boolean isContiguous() {
return getBooleanAttribute(CONTIGUOUS);
}
/**
* {@inheritDoc}
*/
@Override
public Boolean isInstertable() {
return getBooleanAttribute(INSERTABLE);
}
/**
* {@inheritDoc}
*/
@Override
public Boolean isNullable() {
return getBooleanAttribute(NULLABLE);
}
/**
* {@inheritDoc}
*/
@Override
public Boolean isUpdatable() {
return getBooleanAttribute(UPDATABLE);
}
/**
* {@inheritDoc}
*/
@Override
public void removeColumn() {
removeSelf();
}
/**
* {@inheritDoc}
*/
@Override
public void setBase(Integer base) {
setAttribute(BASE, base);
}
/**
* {@inheritDoc}
*/
@Override
public void setColumnDefinition(String columnDefinition) {
setAttribute(COLUMN_DEFINITION, columnDefinition);
}
/**
* {@inheritDoc}
*/
@Override
public void setContiguous(Boolean contiguous) {
setAttribute(CONTIGUOUS, contiguous);
}
/**
* {@inheritDoc}
*/
@Override
public void setInsertable(Boolean insertable) {
setAttribute(INSERTABLE, insertable);
}
/**
* {@inheritDoc}
*/
@Override
public void setName(String name) {
setAttribute(NAME, name);
}
/**
* {@inheritDoc}
*/
@Override
public void setNullable(Boolean nullable) {
setAttribute(NULLABLE, nullable);
}
/**
* {@inheritDoc}
*/
@Override
public void setTable(String table) {
setAttribute(TABLE, table);
}
/**
* {@inheritDoc}
*/
@Override
public void setUpdatable(Boolean updatable) {
setAttribute(UPDATABLE, updatable);
}
}