Johann Reyes wrote:
> Mike,
> Yes I just noticed that, thanks for pointing that out. Farrukh, I thought
> you wanted to generate from your database since I saw the implementation for
> your hbm2ddl goal is jdbcconfiguration. That's your problem, it should be
> just "configuration".
>
That was it. Thanks Johann and Mike!
BTW after that fix I was getting a "Duplicate class/entity mapping" error.
The reason was that somehow my mapping was being read more than once.
This was likely due to my using the maven-hyperjaxb2-plugin.
To fix this, I had to comment out configurationfile property and give a
bogus filepattern as hown below:
<!--configurationfile>target/jaxb-source/hibernate.cfg.xml</configurationfile-->
<filepattern>**/*hbmxxx.xml</filepattern>
Thanks again. You guys are the best :-)
> Regards
>
> Johann Reyes
>
> -----Original Message-----
> From: Farrukh S. Najmi [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 22, 2007 2:24 PM
> To: [email protected]
> Subject: Re: [mojo-user] hibernate3:hbm2ddl producing empty SQL file
>
>
> Dear hausemates,
>
> Thanks for the many helpful suggestions on my problem. Here is my
> findings...
>
> First, I am not generating DDL from database as someone thought.
> I am generating hibernate mappings from XML Schema using hyperjaxb2 (way
> cool tool).
> I then wish to use hibernate3:ddl2hbm goal to generate DDL to a file if
> so needed.
> My source is .hbm.xml files generated by hyperjaxb2 and my desired
> target is an sql file
> with DDL statements.
>
> Changing the outputfilename as Johann suggested had no impact other
> than moving the location of the empty file that was generated.
> It was still empty.
>
> Adding " <filepattern>**/*hbm.xml</filepattern>" as Mike suggested did
> not have any noticeable impact.
> Also it shoudl be noted that my hibernate.xfg.xml file already was
> referencing all my hbm files:
>
> <configurationfile>target/jaxb-source/hibernate.cfg.xml</configurationfile>
>
> Here is what it looked like....
>
> <hibernate-configuration>
> <session-factory>
> <mapping resource="x.y.z/FooType.hbm.xml"/>
> ...
> </hibernate-configuration>
>
> Any other ideas? Does my log file with debug output in previous email
> have any clues?
>
> Thanks very much for your help.
>
> Mike Ball wrote:
>
>> I think you need to specify your hbms, this works for me, notice the
>> <filepattern>:
>> <plugin>
>> <groupId>org.codehaus.mojo</groupId>
>> <artifactId>hibernate3-maven-plugin</artifactId>
>> <version>2.0-SNAPSHOT</version>
>> <configuration>
>> <components>
>> <component>
>> <name>hbm2ddl</name>
>> <implementation>configuration</implementation>
>> </component>
>> </components>
>> <componentProperties>
>> <drop>true</drop>
>>
>> <propertyfile>src/main/resources/database.properties</propertyfile>
>> <outputfilename>/target/schema.sql</outputfilename>
>> <export>false</export>
>> <filepattern>**/*hbm.xml</filepattern>
>> </componentProperties>
>> </configuration>
>> </plugin>
>>
>> On 2/22/07, Farrukh S. Najmi <[EMAIL PROTECTED]> wrote:
>>
>>> I am having no luck trying to generate DDL from my hbm files using the
>>> hibernate3 plugin.
>>> Attached is my pom file (which also uses hyperjaxb2 plugin).
>>>
>>> I run hibernate3:hbm2ddl goal as follows:
>>>
>>> mvn -e --debug hibernate3:hbm2ddl
>>>
>>> I saved the output and attached it here as hb.log
>>>
>>> The result is that there is no sql file ouput other than the empty file:
>>>
>>> ./target/hibernate3/sql/target/schema.sql
>>>
>>> I was unable to find a solution to this in the archives. Thanks for your
>>> help.
>>>
>>> --
>>>
>
>
>
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email