1. HQL order by within a collection stackoverflow.comI have 2 entities: car and wheels (oneToMany) and I want to retrieve my car, with all the wheels and (this is the tricky part) ordered by wheels.location. Select c from Car ... |
2. Hibernate - Selecting across multiple joins with collections stackoverflow.comI'm having trouble getting a hibernate select to return a correctly populated object graph, when the select contains joins across many collections. Eg:
|
3. hibernate query problem, so close and stumped stackoverflow.comThe schema: (psuedocode) I have a bean, called BaseEntity... @Entity class BaseEntity { @OneToMany @CascadeType.ALL List [Property] properties; //the use angled braces ommited for the stackoverflow editor to show ... |
4. Hibernate query for multiple items in a collection stackoverflow.comI have a data model that looks something like this:
|
5. Query scalar collections in HQL stackoverflow.comI have the following class:
And I want to write a HQL query that retrieves the username and the roles for ... |
6. Hibernate query for objects with collections stackoverflow.comFor a structure as follows:
The ... |
7. Joining to a collection in a JPA-QL query stackoverflow.comI'am using JPA for mapping ,I have this entity Class
|
8. How do I query for an object and populate it with a subset of a collection in hibernate? stackoverflow.comI'm trying to left outer join an object with a subset of a collection. Here's the query:
|
9. Hibernate query on custom collection stackoverflow.comI have a hibernate mapping with custom collection types in it. java:
hbm.xml:
|
10. Hibernate criteria query for Collection Table? stackoverflow.comI have following Entity
|
11. Hibernate: using criteria with collections (HashSet) stackoverflow.comI have the following classes:
|
12. Creating HQL Query which works on Collections coderanch.comI am having following Model Host { Long Id String fqdn2 Set |
13. Query on collection forum.hibernate.org |
14. problem creating simple HQL query with a collection forum.hibernate.org |
15. Querying a collection forum.hibernate.orgI have an entity that has a set of arbitrary categories attached to it, it's a one-to-many unidirectional relationship using a join table. Basically, a textbook example as illustrated @ http://docs.jboss.org/hibernate/core/3. ... l-join-12m When I query the entity based on the collection of categories I have to use the following; Code: public List getByEntityFilter(EntityFilter filter) { ... |
16. Select a collection in HQL forum.hibernate.orgHi everyone, I have a problem while developping my HQL query: This is a part of my query : " SELECT new RetourRequeteOTBean.class.getName() ( ODT.numero , ODT.version, elements(ODT.listeOMs) FROM OrdreDeTravailVO as ODT " numero is an integer , versions is an integer and listeOMs is a Collection. The constructor of RetourRequeteOTBean has the correct type with RetourRequeteOTBean(int, int, List ). But ... |
17. Select a collection in HQL forum.hibernate.orgHi, After struggling with this for about an hour, I figure I'd ask if this was even possible in HQL. If I have a Person object with some simple properties (firstName, lastName) as well as a list (children) of Child objects. Is it possible to do a SELECT that would pull back the Child list as one of the array members. ... |
18. Using order-by on collection forum.hibernate.orgHello, I can't seem to get the order-by property to work on my one-to-many collection. I am using XDoclet to generate my mapping files. Here is the relevant portion of the mapping: Code: |
19. query on collections forum.hibernate.org |
20. problems with order-by and Collections forum.hibernate.orgHi all, I am having the following problem with hibernate using the order-by attribute in the Collection specification/Mapping. I have a field createdOn in a generic class A. Now I have two classes B and C that extend A (They are in different packages and I have them as joined subclasses of A). My class B has a one to many ... |
21. collection query - how to forum.hibernate.orgMichael, This works fine as long as I limit myself to getting only A with lazy loading true and outer join = false at global level. However, after getting A (session is now closed), I would like to then get to related B and C (based on my criteria). How do I do that ? |
22. Query member of unreferenced collection forum.hibernate.orgHibernate Version: 2.1 With Spring 1.0.3 with JBoss 3.2.3, Mysql 4.0.15 I have a table that stores the project information. Projects can belong to project groups, which are basically projects too(they are differentiated by a type column). My mapping for the projectgroups column looks like this |
23. can't work out query with collection forum.hibernate.orgAuthor Message markmansour Post subject: can't work out query with collection Posted: Mon Jul 26, 2004 11:19 am Newbie Joined: Sun Apr 04, 2004 1:58 am Posts: 13 Location: Melbourne, Australia I really need some help working out this query... I just can't make it fly... my tables are (simplified) Author - maps to Author object -------- id: key ... |
24. How to make a query over a collection? forum.hibernate.orgI can't find anywhere in the forum a satisfying answer on how to make a query over a collection of the following type with the criteria api: select distinct g.* from group as g, member as m1, member as m2 where g.groupId = m1.groupId and g.groupId = m2.groupId; in other words, how do I find the 'group' containing 'member1' and 'member2'? ... |
25. Using Criteria queries on collections forum.hibernate.org |
26. Query a Many-to-Many Collection forum.hibernate.orgI am messing around with the "Hibernate A Developer's Notebook" source code and the Hibernate Tools/IDE that is a plugin into eclipse. I can successfully run code that returns a Track along with its relationship to Artists...(a many to many). If I try to run the HQL query that is produced from the hibernate.show_sql within the Hibernate IDE...it fails. How would ... |
27. Find cause of "Found shared references to a collection& forum.hibernate.orgHello I am trying to do some mapping with hibernate through xdoclet and with one of my clases i am getting the following exception Found shared references to a collection org.hibernate.HibernateException: Found shared references to a collection Anyone has any clue of what is the most common cause for this? thanks a lot! |
28. "Flatten" joined collections to query on multiple forum.hibernate.orgHi, We have a model that is basically A which has collection of B, each of which has a collection of C. We need to query for the objects where the value of B.value is multiple values, and c.value is also multiple values. Thus we need to "flatten" out the hierarchy so we can select on multiple columns. However, this is ... |
29. ordering a collection - order-by="..." not adequat forum.hibernate.org |
30. Problem with join and order by on collection in HQL forum.hibernate.org2005-09-22 01:48:45,629 WARN JDBCExceptionReporter:57 - SQL Error: 0, SQLState: 42803 2005-09-22 01:48:45,630 ERROR JDBCExceptionReporter:58 - ERROR: column "picture0_.format" must appear in the GROUP BY clause or be used in an aggregate function 2005-09-22 01:48:45,633 WARN RequestProcessor:509 - Unhandled Exception thrown: class no.uka.intranett.db.DataResourceException 2005-09-22 01:48:45,653 ERROR InsertTag:920 - ServletException in '/secure/gallery/CreateBox.do?command=topCommented': net.sf.hibernate.exception.SQLGrammarException: Could not execute query |
31. Query based on a collection's contents? forum.hibernate.orgpublic class MyClass{ private Long id; private Set |
32. Efficient collection queries forum.hibernate.orgNewbie Joined: Mon May 09, 2005 5:43 pm Posts: 2 I have two questions about querying collections as efficiently as possible. 1) In some cases Hibernate requires an unnecessary join of an intermediate table. Consider the this example: A User has a many-to-one association with a Group, and a Group has a set of Permissions. So the USER table has a ... |
33. problem dereferencing a collection in a retrieving query forum.hibernate.orgNewbie Joined: Fri Nov 11, 2005 9:58 am Posts: 1 I'm having problems of kind "you may not dereference a collection with cascade=all-delete-orphan". I've read something about, but my issue is a little different. It occurs when I try retrieving some objects from db, and it occurs randomly with a few queries. When I do a simple search, the exception occurs, ... |
34. how does one avoid select sql on add to a collection forum.hibernate.orgNewbie Joined: Tue Jan 10, 2006 9:42 pm Posts: 5 Ok, I swear I sent this last night, but as it is not in the forum, I'll try again. I'm trying to understand the ramifications of various mappings. I'm trying to figure out how a many-to-many mapping behaves. In particular, I'm curious about creating an assoication between two entities where I ... |
35. How do I query an object having a collection forum.hibernate.orgString sqlSelect = "select {s.*},{li.*} " + "from StarViInvoice s inner join StarViLineItem li on s.headerOrderReference = li.headerOrderReference " + "where s.identDealerNumber =:dealerNbr " + ... |
36. HQL for finding a subset in a collection forum.hibernate.orgI need help writing HQL query for the following scenerio: I have an object Booking which contains People in it. I want to find if a booking contains atleast one person from another booking: Booking A - {John, Mary, Jane} Booking B - {Mary, Henry, Joe} - The return should be a count of 1, because Booking A has Mary and ... |
37. report queries & collections forum.hibernate.orgHi all! For example, I have classes class Test { int field1; String field2; List |
38. Criteria: Order by whether or not a collection is empty forum.hibernate.org |
39. Problem with ordering of collections forum.hibernate.orgHi, i have a problem with the ordering of a collection that i cant solve myself. I have two objects with a many-to-many relationship. In one of this objects i mapped this relationship unidirectional with hibernate annotations like this: Code: @ManyToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH}, targetEntity=BasiszeitraumDOM.class, fetch=FetchType.EAGER) @JoinTable(name="S_Basiszeitverknuepfungen", ... |
40. Ordering collections in HQL, possible? forum.hibernate.orgSets can't be ordered, because the sense of sets is that they don't contain duplicates and that they are unordered. But if you declare your message attribute as Collection instead of Set, your order-by attribute (I'm only working with annotations so I won't put my hand into the fire for it) should work. Attributes of type collection can be ordered. Hoeft ... |
41. order from joined table with collection forum.hibernate.orgHello, I have a problem that is similar to what people have posted before. But I have a different setup so I couldnt find a way to apply the solution. I have used myeclipse to generate the java code and the mappings. so here it is Code: class Animal { private Set animalAttributes = new HashSet(0); ... |
42. HQL Query to exclude items with spcfc collection elmntproprt forum.hibernate.org@Entity class Family { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) int family_id; @OneToMany(targetEntity=Person.class, cascade = CascadeType.ALL, mappedBy = "family") public Set |
43. select 'new java object' cannot handle collection forum.hibernate.org |
44. Query into collection forum.hibernate.org |
45. programatically find if collection assoication is from join forum.hibernate.org |
46. "select new" and collection forum.hibernate.orgHi! i have 3 tables : item, sub_item and bid and 3 classes: Item, SubItem and Bid. And ResultItem class as result bean. I have this select: Code: return getHibernateTemplate().find("select new com.app.model.ResultItem(" + "item.createDate, item.publishDate, item.finishDate, " + ... |
47. Querying a collection with AND criteria forum.hibernate.orgI have a question that seems simple enough but I'm having trouble figuring it out. I'm trying to run a query that returns results from a collection where the criteria is "AND'd". Example - if I had an 'Item' that has a 'categories' collection, I want to return the items that have all categories in my criteria. So the query would ... |
48. Select collections with HQL forum.hibernate.orgclass Person { String name; Set |
49. Creating HQL Query which works on Collections forum.hibernate.org |
50. Selecting across multiple joins with collections forum.hibernate.org'm having trouble getting a hibernate select to return a correctly populated object graph, when the select contains joins across many collections. Eg: Code: String sql = "select distinct changeset " + ... |