-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: hbm2dll outpur not formatted
PostPosted: Fri Mar 17, 2006 6:43 am 
Regular
Regular

Joined: Tue Jul 13, 2004 2:27 am
Posts: 73
Location: Singapore
I upgraded to Hibernate 3.1.2 and now the hbm2dll output is not formatted as what H2 did before. the table definition is on one long line instead of something like this in H2:

create table ORGS (
ORG_ID bigint not null auto_increment,
NAME varchar(255) not null,
DESCR varchar(255),
ISDELETED bit,
CREATE_TIME datetime,
MODIFY_TIME datetime,
primary key (ORG_ID)
);


I am using Hibernate Tool 3.1 beta 4, running Ant task.
any reason why ?

thanks
lixin

build.xml
------------
<?xml version="1.0"?>

<project name="Canal" default="schemaexport" basedir=".">

<property name="build.dir" value="../../classes"/>
<property name="resource.dir" value="../resources"/>

<path id="libs">
<fileset dir="../../lib">
<include name="**/*.jar"/>
<include name="**/*.properties"/>
</fileset>
</path>

<target name="schemaexport">
<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask">
<classpath refid="libs"/>
<classpath path="${build.dir}"/>
</taskdef>

<schemaexport
properties="${resource.dir}/hibernate.properties"
quiet="no"
text="yes"
drop="no"
delimiter=";"
output="db-schema.sql">
<fileset dir="../">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>


</target>

</project>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 7:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
format="true"

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 6:41 pm 
Regular
Regular

Joined: Tue Jul 13, 2004 2:27 am
Posts: 73
Location: Singapore
i tried. but got error message saying that <schemaexport> does not support the attribute <format>

something is wrong.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 11:44 pm 
Regular
Regular

Joined: Tue Jul 13, 2004 2:27 am
Posts: 73
Location: Singapore
this one finally works after working the whole morning !

hibernate.properties
===============

hibernate.query.substitutions yes 'Y', no 'N'


## MySQL

hibernate.dialect org.hibernate.dialect.MySQLDialect
#hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
#hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost/canalDB
hibernate.connection.username root
hibernate.connection.password root


build.xml
=======
<?xml version="1.0"?>

<project name="Canal" default="schemaexport" basedir=".">

<property name="build.dir" value="../../classes"/>
<property name="resource.dir" value="../resources"/>

<path id="classpath">
<fileset dir="C:/Canal/eclipse/workspace/Canal/WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="C:/Canal/eclipse/plugins/org.hibernate.eclipse_3.1.0.beta4">
<include name="**/*.jar"/>
</fileset>
</path>

<target name="schemaexport">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="classpath"/>

<hibernatetool destdir=".">
<classpath>
<path refid="classpath"/>
<pathelement path="${build.dir}"/>
</classpath>
<configuration propertyfile="${resource.dir}/hibernate.properties">
<fileset dir="../">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbm2ddl
drop="false"
create="false"
delimiter=";"
outputfilename="db-schema.sql"
format="true">
</hbm2ddl>

</hibernatetool>

</target>

</project>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 11:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I were just about suggesting you to try and use hbm2ddl from tools..

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.