From: <one...@us...> - 2003-01-26 01:33:44
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2ddl In directory sc8-pr-cvs1:/tmp/cvs-serv14128/sf/hibernate/tool/hbm2ddl Modified Files: SchemaExport.java SchemaUpdate.java Log Message: redesigned configuration API Index: SchemaExport.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2ddl/SchemaExport.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SchemaExport.java 20 Jan 2003 12:48:16 -0000 1.5 --- SchemaExport.java 26 Jan 2003 01:33:36 -0000 1.6 *************** *** 11,18 **** import java.util.StringTokenizer; - import net.sf.hibernate.Environment; - import net.sf.hibernate.Hibernate; import net.sf.hibernate.HibernateException; ! import net.sf.hibernate.cfg.Datastore; import net.sf.hibernate.connection.ConnectionProvider; import net.sf.hibernate.connection.ConnectionProviderFactory; --- 11,17 ---- import java.util.StringTokenizer; import net.sf.hibernate.HibernateException; ! import net.sf.hibernate.cfg.Configuration; ! import net.sf.hibernate.cfg.Environment; import net.sf.hibernate.connection.ConnectionProvider; import net.sf.hibernate.connection.ConnectionProviderFactory; *************** *** 22,26 **** /** ! * Commandline tool to export table schema for a configured Datastore to the database. */ --- 21,25 ---- /** ! * Commandline tool to export table schema for a configured <tt>Configuration</tt> to the database. */ *************** *** 33,39 **** /** ! * Create a schema exporter for the given Datastore. */ ! public SchemaExport(Datastore ds) throws HibernateException { connectionProperties = Environment.getProperties(); Dialect dialect = Dialect.getDialect(); --- 32,38 ---- /** ! * Create a schema exporter for the given Configuration */ ! public SchemaExport(Configuration ds) throws HibernateException { connectionProperties = Environment.getProperties(); Dialect dialect = Dialect.getDialect(); *************** *** 43,50 **** /** ! * Create a schema exporter for the given Datastore, with the given * database connection properties. */ ! public SchemaExport(Datastore ds, Properties connectionProperties) throws HibernateException { this.connectionProperties = connectionProperties; Dialect dialect = Dialect.getDialect(connectionProperties); --- 42,49 ---- /** ! * Create a schema exporter for the given Configuration, with the given * database connection properties. */ ! public SchemaExport(Configuration ds, Properties connectionProperties) throws HibernateException { this.connectionProperties = connectionProperties; Dialect dialect = Dialect.getDialect(connectionProperties); *************** *** 231,235 **** public static void main(String[] args) { try { ! Datastore ds = Hibernate.createDatastore(); boolean script = true; --- 230,234 ---- public static void main(String[] args) { try { ! Configuration ds = new Configuration(); boolean script = true; *************** *** 268,275 **** String filename = args[i]; if ( filename.endsWith( ".jar" ) ) { ! ds.storeJar(filename); } else { ! ds.storeFile(filename); } } --- 267,274 ---- String filename = args[i]; if ( filename.endsWith( ".jar" ) ) { ! ds.addJar(filename); } else { ! ds.addFile(filename); } } Index: SchemaUpdate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2ddl/SchemaUpdate.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SchemaUpdate.java 24 Jan 2003 13:38:36 -0000 1.4 --- SchemaUpdate.java 26 Jan 2003 01:33:36 -0000 1.5 *************** *** 2,18 **** package net.sf.hibernate.tool.hbm2ddl; ! import net.sf.hibernate.Hibernate; import net.sf.hibernate.HibernateException; ! import net.sf.hibernate.dialect.Dialect; ! import net.sf.hibernate.cfg.Datastore; import net.sf.hibernate.connection.ConnectionProvider; import net.sf.hibernate.connection.ConnectionProviderFactory; ! ! import java.util.*; ! import java.io.FileInputStream; ! import java.sql.*; ! ! import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; /* --- 2,18 ---- package net.sf.hibernate.tool.hbm2ddl; ! import java.io.FileInputStream; ! import java.sql.Connection; ! import java.sql.SQLException; ! import java.sql.Statement; ! import java.util.Properties; ! import net.sf.hibernate.HibernateException; ! import net.sf.hibernate.cfg.Configuration; import net.sf.hibernate.connection.ConnectionProvider; import net.sf.hibernate.connection.ConnectionProviderFactory; ! import net.sf.hibernate.dialect.Dialect; import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; /* *************** *** 27,34 **** Log log = LogFactory.getLog( getClass() ); private ConnectionProvider cp; ! Datastore store; Dialect dialect; ! public SchemaUpdate(Datastore store) throws HibernateException, SQLException { this.store = store; dialect = Dialect.getDialect(); --- 27,34 ---- Log log = LogFactory.getLog( getClass() ); private ConnectionProvider cp; ! Configuration store; Dialect dialect; ! public SchemaUpdate(Configuration store) throws HibernateException, SQLException { this.store = store; dialect = Dialect.getDialect(); *************** *** 36,40 **** } ! public SchemaUpdate(Datastore store, Properties connectionProperties) throws HibernateException { this.store = store; dialect = Dialect.getDialect(connectionProperties); --- 36,40 ---- } ! public SchemaUpdate(Configuration store, Properties connectionProperties) throws HibernateException { this.store = store; dialect = Dialect.getDialect(connectionProperties); *************** *** 45,49 **** try { ! Datastore ds = Hibernate.createDatastore(); boolean script = true; --- 45,49 ---- try { ! Configuration ds = new Configuration(); boolean script = true; *************** *** 60,64 **** } else { ! ds.storeFile(args[i]); } --- 60,64 ---- } else { ! ds.addFile(args[i]); } |