Robert Franz
Robert Franz

Reputation: 543

Setting default allocation size for all entities?

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

Answers (2)

James
James

Reputation: 18389

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

Upvotes: 1

DataNucleus
DataNucleus

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

Related Questions