1. Can you order hql results based on matching restrictions? stackoverflow.comI have an object Dog which holds a set of DogMetadata. Each DogMetadata has two values: a String ("desc") and an int ("rank"). Descriptions of dogs have different rankings such as: "small" is ... |
2. hibernate restrictions and/or order stackoverflow.comsmall questions about Restrictions.or and Restrictions.and If I do something like this:
Will this be treated as:
|
3. Is there something like Restrictions.eq(true, false) in Criteria API? stackoverflow.comI need a generic |
4. Hibernate Criteria and row count restriction stackoverflow.comi have two entities named Parent and Child, linked in a one-to-many relationship. The Child entity has a boolean |
5. Hibernate Criteria Projection stackoverflow.comWell as the question says, i am trying to make a projection criteria querying only couple of the table attributes. So I have a Person Table/class and it has about 40 attributes ... |
6. Combining Restrictions and Projections on DetachedCriteria stackoverflow.comI have problem with combining Restrictions and Projections on DetachedCriteria. If I use only Restriction or Projections separately the program works. How can I combine those two together? I have following ... |
7. Writing a Hibernate Criteria API Query with restrictions for multiple sub-elements stackoverflow.comI have a data model that looks like this (simplified example):
I am trying to ... |
8. Hibernate exception 'could not resolve property' when doing a query with Criteria and Restrictions stackoverflow.comI have a OneToMany relation in hibernate defined like this:
|
9. select id if more than twenty columns satisfying conditions stackoverflow.comIdeally i need the query in Hibernate Criteria API, but it will be very helpful even in Native-SQL. I have a table with columns id, a1, a2, a3, a4, a5, ... ... |
10. Hibernate Criteria query conundrum stackoverflow.comI've got a schema with a series of OneToMany associations, where the hierarchy is Farm -> Field -> RegionGroup -> Region and need to be able to query based upon values ... |
11. Hibernate query table size restrictions forum.hibernate.orgAll, I am using hibernate 3.2.6ga with annotations 3.3.1. I have been using hibernate for about 3 years and have not had any problems until now. I have a db that i can access and perform CRUD operations on with about 15 tables. But one has 500000+ rows in it and when i perform a query against it i get back ... |
12. Restrictions.isEmpty() ignores where clause forum.hibernate.org |
13. JPA2.0 Criteria API: count(*) / select * from 1 restriction forum.hibernate.org// Set up criteria (restrictions) CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery |
14. Using a Restriction.like criteria on a numeric property forum.hibernate.orgI've never done this with hibernate, just an idea.... can you use an expression in the restriction? Simply take the modulus of the numeric field against the search string length and compare the values (both numeric). [Edit it should read 10^(power of the search string length), read between the lines =P, same goes for later] This will find if the string ... |
15. Adding restrictions on a JOIN-query forum.hibernate.org |
16. sorting/restrictions on dependencies forum.hibernate.org |
17. Criteria Restriction on JOIN clause instead on WHERE clause forum.hibernate.org |
18. DetachedCriteria adding Restrictions and Projections forum.hibernate.orgHi, I have problem with combining Restrictions and Projections on DetachedCriteria. If I use Restriction or Projections separately the program works fine. How can I combine those two together? Here is my sql: "select cTopic.topic ,SUM(cTopic.records) as records from Topics cTopic where cTopic.id=? and cTopic.active =? GROUP BY cTopic.topic order by cTopic.orderTopics The following Java codes work fine without using group ... |
19. Criteria Query: Restrictions and Collections forum.hibernate.orgyeah that's what i first tried..... criteria = session createCriteria(LabeledItem.class) .createCriteria("labels"); for (Label label : allLabels2match) { criteria = criteria.add(Restriction.eq("name",label.getName()); } but that doesn't work as it is equivalent to this SQL: select id_item from labeleditems li , label l where li.id_item = l.iditem AND l.name = 'name1' AND l.name = 'name2' AND l.name = 'name3' ................. AND l.name = 'namen' ... |
20. Variable number of Restriction.or() clauses forum.hibernate.orgNewbie Joined: Mon Nov 20, 2006 5:28 pm Posts: 4 Suppose I have a simple table named "Book" with a column named "Title" VARCHAR(500). [Books] ------------------------------------------------ |id | title | ------------------------------------------------ | 1 | "Gone with the Wind" | | 2 | "The Stand" | | 3 | "Standing at the edge" | | 4 | "Standing at the edge of ... |
21. Restrictions to join part of the query? forum.hibernate.orgEdit: I solved the problem describe below using HQL and currently I am looking for answers to these questions: 1. Is there any way, how to apply extra join conditions using Criteria API? (The "with" keyword in HQL) 2. Is there any way, how to specify join order using parentheses in HQL / Criteria API? |
22. Applying Criteria restrictions to Native query. My solution forum.hibernate.orgI'm using native query API. But it is usual to apply dynamic filters, ordering and limiting first and maxResults of a query. Criteria interface is ideal for that. I have written small utility class to apply critetia query restrictions to native query. Here is usage code sample CriteriaParams critPar = new CriteriaParams(); critPar.add(Restrictions.eq("P.FULLNAME", "Doe")); critPar.addOrder(Order.asc("P.SHORTNAME")); CriteriaSQL csql = new CriteriaSQL(critPar); SQLQuery ... |
23. Can you append a restriction to a query dynamically? forum.hibernate.orgHibernate version: 3.2.0 Hi Guys Is it possible to configure an interceptor ( or something similar ) to append a where clause to all dynamically generated queries? I have a flag in every table which I need to add to the clause, but I don't want it to live in the object model at all. ie when calling the load method ... |
24. using Restrictions with 'not in' clause in Criteria? forum.hibernate.org |
25. using Restriction and Projection classes forum.hibernate.orgDear Sirs The hql query below work fine: String query = "select t from TextVersion as t where version = " + "(select max(version) from TextVersion where headline_id = " + headlineId + ") and headline_id=" + headlineId; List textVersions = hibernateSupport.findByHQL(query); the POJO class is TextVersion and I am able to retrieve objects from this class in List textVersions. I ... |
26. DetachedCriteria Group By with Count restriction - possible? forum.hibernate.orgI am facing a problem where I am trying to do a group by and count unique and display only those records where the count is at least some number. I was able to successfuly write some HSQL below that will return me the count and an instance, but I want to further reduce the resultset by saying that I only ... |
27. Pagination with key restriction to know which page to show. forum.hibernate.orgI understand how basic pagination works, and have been successful at using it in Hibernate with the setMaxResults and setFirstResult api on the criteria object. However, now I have the a problem where the user wants to display the page of results that contains a particular key of information. For instance, if there are 10000 total rows with 10 rows per ... |
28. Query cache invalidation with natural-id restrictions forum.hibernate.orgNewbie Joined: Thu Mar 20, 2008 5:27 pm Posts: 1 I am migrating a legacy system that performs a number of repetitive queries by immutable composite business keys. While I am using surrogate keys in the migrated database, to boost performance, I setup natural id mapping, a query cache and second level cache as described in the hibernate documentation, section 15.9, ... |
29. ClassCastException when using Restrictions.like on Integer forum.hibernate.org |
30. Problem with German Umlauts and Restriction.like forum.hibernate.org |
31. invalid sql when using projection and restriction forum.hibernate.orgCriteria criteria = getActorDao().createCriteria(); criteria.add(Restrictions.or( Restrictions.ilike("name", "adi"), Restrictions.ilike("description", "adi") )); criteria.setProjection(Projections.projectionList() .add(Projections.groupProperty("name"), "name") .add(Projections.groupProperty("description"), "description") ); criteria.setResultTransformer(new AliasToBeanResultTransformer(ActorTestDTO.class)); List ... |
32. Need help on Criteria Query Restrictions. forum.hibernate.org |
33. Can you order hql results based on matching restrictions? forum.hibernate.orgI have an object Dog which holds a set of DogMetadata. Each DogMetadata has two values: a String ("desc") and an int ("rank"). Descriptions of dogs have different rankings such as: "small" is 5, "furry" is 2, "friendly" is 9, "dalmation" is 11, "mutt" is 22. I need to search for dogs based on any of their desc values (for example, ... |
34. Polymahic Restriction Query question forum.hibernate.org |