public class SimpleTableDef extends Object implements Serializable, HasName
DataContext is unable to detect/discover the table structure and
needs some basic input around expected table structures.| Constructor and Description |
|---|
SimpleTableDef(String name,
String[] columnNames)
Constructs a
SimpleTableDef. |
SimpleTableDef(String name,
String[] columnNames,
ColumnType[] columnTypes)
Constructs a
SimpleTableDef. |
SimpleTableDef(Table table)
Constructs a
SimpleTableDef using a Table as a prototype. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String[] |
getColumnNames()
Gets the names of the columns in the table
|
ColumnType[] |
getColumnTypes()
Gets the types of the columns in the table
|
String |
getName()
Gets the name of the table
|
int |
hashCode() |
int |
indexOf(String columnName)
Gets the index of a column name, or -1 if the column name does not exist
|
String |
toString() |
MutableTable |
toTable()
Creates a
MutableTable based on this SimpleTableDef. |
public SimpleTableDef(Table table)
SimpleTableDef using a Table as a prototype.table - public SimpleTableDef(String name, String[] columnNames)
SimpleTableDef.name - the name of the tablecolumnNames - the names of the columns to include in the tablepublic SimpleTableDef(String name, String[] columnNames, ColumnType[] columnTypes)
SimpleTableDef.name - the name of tablecolumnNames - the names of the columns to include in the tablecolumnTypes - the column types of the columns specified.public String getName()
public String[] getColumnNames()
public ColumnType[] getColumnTypes()
public MutableTable toTable()
MutableTable based on this SimpleTableDef. Note
that the created table will not have any schema set.public int indexOf(String columnName)
columnName - Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.