File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes How to write select query from a specific partition. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to write select query from a specific partition." Watch "How to write select query from a specific partition." New topic
Author

How to write select query from a specific partition.

Repala Madhu
Greenhorn

Joined: Jun 12, 2007
Posts: 14
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

Joined: Jun 12, 2007
Posts: 14
Will JPA supports selecting from a partition?

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

Thanks.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

To my knowledge JPA doesn't support partitioning.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Jagadeeswara Yaramala
Ranch Hand

Joined: Jul 28, 2010
Posts: 46
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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to write select query from a specific partition.