Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create new table partition with Hibernate on Insert

 
Sverre Moe
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I use Hibernate to create new partitions based upon a field value or primary key generator?
When I insert a new row in a table and is inputing a new value on the column which the table is partitioned, how can I get Hibernate to create this partition?

Edit: The correct phrase may be how to add an partition to an existing partition on a table.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to use native sql to do this I'd guess.
 
Sverre Moe
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:You will need to use native sql to do this I'd guess.


Thought so too...To bad hibernate doesn't have support for adding partitions.
 
Tim Holloway
Saloon Keeper
Posts: 18366
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you mean by "partitions". Hibernate Shards is a horizontal partitioning scheme, but partitioning is also a term sometimes used to indicate fine-grained control of a single database, and in that context, Hibernate isn't likely to be able to help, since that sort of feature is generally going to vary with the database vendor.

DBMS-specific partitioning is also not usually something that apps would be doing, since it's mostly about performance and physical robustness, which are generally best maintained across the enterprise by the DBA, whose job it is to balance resources for the enterprise as a whole.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic