GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes EJB does not update table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB does not update table" Watch "EJB does not update table" New topic
Author

EJB does not update table

Fridolin Egger
Greenhorn

Joined: Jul 24, 2006
Posts: 2
Hello
I'm using EJB 2.1 on a JBoss 4.0.2 and XDoclet for interface generation. I need to add some new persistent fields to an entity bean that contains a primary key field and some persistent fields like:



I then added new persistent fields like this:


This code compiles fine and the descriptor is updated by XDoclet but the database table ist not.

Is there any way to update the database table at deployment time?

Thanks!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Not that this really helps you, but with Hibernate and the configuration file you could update the table at deployment time, but I don't think you can do the same with EJBs. I think you will have to update the table yourself before you deploy.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Fridolin Egger
Greenhorn

Joined: Jul 24, 2006
Posts: 2
Thank you for your reply Mark. But no, it does not help. I personally in general prefer hibernate and other lightweight technologies. But in this case I'm stuck with the EJB 2.1 architecture.

Is there really no way to update a table at deployment time? XDoclet? Some script maybe?
 
GeeCON Prague 2014
 
subject: EJB does not update table