-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Annotation problem
PostPosted: Tue Aug 17, 2010 4:39 am 
Newbie

Joined: Tue Aug 17, 2010 4:33 am
Posts: 1
Hi, can someone help me on my mapping.. i have this dispatcher-servlet.xml and it seems that the tables are not created when i deploy it on tomcat.. I dont know what seems to be the problem since there are no visible errors on the logs..


Code:
<context:annotation-config/>
<context:component-scan base-package="package.services"/>


<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="packagesToScan">
        <list>
            <value>
                package.pojo.*
            </value>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">
                org.hibernate.dialect.MySQLDialect
            </prop>
            <prop key="hibernate.show_sql">
                true
            </prop>
            <prop key="hibernate.connection.pool_size">
                0
            </prop>
            <prop key="hibernate.jdbc.batch_versioned_data">
                false
            </prop>
            <prop key="hibernate.hbm2ddl.auto">
                update
            </prop>
           
        </props>
    </property>
</bean>
<tx:annotation-driven transaction-manager="txManager"/>


<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory">
        <ref local="sessionFactory"/>
    </property>
</bean>


<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="location">
        <value>
            /WEB-INF/jdbc.properties
        </value>
    </property>
</bean>


<!-- Local DataSource that works in any environment -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName">
        <value>
            ${jdbc.driverClassName}
        </value>
    </property>
    <property name="url">
        <value>
            ${jdbc.url}
        </value>
    </property>
    <property name="username">
        <value>
            ${jdbc.username}
        </value>
    </property>
    <property name="password">
        <value>
            ${jdbc.password}
        </value>
    </property>
</bean>


Top
 Profile  
 
 Post subject: Re: Annotation problem
PostPosted: Tue Aug 17, 2010 6:22 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
To create the tables automatically you will have to set hibernate.hbm2ddl.auto to create or create-drop. Note, that this really are development options. For production environment I would not enable/use hibernate.hbm2ddl.auto.

Btw, this is really a question for the "Hibernate Users" forum.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.