2.0-m3 struts-basic-archetype
1) Create a new model class and add it to the hibernate.cfg.xml. 2) Run mvn compile hibernate3:hbm2ddl 3) Modify the model class (add a new property or relationship, or even rename something) 4) Repeat step2....your schema table should not have changed. You should get a MVN error to the effect: create table spectrum_query (id bigint not null auto_increment, scanNumber varch ar(255) not null unique, search_summary_id bigint, primary key (id)) type=InnoDB ; [ERROR] SchemaExport - Unsuccessful: create table spectrum_query (id bigint not null auto_increment, scanNumber varchar(255) not null unique, search_summary_id bigint, primary key (id)) type=InnoDB [ERROR] SchemaExport - Table 'spectrum_query' already exists - Matt [EMAIL PROTECTED] ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt Raible Sent: Friday, March 02, 2007 11:41 AM To: [email protected] Subject: Re: [appfuse-user] hibernate3:hbm2ddl What version of 2.x are you using? Can you provide some steps so I can try to reproduce the problem on my end? Thanks, Matt On 3/2/07, Stine, Matt <[EMAIL PROTECTED]> wrote: I remember in the past (1.9.x) that when I made changes to my model classes, ant script would update my DB schema. It seems that the equivalent 2.0 operation, "mvn compile hibernate3:hbm2ddl" does not do this. If the table already exists it just moves on to the next one. Am I doing something wrong? Is there a way to do a "clean" on your DB so that the updates get picked up? Or do I have to drop the schema from MySQL every time? Thanks. _____________________________________ Matt Stine Senior Software Engineer Hartwell Center for Bioinformatics and Biotechnology St. Jude Children's Research Hospital 332 N. Lauderdale St. Memphis, TN 38105 Voice: 901.495.4602 Fax: 901.495.5108 Pgr: 901.495.3578 #1314 [EMAIL PROTECTED] http://www.hartwellcenter.org -- http://raibledesigns.com
