Hi EJB design gurus,
I have the following EJB design problem. I have database tables wrapped into EJBs that can be altered during runtime, i.e. new columns might be added. I can, of course, add columns by simply executing 'ALTER TABLE' statement on the database, then correct my EJBs manually, but I need this process to be automatic. Is there any way to do that?
Thanks a lot in advance.
That's a bad concept , using ALTER TABLE to dinamically modify structure at runtime.
So , while technically you can implkement EJB or any pther database related objects that discover database structure dinamically , I think you should rethink your design.
Are you using BMP EJB? Then it should be just a matter of altering your INSERT statements. If you build your INSERT's and UPDATES from External Property files, you get some flexibility.
But as Costin mentioned, it's not correct to have Dynamically Altered Table structures for a Good Design. Reconsider having additional table(s) that represent changed data structures as Rows.