Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write select query from a specific partition.

 
Repala Madhu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody.
Can somebody please help me in writing JPA query.

The following is working when i execute with mysql.
SELECT * FROM alarmhistory partition(p5);

The same i tried following in my entity manager, which is not working.

SELECT n FROM component.mo.AlarmHistory n PARTITION (p5)

Please help me.

Thanks in advance.
 
Repala Madhu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will JPA supports selecting from a partition?

If yes can somebody please tell me how it can be done.

Thanks.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To my knowledge JPA doesn't support partitioning.
 
Jagadeeswara Yaramala
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just did a google search and found a similar thing on another site: http://stackoverflow.com/questions/3699974/jpa-or-hibernates-with-oracle-table-partitions.
In the above URL, there are some alternative techniques mentioned (including using native SQL from JPA/Hibernate).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic