Here's an excerpt of my Ant output that executes without error against HSQLDB according to the output...unfortunately, there's no actual update against the DB (even though export="true"), and I can't figure out why!?!?
When the hbm2ddl task completes, in my [i]data[/i] folder there's the DDL file, and 3 other files for my testdb database:
- testdb.lck
- testdb.log
- testdb.properties
What's interesting is that testdb.log only has one statement in it, and it's the following:
CREATE USER SA PASSWORD "" ADMIN
Shouldn't I be seeing the DDL statements in there too?
I've also included below the hibernate.cfg.xml, the single mapping file, and hbm2ddl task...the DDL statements can be seen in the Ant output. Please help...I've really hit a wall here...
Thanks.
[b]Excerpt of Ant output:[/b]
[code][hibernatetool] 14:11:08,531 INFO SchemaExport:152 - Running hbm2ddl schema export
[hibernatetool] 14:11:08,546 DEBUG SchemaExport:168 - import file not found: /import.sql
[hibernatetool] 14:11:08,562 INFO SchemaExport:172 - writing generated schema to file: C:\Documents and Settings\Admin\My Documents\Workspace\Test\data\createdb.ddl
[hibernatetool] 14:11:08,562 INFO SchemaExport:177 - exporting generated schema to database
[hibernatetool] 14:11:08,578 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
[hibernatetool] 14:11:08,578 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
[hibernatetool] 14:11:08,578 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
[hibernatetool] 14:11:08,578 INFO DriverManagerConnectionProvider:80 - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:file:C:/Documents and Settings/Admin/My Documents/Workspace/Test/data/testdb
[hibernatetool] 14:11:08,578 INFO DriverManagerConnectionProvider:83 - connection properties: {user=sa, password=}
[hibernatetool] 14:11:08,578 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
[hibernatetool] 14:11:08,578 DEBUG DriverManagerConnectionProvider:109 - opening new JDBC connection
[hibernatetool] 14:11:09,062 DEBUG DriverManagerConnectionProvider:115 - created connection to: jdbc:hsqldb:file:C:/Documents and Settings/Admin/My Documents/Workspace/Test/data/testdb, Isolation Level: 2
[hibernatetool] drop table Pet if exists;
[hibernatetool] 14:11:09,078 DEBUG SchemaExport:301 -
[hibernatetool] drop table Pet if exists;
[hibernatetool] drop table hibernate_unique_key if exists;
[hibernatetool] 14:11:09,078 DEBUG SchemaExport:301 -
[hibernatetool] drop table hibernate_unique_key if exists;
[hibernatetool] create table Pet (
[hibernatetool] ID integer not null,
[hibernatetool] name varchar(255),
[hibernatetool] primary key (ID)
[hibernatetool] );
[hibernatetool] 14:11:09,093 DEBUG SchemaExport:301 -
[hibernatetool] create table Pet (
[hibernatetool] ID integer not null,
[hibernatetool] name varchar(255),
[hibernatetool] primary key (ID)
[hibernatetool] );
[hibernatetool] create table hibernate_unique_key (
[hibernatetool] next_hi integer
[hibernatetool] );
[hibernatetool] 14:11:09,093 DEBUG SchemaExport:301 -
[hibernatetool] create table hibernate_unique_key (
[hibernatetool] next_hi integer
[hibernatetool] );
[hibernatetool] insert into hibernate_unique_key values ( 0 );
[hibernatetool] 14:11:09,093 DEBUG SchemaExport:301 -
[hibernatetool] insert into hibernate_unique_key values ( 0 );
[hibernatetool] 14:11:09,125 INFO SchemaExport:194 - schema export complete
[hibernatetool] 14:11:09,125 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
[hibernatetool] 14:11:09,125 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:hsqldb:file:C:/Documents and Settings/Admin/My Documents/Workspace/Test/data/testdb
BUILD SUCCESSFUL
Total time: 5 seconds[/code]
[b]Ant target:[/b]
[code] <target name="schemaexport" depends="preparecompile">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project.classpath" />
<hibernatetool destdir="data">
<configuration configurationfile="src/hibernate.cfg.xml" />
<hbm2ddl export="true" update="false" drop="false" create="false" delimiter=";" outputfilename="createdb.ddl" format="true" />
</hibernatetool>
</target>[/code]
[b]hibernate.cfg.xml:[/b]
[code]<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.url">jdbc:hsqldb:file:C:/Documents and Settings/Admin/My Documents/Workspace/Test/data/testdb</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="top/Pet.hbm.xml"/>
</session-factory>
</hibernate-configuration>[/code]
[b]Only mapping file:[/b]
[code]<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="top">
<class name="Pet">
<id name="id" column="ID" type="int">
<generator class="hilo">
</generator>
</id>
<property name="name" type="java.lang.String"/>
</class>
</hibernate-mapping>[/code][/i][/i]
|