hibernate3:hbm2ddl

7 messages Options
Embed this post
Permalink
Matt Stine

hibernate3:hbm2ddl

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

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

[hidden email]

http://www.hartwellcenter.org

 

mraible

Re: hibernate3:hbm2ddl

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
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 <[hidden email]> 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

[hidden email]

http://www.hartwellcenter.org

 




--
http://raibledesigns.com
mraible

Re: hibernate3:hbm2ddl

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
There is a problem with this that I've been running into a lot over the last few days. Basically, Jetty runs out of memory after 4-5 restarts, just like Tomcat used to. If anyone has a chance to slap a profile on things and see where the leak is coming from, please let me know.  I suspect commons-logging, but since it's used by everyone (hibernate, spring, etc.), it's tough to remove and Maven doesn't have a <global-excludes> mechanism.

Matt

On 3/2/07, Matt Raible <[hidden email]> wrote:
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 <[hidden email]> 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

[hidden email]

http://www.hartwellcenter.org

 




--
http://raibledesigns.com



--
http://raibledesigns.com
Matt Stine

RE: hibernate3:hbm2ddl

Reply Threaded More More options
Print post
Permalink
In reply to this post by mraible
Some javascript/style in this post has been disabled (why?)

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

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Matt Raible
Sent: Friday, March 02, 2007 11:41 AM
To: [hidden email]
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 <[hidden email]> 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

[hidden email]

http://www.hartwellcenter.org

 




--
http://raibledesigns.com

Rob van Oostrum-2

Re: hibernate3:hbm2ddl

Reply Threaded More More options
Print post
Permalink
In reply to this post by Matt Stine
add <drop>true</drop> to the <componentProperties> of the
hibernate3-maven-plugin

R.

On 3/2/07, Stine, Matt <[hidden email]> 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
>
> [hidden email]
>
> http://www.hartwellcenter.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Matt Stine

RE: hibernate3:hbm2ddl

Reply Threaded More More options
Print post
Permalink
That fixed it. Thanks Rob!

- Matt
[hidden email]

> -----Original Message-----
> From: Rob van Oostrum [mailto:[hidden email]]
> Sent: Friday, March 02, 2007 11:55 AM
> To: [hidden email]
> Subject: Re: [appfuse-user] hibernate3:hbm2ddl
>
> add <drop>true</drop> to the <componentProperties> of the
> hibernate3-maven-plugin
>
> R.
>
> On 3/2/07, Stine, Matt <[hidden email]> 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
> >
> > [hidden email]
> >
> > http://www.hartwellcenter.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

mraible

Re: hibernate3:hbm2ddl

Reply Threaded More More options
Print post
Permalink
I've filed a bug for this and fixed it in SVN.

http://issues.appfuse.org/browse/APF-678

Matt

On 3/2/07, Stine, Matt <[hidden email]> wrote:
That fixed it. Thanks Rob!

- Matt
[hidden email]

> -----Original Message-----
> From: Rob van Oostrum [mailto:[hidden email]]
> Sent: Friday, March 02, 2007 11:55 AM
> To: [hidden email]
> Subject: Re: [appfuse-user] hibernate3:hbm2ddl
>
> add <drop>true</drop> to the <componentProperties> of the
> hibernate3-maven-plugin
>
> R.
>
> On 3/2/07, Stine, Matt <[hidden email]> 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
> >
> > [hidden email]
> >
> > http://www.hartwellcenter.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




--
http://raibledesigns.com