net.sf.basedb.core.hibernate
Class SchemaGenerator
java.lang.Object
net.sf.basedb.core.hibernate.SchemaGenerator
- All Implemented Interfaces:
- Work
public class SchemaGenerator
- extends Object
- implements Work
Replaces the Hibernate SchemaExport and SchemaUpdate tools. We need
this to be able to intercept and modify some of the SQL statments that
Hibernate generates since they don't always work as expected.
In particular, since Hibernate 3.5 they generate "not null" constraints for
columns that are added to existing tables and we don't want that.
- Since:
- 2.16
- Author:
- Nicklas
- Last modified
- $Date: 2011-11-25 13:07:04 +0100 (Fri, 25 Nov 2011) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final org.apache.log4j.Logger log
cfg
private final Configuration cfg
dialect
private final Dialect dialect
dbEngine
private final DbEngine dbEngine
mode
private final SchemaGenerator.Mode mode
progress
private final ProgressReporter progress
ignoredSql
private List<String> ignoredSql
SchemaGenerator
public SchemaGenerator(Configuration cfg,
Dialect dialect,
DbEngine dbEngine,
SchemaGenerator.Mode mode,
ProgressReporter progress)
- Create a new schema generator.
- Parameters:
cfg
- The current configurationdialect
- The dialect of the database we are connecting todbEngine
- The DbEngine for the database we are connecting tomode
- The installation modeprogress
- An optional progress reporter
execute
public void execute(Connection connection)
throws SQLException
- Specified by:
execute
in interface Work
- Throws:
SQLException
getIgnoredSql
public List<String> getIgnoredSql()
- Get a list with the SQL statements that was ignored in the last run.
- Returns:
- A list or null if the generator hasn't been executed
- Since:
- 3.1