-
1. Re: using envers hbm2ddl with spring?
adamw Oct 6, 2009 6:02 AM (in response to elhanan)Hello,
yes, please look in the documentation.
Adam -
2. Re: using envers hbm2ddl with spring?
elhanan Oct 6, 2009 6:20 AM (in response to elhanan)i did, that's why i'm asking, it only states jpa/annotation/jdbconfiguration, is there anywhere else i can look?
-
3. Re: using envers hbm2ddl with spring?
adamw Oct 6, 2009 8:23 AM (in response to elhanan)Hello,
ah ok. I don't know much about spring, so hard to say. You can use the EnversHibernateToolTask, if that's an option.
Adam -
4. Re: using envers hbm2ddl with spring?
elhanan Oct 6, 2009 5:51 PM (in response to elhanan)the ant task what i was talking about, but if it requirest cfg.xml with a list of class mappings (or classes) then that's a problem, if i could just give it the class path it self. then what would be fine.
(hey, i wish the cfg.xml itself would be able to auto detect entities, without the use of jpa) -
5. Re: using envers hbm2ddl with spring?
adamw Oct 7, 2009 10:08 AM (in response to elhanan)Hello,
unfortunately there's nothing above the ant task, neither in Hibernate (AFAIK), nor in Envers.
Adam -
6. Re: using envers hbm2ddl with spring?
skomarla Oct 7, 2009 12:42 PM (in response to elhanan)I don't know if this helps you or not.. but I have spring load hibernate cfg like this:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="hibernateProperties"> <props> <prop key="show_sql">true</prop> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop> <prop key="hibernate.jdbc.use_scrollable_resultset">true</prop> <prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</prop> <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</prop> </props> </property> <property name="jtaTransactionManager"> <bean factory-bean="transactionManager" factory-method="getTransactionManager"/> </property> <property name="mappingLocations"> <value>classpath*:com/companyxyz/module/model/**/*.hbm.xml</value> </property> </bean>
If this wasn't the question, then sorry for cluttering the thread -
7. Re: using envers hbm2ddl with spring?
elhanan Oct 8, 2009 12:19 AM (in response to elhanan)actually this is how spring loads hibernate ... WITHOUT to use of cfg.xml :)
this is how we are using hibernate as well (only without the wild cards, spring xml is being re-generated automatically)
so, as fellow enver user (i'm guess this is why you are in this forum) how would you use the envers hbm2ddl task with your spring config? -
8. Re: using envers hbm2ddl with spring?
skomarla Oct 8, 2009 1:34 PM (in response to elhanan)I haven't gotten that far :)
However for me, our data model is managed by a data architect, and thus would be managed manually. The other thing I would likely do, is create a target db, and let hibernate/envers create the envers tables at start time once, and then pull those changes into out erwin model -
9. Re: using envers hbm2ddl with spring?
skomarla Dec 4, 2009 3:26 PM (in response to elhanan)"Elhanan" wrote:
actually this is how spring loads hibernate ... WITHOUT to use of cfg.xml :)
this is how we are using hibernate as well (only without the wild cards, spring xml is being re-generated automatically)
so, as fellow enver user (i'm guess this is why you are in this forum) how would you use the envers hbm2ddl task with your spring config?
You could add<prop key="hibernate.hbm2ddl.auto">update</prop>
to the hibernateProperties of the sessionFactory bean.
A side effect to this is that hibernate will try to update the db everytime it starts up. For me, this is an issue since hibernate the hbm has slight differences compared to the physical model and makes changes our DBA doesn't like.