Change this:
<property name="hibernateProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
<prop key="hibernate.query.substitutions">true 'Y', false
'N'</prop>
<!-- Create/update the database tables automatically when
the JVM starts up
<prop key="hibernate.hbm2ddl.auto">update</prop> -->
<!-- Turn batching off for better error messages under
PostgreSQL
<prop key="hibernate.jdbc.batch_size">0</prop> -->
</props>
</property>
To this:
<property name="hibernateProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
<prop key="hibernate.query.substitutions">true 'Y', false
'N'</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
Of course, if you run "ant setup-db", it'll still drop and re-create
the tables b/c that's the semantics of the SchemaExport Ant task.
I've never changed this target to do update only with no drop, but I
think it's possible.
Matt
On 12/16/06, Fan <[EMAIL PROTECTED]> wrote:
which part of the sessionFatory bean is commented out ?
below is the original extract from applicationContext-hibernate.xml in
Appfuse 1.9.4
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingResources">
<list>
<value>org/myapp/model/Role.hbm.xml</value>
<value>org/myapp/model/User.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
<prop key="hibernate.query.substitutions">true 'Y', false
'N'</prop>
<!-- Create/update the database tables automatically when
the JVM starts up
<prop key="hibernate.hbm2ddl.auto">update</prop> -->
<!-- Turn batching off for better error messages under
PostgreSQL
<prop key="hibernate.jdbc.batch_size">0</prop> -->
</props>
</property>
</bean>
And would you like to show me the way of how to modify it ? Sorry, I am a
bit dumb in hibernate :P
Matt Raible-3 wrote:
>
> You could modify applicationContext-hibernate.xml to update the schema
> when things change. The setting is currently commented out on the
> sessionFactory bean.
>
> Matt
>
> On 12/16/06, Fan <[EMAIL PROTECTED]> wrote:
>>
>> Is there an option to create a new table without dropping all the
>> existing
>> tables and creating them again ?
>>
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/create-new-table-without-affecting-existing-tables-tf2834275s2369.html#a7912835
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/create-new-table-without-affecting-existing-tables-tf2834275s2369.html#a7912922
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
http://raibledesigns.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]