org.apache.metamodel.spring
Class DataContextFactoryBean
java.lang.Object
org.apache.metamodel.spring.DataContextFactoryBean
- All Implemented Interfaces:
- DataContextFactoryParameters, org.springframework.beans.factory.FactoryBean<DataContext>
public class DataContextFactoryBean
- extends Object
- implements org.springframework.beans.factory.FactoryBean<DataContext>, DataContextFactoryParameters
A spring FactoryBean that produces MetaModel DataContext
objects based on property values that will typically be injected by the
Spring configuration.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataContextFactoryBean
public DataContextFactoryBean()
getObject
public DataContext getObject()
throws Exception
- Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<DataContext>
- Throws:
Exception
setTableDefinitions
public void setTableDefinitions(String tableDefinitionsText)
throws IllegalArgumentException
- Sets the
SimpleTableDefs of getTableDefs() by providing
a string representation of the following form (like a CREATE TABLE
statement, except for the literal 'CREATE TABLE' prefix, and without
column sizes):
tablename1 (
columnName1 VARCHAR,
columnName2 INTEGER,
columnName3 DATE
);
tablename2 (
columnName4 BIGINT,
columnName5 CHAR,
columnName6 BINARY
);
Each table definition is delimited/ended by the semi-colon (;) character.
The parser is at this point quite simple and restricts that column names
cannot contain parentheses, commas, semi-colons or spaces. No quote
characters or escape characters are available. Newlines, return carriages
and tabs are ignored.
- Parameters:
tableDefinitionsText -
- Throws:
IllegalArgumentException
getObjectType
public Class<DataContext> getObjectType()
- Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<DataContext>
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<DataContext>
getType
public String getType()
setType
public void setType(String type)
getResource
public org.springframework.core.io.Resource getResource()
- Specified by:
getResource in interface DataContextFactoryParameters
setResource
public void setResource(org.springframework.core.io.Resource resource)
getFilename
public String getFilename()
- Specified by:
getFilename in interface DataContextFactoryParameters
setFilename
public void setFilename(String filename)
getUrl
public String getUrl()
- Specified by:
getUrl in interface DataContextFactoryParameters
setUrl
public void setUrl(String url)
getColumnNameLineNumber
public String getColumnNameLineNumber()
- Specified by:
getColumnNameLineNumber in interface DataContextFactoryParameters
setColumnNameLineNumber
public void setColumnNameLineNumber(String columnNameLineNumber)
getSkipEmptyLines
public String getSkipEmptyLines()
- Specified by:
getSkipEmptyLines in interface DataContextFactoryParameters
setSkipEmptyLines
public void setSkipEmptyLines(String skipEmptyLines)
getSkipEmptyColumns
public String getSkipEmptyColumns()
- Specified by:
getSkipEmptyColumns in interface DataContextFactoryParameters
setSkipEmptyColumns
public void setSkipEmptyColumns(String skipEmptyColumns)
getEncoding
public String getEncoding()
- Specified by:
getEncoding in interface DataContextFactoryParameters
setEncoding
public void setEncoding(String encoding)
getSeparatorChar
public String getSeparatorChar()
- Specified by:
getSeparatorChar in interface DataContextFactoryParameters
setSeparatorChar
public void setSeparatorChar(String separatorChar)
getQuoteChar
public String getQuoteChar()
- Specified by:
getQuoteChar in interface DataContextFactoryParameters
setQuoteChar
public void setQuoteChar(String quoteChar)
getEscapeChar
public String getEscapeChar()
- Specified by:
getEscapeChar in interface DataContextFactoryParameters
setEscapeChar
public void setEscapeChar(String escapeChar)
getFailOnInconsistentRowLength
public String getFailOnInconsistentRowLength()
- Specified by:
getFailOnInconsistentRowLength in interface DataContextFactoryParameters
setFailOnInconsistentRowLength
public void setFailOnInconsistentRowLength(String failOnInconsistentRowLength)
getMultilineValues
public String getMultilineValues()
- Specified by:
getMultilineValues in interface DataContextFactoryParameters
setMultilineValues
public void setMultilineValues(String multilineValues)
getTableTypes
public TableType[] getTableTypes()
- Specified by:
getTableTypes in interface DataContextFactoryParameters
setTableTypes
public void setTableTypes(TableType[] tableTypes)
getCatalogName
public String getCatalogName()
- Specified by:
getCatalogName in interface DataContextFactoryParameters
setCatalogName
public void setCatalogName(String catalogName)
getDataSource
public DataSource getDataSource()
- Specified by:
getDataSource in interface DataContextFactoryParameters
setDataSource
public void setDataSource(DataSource dataSource)
getUsername
public String getUsername()
- Specified by:
getUsername in interface DataContextFactoryParameters
setUsername
public void setUsername(String username)
getPassword
public String getPassword()
- Specified by:
getPassword in interface DataContextFactoryParameters
setPassword
public void setPassword(String password)
getDriverClassName
public String getDriverClassName()
- Specified by:
getDriverClassName in interface DataContextFactoryParameters
setDriverClassName
public void setDriverClassName(String driverClassName)
getHostname
public String getHostname()
- Specified by:
getHostname in interface DataContextFactoryParameters
setHostname
public void setHostname(String hostname)
getPort
public Integer getPort()
- Specified by:
getPort in interface DataContextFactoryParameters
setPort
public void setPort(Integer port)
getDatabaseName
public String getDatabaseName()
- Specified by:
getDatabaseName in interface DataContextFactoryParameters
setDatabaseName
public void setDatabaseName(String databaseName)
getTableDefs
public SimpleTableDef[] getTableDefs()
- Specified by:
getTableDefs in interface DataContextFactoryParameters
setTableDefs
public void setTableDefs(SimpleTableDef[] tableDefs)
Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.