2

I want to set the default allocationSize that is set by default to 50 to another value. Is there a way to do that? I'd prefer to do this with default JPA, but Eclipselink would also be ok. I don't want to specify the allocationSize in each Entity I use.

@TableGenerator(name = "name", pkColumnValue = "pkColumnValue", allocationSize=1000)
Robert Franz
  • 418
  • 4
  • 14

2 Answers2

1

You can't do that with standard JPA. There isn't even an option of setting it in orm.xml "persistence-unit-defaults". With DataNucleus JPA you can certainly set a single persistence property that provides a default. Other JPA implementations may or may not offer such a facility.

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
  • Good that someone likes downvoting without comments. Maybe they would like to state what they think is wrong with what was written? – DataNucleus Mar 19 '12 at 15:41
1

You can configure this using a SessinCustomizer in EclipseLink by setting the preallocationSize in the DefaultSequence.

James
  • 17,965
  • 11
  • 91
  • 146