Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

hibernate table does not exist error -


in configuration hibernate.cfg.xml, add <property name="hibernate.hbm2ddl.auto">create</property> hibernate create table automatically when run application. however, remove table database manually running drop table sql. run hibernate application again. exception appear

caused by: com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: table 'test.person' doesn't exist

only way fix problem restart mysql database. explain issue me?

this hibernate.cfg.xml

<hibernate-configuration>   <session-factory>       <property name="hibernate.connection.driver_class">           com.mysql.jdbc.driver       </property>       <property name="hibernate.connection.url">           jdbc:mysql://localhost/test     </property>       <property name="connection.username">root</property>       <property name="connection.password">root</property>       <property name="dialect">           org.hibernate.dialect.mysqldialect       </property>         <!-- drop , re-create database schema on startup -->     <property name="hibernate.hbm2ddl.auto">create</property>        <!-- enable hibernate's automatic session context management -->     <property name="current_session_context_class">thread</property>      <!-- disable second-level cache  -->     <property name="cache.provider_class">org.hibernate.cache.nocacheprovider</property>      <!-- echo executed sql stdout -->     <property name="show_sql">true</property>      <!-- mapping files -->       <mapping resource="com/mapping/event.hbm.xml" />       <mapping resource="com/mapping/person.hbm.xml"/> </session-factory>   

thx

i don't believe using create update in-place schema re-add table dropped. try:

<property name="hibernate.hbm2ddl.auto">update</property> 

this create schema if 1 doesn't exist, , attempt modify existing 1 match mapping have defined.

also, read this question possible values.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -