1. How to create Many-One Mapping in hibernate? stackoverflow.comI want to create Many-One Mapping between two tabels, Expense(ID, NAME, CATEGORY) and Category(ID, NAME). In my class i have created a field 'Category category' and its setters and getters. I did them ... |
2. Mapping result of aggregate query to hibernate object stackoverflow.comIs it possible to map the result of an aggregate query to a field in a hibernate-backed domain object? For example: If I have a Car object that looks like the ... |
3. Hibernate mapping and query stackoverflow.comThe hibernate mapping of my hbm.xml is:
|
4. JPA one to many mapping based on a query stackoverflow.comI may be going at this from the wrong direction but here is my scenario. essentially I have a a header and a detail entity. they have a one to many relationship and ... |
5. More complicated named queries on Hibernate stackoverflow.comI have a query that aggregates and groupes from 2 different tables: |
6. One-to-oneish JPA mapping/query coderanch.comHowdy, I'm taking this here since e.g the Hibernate forums aren't that friendly to noobs with mapping probs ;-) Summary: how to do a JPA one-to-one mapping (or query) when the relation needs "outside" data. Say we have Product: ID Name ---------- 1 Moose Head 2 Moonshine and we have Customer: ID Name ---------- 1 Bill Redneck 2 Joe Redneck but ... |
7. Hibernate add query for 2 mapped tables coderanch.comHI, I have 2 tables. they are category(category_id(PK),category_name) other table is recommendation(category_id(FK),recommen_id(PK),reco_title) Now i mapped these tables by one to many mapping from category to recommendation tables using hibernate annotations..So one category has many recommendations.Now in category entity, i have recommendation object list. So when I add a record in category table i need to add the list of recommendations also. ... |
8. Basic Hibernate many-to-many mapping / query not right coderanch.comI am trying to map a many to many relationship as below. A straight "select *" query works but when I try to limit the results I'm getting errors that are difficult to understand. In the example below, I'm attempting to get all of the Song objects that have a SoundsLike value with a particular soundsLikeSearchId. For the record, I get ... |
9. Hibernate query not mapped coderanch.comI have the following line of code that's not running. Query myQuery = session.createQuery("from poll1"); I'm getting the following error message. org.hibernate.hql.ast.QuerySyntaxError: poll1 is not mapped. [from poll1] Here is my mapping in poll1.hbm.xml. The table is capitalized the same way, so I'm confused. Any ideas? |
10. Querying specific child classes only forum.hibernate.orgHello, I have a situation where I need only 2 specific types of subclasses from a group of subclasses. The parent is an abstract class so I need to pull back only 2 specific types of concrete classes from a pool of about 5. Can someone point me in the right direction? |
11. Mapping a query result to an object forum.hibernate.orgHello, I have a problem related with the mapping of the results of a HQL query. My query is: select t, count(distinct ut.ownerUserId), avg(ut.userTestMark) FROM Test t LEFT JOIN t.userTests ut I want to map the results of the avg and count to 2 transient fields that i defined in the Test class. How should my query look like? Alternatively, if ... |
12. Query map contents forum.hibernate.org |
13. Query with a Map (2.1b4) forum.hibernate.orgHello In a program there is a parent/child relationship. Now I have to find all parents where a child have a specific name. This query does the job without a problem: Code: Criteria crit = session.createCriteria(Parent.class); crit.createCriteria("child").add(Expression.like("name", aString)); List l = crit.list(); Now I ... |
14. Mapped query that returns a read-only non persisant object forum.hibernate.orgIs there a way to get in Hibernate the result of a query that is not persistant? I don't need it to be persistant since it's just a read-only view. Although, that would be really nice if there would be a way to map the result of a query( SQL or even HQL for persistant) in a view object in Hibernate. ... |
15. Mapping two objects to the same table, and queries forum.hibernate.org |
16. Query to get special results, not a mapped class... forum.hibernate.org |
17. Mapping adhoc queries to an object? forum.hibernate.org |
18. Query with indices(Map) forum.hibernate.orgI have what should be a simple HQL question. I have a class with a Map (attrGroupMap), the key is an Integer. I have the following query to which I'm passing in an Integer: from ProductSKU ps where ? in indices(ps.attrGroupMap) I'm getting the following exception: net.sf.hibernate.QueryException: in expected: pg [from ProductSKU pg where ? in indices(pg.attrGroupMap)] Any ideas? Seems like ... |
19. Query with |
20. How to map this query in Hibernate forum.hibernate.org |
21. Many-to-one mapping and use of different queries with this forum.hibernate.orgHi, I have an entity called Country which has a many-to-one relationship with Region. I have given this in the hbm. But while querying i want to ignore the association at particular times. For eg at one instance i have a query that will join on Region where as in another instance i will have a simple select from the Country ... |
22. Object plus Child Count in One Query? forum.hibernate.orgHello, Is there a way to write a HQL or Criteria query to select both the parent and the count of child objects at once? We're aware of the filter to get the child count without initializing the whole collection, but that's N*2 queries. Hopefully there's a way to do it all at once. Thanks very much! Seth Hibernate version: 2.1.8 ... |
23. Querying of maps forum.hibernate.orgHi. Is it possible to query for keys and values of a map? I have a class with an attribute "private Map properties". The mapping is like follows: |
24. Hibernate creating incorrect query into a map forum.hibernate.orgNewbie Joined: Tue Mar 21, 2006 8:40 am Posts: 1 Hibernate version: 3.1 Name and version of the database you are using: Oracle 9i Hi, we have a problem with Hibernate not building a correct query on a ternary relationship. We have An UtilisateurVo object mapped to a UTILISATEUR table A SousAgenceVo object mapped to a SOUSAGENCE table A component named ... |
25. How to query mapped maps forum.hibernate.org |
26. Many-To-One Mapping does not limit Example-based query forum.hibernate.orgAuthor Message kschaefe Post subject: Many-To-One Mapping does not limit Example-based query Posted: Tue Nov 28, 2006 9:27 am Newbie Joined: Tue Nov 28, 2006 9:07 am Posts: 1 Hibernate version: 3.2 using Annotations Mapping documents: Annotated classes, as follows: Code: /** * The class |
27. Querying only one line of a map forum.hibernate.org |
28. Mapping multiple classes to same named query forum.hibernate.orgWe want to map multiple classes to same named query. We are using stored procedures for DB access. I know we can use entity-name attribute of Class element for POJO mappings but the named query or sql-query element only has classname. My question is how should we configure same class to mutple named queries? |
29. Query not mapped/translated correctly forum.hibernate.orgIf you have got a composite primary key it will typically be modelled as a separate class represented by field named id in the entity. You then have to refer to components of the primary key in queries using their full path, e.g. UserIdentifier.id.userId. Without seeing your full entity class definition it is hard to tell you exactly how it should ... |
30. No resolve mapping in the query sentences. forum.hibernate.org |
31. Simple Map Query not working... forum.hibernate.orgpublic class Account { ... @OneToMany(cascade = CascadeType.ALL) //javax mapkey @MapKey(name="propertyName") private Map |