On 4/5/07, Manos Batsis <[EMAIL PROTECTED]> wrote:
Johann Reyes wrote:
> Right now these two flags exist for the annotations configuration part
> of hibernate. I would like to make it standard, and that means implement
> it in the configuration part of the plugin.
Would that include the case where hibernate mappings are used to feed
hbm2java? Currently if i add the mappings in hibernate.cfg.xml i get
duplicate mapping errors and if i remove them java code is simply not
generated.
The ideal for my case would be to point an hbm directory to the plugin
where the mappings can be found and added to the given hibernate.cfg.xml.
Another issue i have with hibernate.cfg.xml: it uses a datasource to
take advantage of container connection pooling and hbm2ddl bombs as it
cannot find the JNDI context. Is there a way to pass JDBC connection
information to override the datasource during the build?
You should be able to specify database information in a
database.properties file. Here's what I use:
<componentProperties>
<drop>true</drop>
<jdk5>true</jdk5>
<propertyfile>target/test-classes/jdbc.properties</propertyfile>
<configurationfile>src/test/resources/hibernate.cfg.xml</configurationfile>
<skip>${maven.test.skip}</skip>
</componentProperties>
jdbc.properties:
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.connection.username=root
hibernate.connection.password=
hibernate.connection.url=jdbc:mysql://localhost/appfuse?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8
hibernate.connection.driver_class=com.mysql.jdbc.Driver
HTH,
Matt
Manos
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
--
http://raibledesigns.com
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email