0

I have the need to be able to add additional columns to database tables in a Java JSF, JPA (JDO) application.

Eclipse Links supports this through the Flex Extension. Is there a similar Feature in other JPA Frameworks? I don't know about Hibernate. Also support in JDO would be interesting, as I would like to evaluate it one day.

Thanks for any advice.

Greets,
Andreas

andreas
  • 1,483
  • 1
  • 15
  • 36
  • What you mean by "Flex Extension"? – Edwin Dalorzo Apr 12 '11 at 12:35
  • For dynamic database models, EclipseLink offers some fancy features: Extensible Objects and DynamicEntities. If you are interested, you can check [my findings about dynamic data models with eclipse link](http://stackoverflow.com/questions/5619348/scenarios-allowing-adding-columns-in-database-and-automatically-change-crud-views) in my other question. It describes much better my intention and the possible solution... – andreas Apr 12 '11 at 14:48

2 Answers2

1

In Hibernate you can set a property in the persistence XML named hibernate.hbm2ddl.auto with values (create | create-drop | update | validate) to let the provider know if you want to generate DDL.

Of course, this implies your configured connection has privileges to do DDL in the database in question (which is never a safe policy in a production database) :-)

In this another question there is more info Hibernate hbm2ddl.auto possible values and what they do?

Community
  • 1
  • 1
Edwin Dalorzo
  • 76,803
  • 25
  • 144
  • 205
0

DataNucleus obviously supports such schema generation/update/delete features via persistence properties (jdo and jpa), and provides SchemaTool to allow it to be performed upfront, or to generate DDL for user editing before applying

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
  • thanks for your answer, obvious my question was not precice enough. see the edited question. – andreas Apr 10 '11 at 20:45
  • i see no difference in your question. DataNucleus copes with additional columns (aka schema evolution), via the same persistence properties – DataNucleus Apr 11 '11 at 05:13
  • sorry, it got late last night in supporting my girlfriend with some database issues, she had and did not finish the edit. I think I will completly repost the question as it is complex and this question covers only a small amount of the open problems. but thanks anyway! – andreas Apr 11 '11 at 06:41