Hello Sylvian

Yes, I would be interested to take a look, I'll gladly accept the help. And
don't worry, the implementation I think would be fairly easy since I know
when a person is using annotations or not.

Thanks

Johann Reyes

-----Original Message-----
From: Sylvain Vieujot [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 21, 2006 11:39 AM
To: Maven Users List
Subject: RE: Problem hibernate3 plugin cfg2cfgxml

I did a private maven plugin that does just that : Fetch the annotations
and add the <mapping class="..."/> to an hibernate.cfg.xml file.
It would need to be a bite polished to go in a public repository, but if
you're interested, I could review it a bite to contribute it.

It works only for annotations though, but it can be combined with the
xdoclet plugin for the one that need to mix them

Best regards,

Sylvain Vieujot.

On Tue, 2006-03-21 at 08:39 -0500, Johann Reyes wrote:

> Hello Taavi
> 
> Right now, hibernate-tools supports creation of hibernate.cfg.xml with
> mappings automatically only with hbm.xml files. I'll check if they are
> planning to support Annotations this way too, but at the moment is not
> supported.
> 
> Regards
> 
> Johann Reyes
> 
> -----Original Message-----
> From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, March 21, 2006 8:33 AM
> To: Maven Users List
> Subject: Re: Problem hibernate3 plugin cfg2cfgxml
> 
> Hey,
> 
> But is there any way to create hibernate.cfg.xml with mappings 
> automatically or I really write it manually?
> Maby same ant task, or other tool, preferably maven 2 :)
> 
> Taavi
> 
> 
> Johann Reyes wrote:
> > Hello Taavi
> > 
> > Ahh sorry, my mistake, I run my test, but I had the a hibernate.cfg.xml
> > al;ready setup and didn't notice that. After doing a little more
research,
> > the goal cfg2cfgxml is more for hbm files, since annotated classes there
> is
> > no other way around that to have it specified in a hibernate.cfg.xml
file
> as
> > per
> > 
> >
>
http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#setu
> > p-configuration
> > 
> > As it states there is no other way around. I'll keep looking into it to
> see
> > if I can find a workaround but for that moment I have to say that you
need
> > to initially have a hibernate.cfg.xml file before using annotations with
> > hibernate.
> > 
> > Regards
> > 
> > Johann Reyes
> > 
> > 
> > 
> > 
> > -----Original Message-----
> > From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, March 21, 2006 2:27 AM
> > To: Johann Reyes; users@maven.apache.org
> > Subject: Re: Problem hibernate3 plugin cfg2cfgxml
> > 
> > Thank you Johann for so quick answer.
> > 
> > Yes a have set the ejb3 to true.
> > Here is my pom.xml configuration:
> > 
> >   <build>
> >      <plugins>
> >        <plugin>
> >          <groupId>org.apache.maven.plugins</groupId>
> >          <artifactId>maven-compiler-plugin</artifactId>
> >          <configuration>
> >            <source>1.5</source>
> >            <target>1.5</target>
> >          </configuration>
> >        </plugin>
> >        <plugin>
> >          <groupId>org.codehaus.mojo</groupId>
> >          <artifactId>hibernate3-maven-plugin</artifactId>
> >          <configuration>
> >            <ejb3>true</ejb3>
> >            <config>
> >              /target/hibernatetools/hibernate.cfg.xml
> >            </config>
> >            <jdk5>true</jdk5>
> >            <outputFile>
> >              target/hibernatetools/db-schema.sql
> >            </outputFile>
> >            <properties>
> >              /src/main/resources/hibernate.properties
> >            </properties>
> >          </configuration>
> >        </plugin>
> >      </plugins>
> > 
> >      <extensions>
> >        <extension>
> >          <groupId>oracle</groupId>
> >          <artifactId>jdbc</artifactId>
> >          <version>10.2.0.1.0</version>
> >        </extension>
> >      </extensions>
> > 
> >    </build>
> > 
> > And hibernate properties is following:
> > 
> > hibernate.connection.driver_class = oracle.jdbc.driver.OracleDriver
> > hibernate.connection.url = jdbc:oracle:thin:@localhost:1521:orcl
> > hibernate.connection.username = blablah
> > hibernate.connection.password = blablah
> > hibernate.dialect = org.hibernate.dialect.Oracle9Dialect
> > 
> > 
> > Can you suggest what else could be wrong?
> > 
> > 
> > Taavi
> > 
> > 
> > Johann Reyes wrote:
> >> Hello Taavi
> >>
> >> Did you set the ejb3 parameter to true?
> >>
> >> You can see an example here:
> >>
> >>
> >
>
https://svn.mojo.codehaus.org/mojo/trunk/mojo/mojo-sandbox/hibernate3-maven-
> >> plugin/src/test/project-jdk15/pom.xml
> >>
> >> Regards
> >>
> >> Johann Reyes
> >>
> >> -----Original Message-----
> >> From: Taavi Sildeberg [mailto:[EMAIL PROTECTED] 
> >> Sent: Monday, March 20, 2006 5:30 AM
> >> To: Maven Users List
> >> Subject: Problem hibernate3 plugin cfg2cfgxml
> >>
> >> Hello,
> >>
> >> I have a three java files with annotations. When I try to generate the 
> >> hibernate.cfg.xml with maven.hibernte3.plugin, then the mapped classes 
> >> are never included inside hibernate.cfg.xml file. If I add them manualy

> >> then hbm2ddl works fine.
> >> In the plugin manual is that hibernate3:cfg2cfgxml generates 
> >> hibernate.cfg.xml. file
> >>
> >> Can someone suggest what I am doing wrong?
> >>
> >>
> >> Taavi
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >>
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to