public class MetaDataExporter
extends java.lang.Object
Example
MetaDataExporter exporter = new MetaDataExporter(); exporter.setPackageName("com.example.domain"); exporter.setTargetFolder(new File("target/generated-sources/java")); exporter.export(connection.getMetaData());
Constructor and Description |
---|
MetaDataExporter() |
Modifier and Type | Method and Description |
---|---|
protected EntityType |
createEntityType(java.lang.String schemaName,
java.lang.String tableName,
java.lang.String className) |
protected Property |
createProperty(EntityType classModel,
java.lang.String columnName,
java.lang.String propertyName,
com.mysema.codegen.model.Type typeModel) |
void |
export(java.sql.DatabaseMetaData md)
Export the tables based on the given database metadata
|
void |
setBeanPackageName(java.lang.String beanPackageName)
Override the bean package name (default: packageName)
|
void |
setBeanPrefix(java.lang.String beanPrefix)
Override the bean prefix for the classes (default: "")
|
void |
setBeanSerializer(Serializer beanSerializer)
Set the Bean serializer to create bean types as well
|
void |
setBeanSerializerClass(java.lang.Class<? extends Serializer> beanSerializerClass)
Set the Bean serializer class to create bean types as well
|
void |
setBeanSuffix(java.lang.String beanSuffix)
Override the bean suffix for the classes (default: "")
|
void |
setColumnAnnotations(boolean columnAnnotations) |
void |
setConfiguration(Configuration configuration)
Override the configuration
|
void |
setCreateScalaSources(boolean createScalaSources)
Set true to create Scala sources instead of Java sources
|
void |
setExportTables(boolean exportTables) |
void |
setExportViews(boolean exportViews) |
void |
setInnerClassesForKeys(boolean innerClassesForKeys) |
void |
setLowerCase(boolean lowerCase) |
void |
setNamePrefix(java.lang.String namePrefix)
Override the name prefix for the classes (default: Q)
|
void |
setNameSuffix(java.lang.String nameSuffix)
Override the name suffix for the classes (default: "")
|
void |
setNamingStrategy(NamingStrategy namingStrategy)
Override the NamingStrategy (default: new DefaultNamingStrategy())
|
void |
setPackageName(java.lang.String packageName)
Set the package name
|
void |
setSchemaPattern(java.lang.String schemaPattern)
Set the schema pattern filter to be used
|
void |
setSchemaToPackage(boolean schemaToPackage) |
void |
setSerializerClass(java.lang.Class<? extends Serializer> serializerClass) |
void |
setSourceEncoding(java.lang.String sourceEncoding) |
void |
setTableNamePattern(java.lang.String tableNamePattern)
Set the table name pattern filter to be used
|
void |
setTargetFolder(java.io.File targetFolder)
Set the target folder
|
void |
setTypeMappings(TypeMappings typeMappings) |
void |
setValidationAnnotations(boolean validationAnnotations) |
protected EntityType createEntityType(@Nullable java.lang.String schemaName, java.lang.String tableName, java.lang.String className)
protected Property createProperty(EntityType classModel, java.lang.String columnName, java.lang.String propertyName, com.mysema.codegen.model.Type typeModel)
public void export(java.sql.DatabaseMetaData md) throws java.sql.SQLException
md
- java.sql.SQLException
public void setSchemaPattern(@Nullable java.lang.String schemaPattern)
schemaPattern
- a schema name pattern; must match the schema name
as it is stored in the database; "" retrieves those without a schema;
null
means that the schema name should not be used to narrow
the search (default: null)public void setTableNamePattern(@Nullable java.lang.String tableNamePattern)
tableNamePattern
- a table name pattern; must match the
table name as it is stored in the database (default: null)public void setConfiguration(Configuration configuration)
configuration
- override configuration for custom type mappings etcpublic void setCreateScalaSources(boolean createScalaSources)
createScalaSources
- whether to create Scala sources (default: false)public void setTargetFolder(java.io.File targetFolder)
targetFolder
- target source folder to create the sources into
(e.g. target/generated-sources/java)public void setPackageName(java.lang.String packageName)
packageName
- package name for sourcespublic void setBeanPackageName(@Nullable java.lang.String beanPackageName)
beanPackageName
- public void setNamePrefix(java.lang.String namePrefix)
namePrefix
- name prefix for query-types (default: Q)public void setNameSuffix(java.lang.String nameSuffix)
nameSuffix
- name suffix for query-types (default: "")public void setBeanPrefix(java.lang.String beanPrefix)
beanPrefix
- bean prefix for bean-types (default: "")public void setBeanSuffix(java.lang.String beanSuffix)
beanSuffix
- bean suffix for bean-types (default: "")public void setNamingStrategy(NamingStrategy namingStrategy)
namingStrategy
- namingstrategy to override (default: new DefaultNamingStrategy())public void setBeanSerializer(@Nullable Serializer beanSerializer)
beanSerializer
- serializer for JavaBeans (default: null)public void setBeanSerializerClass(java.lang.Class<? extends Serializer> beanSerializerClass)
beanSerializer
- serializer for JavaBeans (default: null)public void setInnerClassesForKeys(boolean innerClassesForKeys)
innerClassesForKeys
- public void setSerializerClass(java.lang.Class<? extends Serializer> serializerClass)
serializerClass
- public void setTypeMappings(TypeMappings typeMappings)
typeMappings
- public void setColumnAnnotations(boolean columnAnnotations)
columnAnnotations
- public void setValidationAnnotations(boolean validationAnnotations)
validationAnnotations
- public void setSourceEncoding(java.lang.String sourceEncoding)
sourceEncoding
- public void setSchemaToPackage(boolean schemaToPackage)
schemaToPackage
- public void setLowerCase(boolean lowerCase)
lowerCase
- public void setExportTables(boolean exportTables)
exportTables
- public void setExportViews(boolean exportViews)
exportViews
- Copyright © 2007-2013 Mysema Ltd. All Rights Reserved.