Reputation: 543
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)
Upvotes: 2
Views: 652
Reputation: 18389
You can configure this using a SessinCustomizer in EclipseLink by setting the preallocationSize in the DefaultSequence.
Upvotes: 1
Reputation: 15577
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.
Upvotes: 1