public class DataContextFactory extends Object
DataContext
Modifier and Type | Field and Description |
---|---|
static char |
DEFAULT_CSV_QUOTE_CHAR |
static char |
DEFAULT_CSV_SEPARATOR_CHAR |
Modifier and Type | Method and Description |
---|---|
static DataContext |
createCassandraDataContext(com.datastax.driver.core.Cluster cluster,
String keySpaceName)
Creates a new Cassandra datacontext.
|
static DataContext |
createCompositeDataContext(Collection<DataContext> delegates)
Creates a composite DataContext based on a set of delegate DataContexts.
|
static DataContext |
createCompositeDataContext(DataContext... delegates)
Creates a composite DataContext based on a set of delegate DataContexts.
|
static UpdateableDataContext |
createCouchDbDataContext(String hostname,
Integer port,
String username,
String password)
Creates a new CouchDB datacontext.
|
static UpdateableDataContext |
createCouchDbDataContext(String hostname,
Integer port,
String username,
String password,
SimpleTableDef[] tableDefs)
Creates a new CouchDB datacontext.
|
static UpdateableDataContext |
createCsvDataContext(File file)
Creates a DataContext based on a CSV file
|
static UpdateableDataContext |
createCsvDataContext(File file,
char separatorChar,
char quoteChar)
Creates a DataContext based on a CSV file
|
static UpdateableDataContext |
createCsvDataContext(File file,
char separatorChar,
char quoteChar,
String encoding)
Creates a DataContext based on a CSV file
|
static UpdateableDataContext |
createCsvDataContext(File file,
CsvConfiguration configuration)
Creates a DataContext based on a CSV file
|
static DataContext |
createCsvDataContext(InputStream inputStream,
char separatorChar,
char quoteChar)
Creates a DataContext based on CSV-content through an input stream
|
static DataContext |
createCsvDataContext(InputStream inputStream,
char separatorChar,
char quoteChar,
String encoding)
Creates a DataContext based on CSV-content through an input stream
|
static DataContext |
createCsvDataContext(InputStream inputStream,
CsvConfiguration configuration)
Creates a DataContext based on CSV-content through an input stream
|
static UpdateableDataContext |
createElasticSearchDataContext(org.elasticsearch.client.Client client,
String indexName)
Creates a new ElasticSearch datacontext.
|
static UpdateableDataContext |
createElasticSearchDataContext(io.searchbox.client.JestClient client,
String indexName)
Creates a new JSON-based ElasticSearch datacontext.
|
static UpdateableDataContext |
createExcelDataContext(File file)
Creates a DataContext based on an Excel spreadsheet file
|
static UpdateableDataContext |
createExcelDataContext(File file,
ExcelConfiguration configuration)
Creates a DataContet based on an Excel spreadsheet file
|
static DataContext |
createFixedWidthDataContext(File file,
FixedWidthConfiguration configuration)
Creates a DataContext based on a fixed width file.
|
static DataContext |
createFixedWidthDataContext(File file,
String fileEncoding,
int fixedValueWidth)
Creates a DataContext based on a fixed width file.
|
static DataContext |
createFixedWidthDataContext(File file,
String fileEncoding,
int fixedValueWidth,
int headerLineNumber)
Creates a DataContext based on a fixed width file.
|
static UpdateableDataContext |
createJdbcDataContext(Connection connection)
Creates a DataContext based on a JDBC connection
|
static UpdateableDataContext |
createJdbcDataContext(Connection connection,
String catalogName)
Creates a DataContext based on a JDBC connection
|
static UpdateableDataContext |
createJdbcDataContext(Connection connection,
String catalogName,
TableType[] tableTypes)
Creates a DataContext based on a JDBC connection
|
static UpdateableDataContext |
createJdbcDataContext(Connection connection,
TableType... tableTypes)
Creates a DataContext based on a JDBC connection
|
static UpdateableDataContext |
createJdbcDataContext(DataSource ds)
Creates a DataContext based on a JDBC datasource
|
static UpdateableDataContext |
createJdbcDataContext(DataSource ds,
String catalogName)
Creates a DataContext based on a JDBC datasource
|
static UpdateableDataContext |
createJdbcDataContext(DataSource ds,
String catalogName,
TableType[] tableTypes)
Creates a DataContext based on a JDBC datasource
|
static UpdateableDataContext |
createJdbcDataContext(DataSource ds,
TableType... tableTypes)
Creates a DataContext based on a JDBC datasource
|
static DataContext |
createJsonDataContext(File file)
Creates a DataContext based on a JSON file
|
static UpdateableDataContext |
createMongoDbDataContext(String hostname,
Integer port,
String databaseName,
String username,
char[] password)
Creates a new MongoDB datacontext.
|
static UpdateableDataContext |
createMongoDbDataContext(String hostname,
Integer port,
String databaseName,
String username,
char[] password,
SimpleTableDef[] tableDefs)
Creates a new MongoDB datacontext.
|
static DataContext |
createOpenOfficeDataContext(File file)
Creates a DataContext based on an OpenOffice.org database file.
|
static DataContext |
createSalesforceDataContext(String username,
String password,
String securityToken)
Creates a DataContext that connects to a Salesforce.com instance.
|
static DataContext |
createSugarCrmDataContext(String baseUrl,
String username,
String password,
String applicationName)
Create a DataContext that connects to a SugarCRM system.
|
static DataContext |
createXmlDataContext(File file,
boolean autoFlattenTables)
Creates a DataContext based on XML-content from a File.
|
static DataContext |
createXmlDataContext(InputSource inputSource,
String schemaName,
boolean autoFlattenTables)
Creates a DataContext based on XML-content from an input source.
|
static DataContext |
createXmlDataContext(URL url,
boolean autoFlattenTables)
Creates a DataContext based on XML-content from a URL.
|
public static final char DEFAULT_CSV_SEPARATOR_CHAR
public static final char DEFAULT_CSV_QUOTE_CHAR
public static DataContext createCompositeDataContext(DataContext... delegates)
delegates
- an array/var-args of delegate DataContextspublic static DataContext createCompositeDataContext(Collection<DataContext> delegates)
delegates
- a collection of delegate DataContextspublic static DataContext createSalesforceDataContext(String username, String password, String securityToken)
username
- the Salesforce usernamepassword
- the Salesforce passwordsecurityToken
- the Salesforce security tokenpublic static DataContext createSugarCrmDataContext(String baseUrl, String username, String password, String applicationName)
baseUrl
- the base URL of the system, e.g. http://localhost/sugarcrmusername
- the SugarCRM usernamepassword
- the SugarCRM passwordapplicationName
- the name of the application you are connecting withpublic static UpdateableDataContext createCsvDataContext(File file)
file
- a CSV filepublic static DataContext createJsonDataContext(File file)
public static UpdateableDataContext createCsvDataContext(File file, char separatorChar, char quoteChar)
file
- a CSV fileseparatorChar
- the char to use for separating valuesquoteChar
- the char used for quoting values (typically if they include
the separator char)public static UpdateableDataContext createCsvDataContext(File file, char separatorChar, char quoteChar, String encoding)
file
- a CSV fileseparatorChar
- the char to use for separating valuesquoteChar
- the char used for quoting values (typically if they include
the separator char)encoding
- the character encoding of the filepublic static UpdateableDataContext createCsvDataContext(File file, CsvConfiguration configuration)
file
- a CSV fileconfiguration
- the CSV configuration to usepublic static DataContext createCsvDataContext(InputStream inputStream, char separatorChar, char quoteChar)
inputStream
- the input stream to read fromseparatorChar
- the char to use for separating valuesquoteChar
- the char used for quoting values (typically if they include
the separator char)public static DataContext createCsvDataContext(InputStream inputStream, char separatorChar, char quoteChar, String encoding)
inputStream
- the input stream to read fromseparatorChar
- the char to use for separating valuesquoteChar
- the char used for quoting values (typically if they include
the separator char)public static DataContext createCsvDataContext(InputStream inputStream, CsvConfiguration configuration)
inputStream
- the input stream to read fromconfiguration
- the CSV configuration to usepublic static DataContext createFixedWidthDataContext(File file, String fileEncoding, int fixedValueWidth)
file
- the file to read from.fileEncoding
- the character encoding of the file.fixedValueWidth
- the (fixed) width of values in the file.public static DataContext createFixedWidthDataContext(File file, FixedWidthConfiguration configuration)
file
- the file to read from.configuration
- the fixed width configuration to usepublic static DataContext createFixedWidthDataContext(File file, String fileEncoding, int fixedValueWidth, int headerLineNumber)
file
- the file to read from.fileEncoding
- the character encoding of the file.fixedValueWidth
- the (fixed) width of values in the file.headerLineNumber
- the line number of the column headers.public static UpdateableDataContext createExcelDataContext(File file, ExcelConfiguration configuration)
file
- an excel spreadsheet fileconfiguration
- the configuration with metadata for reading the spreadsheetpublic static UpdateableDataContext createExcelDataContext(File file)
file
- an Excel spreadsheet filepublic static DataContext createXmlDataContext(InputSource inputSource, String schemaName, boolean autoFlattenTables)
inputSource
- an input source feeding XML contentschemaName
- the name to be used for the main schemaautoFlattenTables
- a boolean indicating if MetaModel should flatten very simple
table structures (where tables only contain a single
data-carrying column) for greater usability of the generated
table-based modelpublic static DataContext createXmlDataContext(File file, boolean autoFlattenTables)
file
- the File to use for feeding XML contentautoFlattenTables
- a boolean indicating if MetaModel should flatten very simple
table structures (where tables only contain a single
data-carrying column) for greater usability of the generated
table-based modelpublic static DataContext createXmlDataContext(URL url, boolean autoFlattenTables)
url
- the URL to use for feeding XML contentautoFlattenTables
- a boolean indicating if MetaModel should flatten very simple
table structures (where tables only contain a single
data-carrying column) for greater usability of the generated
table-based modelpublic static DataContext createOpenOfficeDataContext(File file)
file
- an OpenOffice.org database filepublic static UpdateableDataContext createJdbcDataContext(Connection connection)
connection
- a JDBC connectionpublic static UpdateableDataContext createJdbcDataContext(DataSource ds)
ds
- a JDBC datasourcepublic static UpdateableDataContext createJdbcDataContext(Connection connection, String catalogName)
connection
- a JDBC connectioncatalogName
- a catalog name to usepublic static UpdateableDataContext createJdbcDataContext(Connection connection, TableType... tableTypes)
connection
- a JDBC connectiontableTypes
- the types of tables to include in the generated schemaspublic static UpdateableDataContext createJdbcDataContext(Connection connection, String catalogName, TableType[] tableTypes)
connection
- a JDBC connectioncatalogName
- a catalog name to usetableTypes
- the types of tables to include in the generated schemaspublic static UpdateableDataContext createJdbcDataContext(DataSource ds, TableType... tableTypes)
ds
- a JDBC datasourcetableTypes
- the types of tables to include in the generated schemaspublic static UpdateableDataContext createJdbcDataContext(DataSource ds, String catalogName, TableType[] tableTypes)
ds
- a JDBC datasourcecatalogName
- a catalog name to usetableTypes
- the types of tables to include in the generated schemaspublic static UpdateableDataContext createJdbcDataContext(DataSource ds, String catalogName)
ds
- a JDBC datasourcecatalogName
- a catalog name to usepublic static UpdateableDataContext createMongoDbDataContext(String hostname, Integer port, String databaseName, String username, char[] password, SimpleTableDef[] tableDefs)
hostname
- The hostname of the MongoDB instanceport
- the port of the MongoDB instance, or null if the default port
should be used.databaseName
- the name of the databaseusername
- the username, or null if unauthenticated access should be usedpassword
- the password, or null if unathenticated access should be usedtableDefs
- an array of table definitions, or null if table definitions
should be autodetected.public static UpdateableDataContext createMongoDbDataContext(String hostname, Integer port, String databaseName, String username, char[] password)
hostname
- The hostname of the MongoDB instanceport
- the port of the MongoDB instance, or null if the default port
should be used.databaseName
- the name of the databaseusername
- the username, or null if unauthenticated access should be usedpassword
- the password, or null if unathenticated access should be usedpublic static UpdateableDataContext createCouchDbDataContext(String hostname, Integer port, String username, String password)
hostname
- The hostname of the CouchDB instanceport
- the port of the CouchDB instance, or null if the default port
should be used.username
- the username, or null if unauthenticated access should be usedpassword
- the password, or null if unathenticated access should be usedpublic static UpdateableDataContext createCouchDbDataContext(String hostname, Integer port, String username, String password, SimpleTableDef[] tableDefs)
hostname
- The hostname of the CouchDB instanceport
- the port of the CouchDB instance, or null if the default port
should be used.username
- the username, or null if unauthenticated access should be usedpassword
- the password, or null if unathenticated access should be usedtableDefs
- an array of table definitions, or null if table definitions
should be autodetected.public static UpdateableDataContext createElasticSearchDataContext(io.searchbox.client.JestClient client, String indexName)
client
- The Jest clientindexName
- The ElasticSearch index namepublic static UpdateableDataContext createElasticSearchDataContext(org.elasticsearch.client.Client client, String indexName)
client
- The ElasticSearch clientindexName
- The ElasticSearch index namepublic static DataContext createCassandraDataContext(com.datastax.driver.core.Cluster cluster, String keySpaceName)
cluster
- The Cassandra clientkeySpaceName
- The Cassandra key space nameCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.