modify « Query « JPA Q&A





1. Modifying property names in JPA queries    stackoverflow.com

I'm using a convention of prefixing field names with an underscore. When I generate annotate entity classes with such fields I am stuck to using the underscore-prefixed property names in queries. ...

2. How can I modify the generated SQL query of hibernate?    stackoverflow.com

I'm a little curious, is there a way to modify the hibernate's core so i can customize the generated SQL query. For example, to add functionality in the generated query to ...

3. Hibernate JPA does modify / update on read / select of versioned entity    stackoverflow.com

I am a bit stumped as to why Hibernate is Updating a row when I do a select, and how to keep it from doing so. The Entity is versioned, and I ...

4. Getting error: Need to modify a query from the auction ex.    forum.hibernate.org

Version: 2.1 Database: MySQL V4 Using the auction example as a basis and have the follwing query from the example: Code: List auctions = s.createQuery( "select new AuctionInfo( item.id, item.description, item.ends, item.seller, max (bid.amount) ) " + ...

5. Can I Modify This Query So That It Results In A Cache Hit?    forum.hibernate.org

I have a collection that does not change (several actually, but in this example a list of TimeZones), which I have placed as immutable, read-only members of the second-level cache using ehcache. Once this Collection is in memory, there should be no reason to go to the database to load it again. That is not what I am seeing, however, and ...

6. Modify query    forum.hibernate.org

7. Modifying static HQL query    forum.hibernate.org

Hello friends, I have an HQL query in an hbm file. This query is executed successfully. But now I want to modify this query (given in hbm) at runtime. I want to add ORDER BY clause in the existing query. Can you please tell me how to do that ? I cant use Criteria class as I don't have to build ...

8. Using eventListener to modify query    forum.hibernate.org

Hibernate version: 3.2.6 I am using an hibernate event listener (SaveOrUpdateEventListener) to transparently setting properties of an object before saving it into the databse. This is working perfectly fine. But I am having problems with implementing the second requirement: I want to intercept the loading of objects from the database, change the query (read: adding a new contraint) and then letting ...