| Method from org.apache.openjpa.jdbc.ant.MappingToolTask Detail: |
protected void executeOn(String[] files) throws Exception {
if (MappingTool.ACTION_IMPORT.equals(flags.action))
assertFiles(files);
ClassLoader toolLoader = (ClassLoader) AccessController
.doPrivileged(J2DoPrivHelper
.getClassLoaderAction(MappingTool.class));
ClassLoader loader = toolLoader;
MultiLoaderClassResolver resolver = new MultiLoaderClassResolver();
if (tmpClassLoader) {
loader = (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
.newTemporaryClassLoaderAction(getClassLoader()));
resolver.addClassLoader(loader);
}
resolver.addClassLoader(toolLoader);
if (flags.meta && MappingTool.ACTION_ADD.equals(flags.action))
flags.metaDataFile = Files.getFile(file, loader);
else
flags.mappingWriter = Files.getWriter(file, loader);
flags.schemaWriter = Files.getWriter(schemaFile, loader);
flags.sqlWriter = Files.getWriter(sqlFile, loader);
JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
conf.setClassResolver(resolver);
if (!MappingTool.run(conf, files, flags, loader))
throw new BuildException(_loc.get("bad-conf", "MappingToolTask")
.getMessage());
}
|
protected ConfigurationImpl newConfiguration() {
return new JDBCConfigurationImpl();
}
|
public void setAction(MappingToolTask.Action act) {
flags.action = act.getValue();
}
Set the enumerated MappingTool action type. |
public void setDropSequences(boolean dropSequences) {
flags.dropSequences = dropSequences;
}
Set whether the MappingTool should drop sequences. |
public void setDropTables(boolean dropTables) {
flags.dropTables = dropTables;
}
Set whether the MappingTool should drop tables. |
public void setFile(String file) {
this.file = file;
}
Set the output file we want the MappingTool to write to. |
public void setForeignKeys(boolean fks) {
flags.foreignKeys = fks;
}
Set whether to generate foreign key information. |
public void setIgnoreErrors(boolean ignoreErrors) {
flags.ignoreErrors = ignoreErrors;
}
Set whether we want the MappingTool to ignore SQL errors. |
public void setIndexes(boolean idxs) {
flags.indexes = idxs;
}
Set whether to generate index information. |
public void setMeta(boolean meta) {
flags.meta = meta;
}
Set whether this action applies to metadata as well as mappings. |
public void setOpenJPATables(boolean openjpaTables) {
flags.openjpaTables = openjpaTables;
}
Set whether to drop OpenJPA tables. |
public void setPrimaryKeys(boolean pks) {
flags.primaryKeys = pks;
}
Set whether to generate primary key information. |
public void setReadSchema(boolean readSchema) {
flags.readSchema = readSchema;
}
Set whether the MappingTool should read the full schema. |
public void setSQLFile(String sqlFile) {
this.sqlFile = sqlFile;
}
Set the output file we want the MappingTool to write a SQL script to. |
public void setSchemaAction(MappingToolTask.SchemaAction act) {
flags.schemaAction = act.getValue();
}
Set the enumerated SchemaTool action type. |
public void setSchemaFile(String schemaFile) {
this.schemaFile = schemaFile;
}
Set the output file for an XML representation of the planned schema. |
public void setSequences(boolean sequences) {
flags.sequences = sequences;
}
Set whether the MappingTool should manipulate sequences. |
public void setTmpClassLoader(boolean tmpClassLoader) {
this.tmpClassLoader = tmpClassLoader;
}
|