We are trying to create database tables from our already existing domain Pojo classes and I am using SchemaExport to create them. Problem is, If I change the pojo class like adding a new attribute (enumStatus) after table creation and run it, I am getting Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'enumStatus' in 'field list' error. I am using the schema export as se.execute(true, true, false, true); so that when the app runs, existing tables are not dropped and the data is not lost. Below is the sample code I have been trying to execute. Please advice on how to avoid this error and facilitate future changes to the POJOs.
Error stack trace:
Joined: Jan 14, 2012
Ok, If I delete the existing tables and run it, even then it wont work. Gives me error. Only if I comment out the below in the main class its working .