1. Hibernate and order by using column values stackoverflow.comIs there a way I can pull off the below query (order by followed by a like) using hibernate criteria api?
|
2. Hibernate - query caching/second level cache does not work by value object containing subitems stackoverflow.comI have been struggling with the following problem:
|
3. Ordering results by computed value in Hibernate stackoverflow.comI have a table Player with columns id, name, wins, games_played. I mapped it to a class Player. I want to do the following query in Hibernate (preferably with Criteria, if not ... |
4. Keeping only distinct values in tables using Hibernate stackoverflow.comI am storing a relatively complex immutable object in a database. There are many many-to-one associations - the object has properties that have properties and so on. I would like to ... |
5. using hibernate criteria to select into value objects stackoverflow.comI'm trying to find out if it is possible to do the following HQL using the Hibernate Criteria API:
|
6. how to select value from database using hibernate? stackoverflow.comI am newbie for hibernate,i am using mysql database,with two tables serviceTypeDetails,validateConfig.In serviceTypeDetails,it's having four types of services and another table validateconfig contain 31 row with respect to each servicetypeid,using hibernate ... |
7. Hibernate: How to query to an object which it's collection proprty contains a specific value? stackoverflow.comI've got a |
8. Using Hibernate and Criteria to Select the Most Common Value stackoverflow.comGiven a table, say:
|
9. How to find using JPQL if member value is in a collection of values stackoverflow.comI have an object in which a member is an enum, and I want to write a query returning all elements for which that member is in a list of values. ... |
10. distinct clause not working properly in hibernate stackoverflow.comI am trying to get Distinct states of US from my SQL , but its distinct funtionality not working properly in hibernate , like Alaska is coming 6 times (its present ... |
11. Hibernate :: Combine Column values stackoverflow.comhow to combine column values on hibernate?
Result:
|
12. Select column value in Hibernate coderanch.comNo. In your mapping you have an associated object called Product, which must have a property of id. As you have it the only way to get the value of that directly is to refer to it via the Product object. If you don't want to make reference to the product at all, you will need to add a read only ... |
13. Hibernate adding .value,.count,.offset, and hash to query coderanch.com |
14. Change DB values for hibernate select forum.hibernate.orgHello everyone! The company I work for is using an old stupid ERP system, which treats the db column value of '8000000000000000' as null-> that's what it needs (dumb isn't it?). I somehow need to set up hibernate to treat this value as null. So, I wish hibernate to behave like this "If I see a column value of '8000000000000000' I ... |
15. Show values of executed query forum.hibernate.org |
16. Including literal values in select clause of HQL forum.hibernate.orgIs it possible to include a literal value in the select clause of an HQL query? For example, in an hbm file, Code: |
17. Get property values when using Query.Scroll forum.hibernate.orgI have the following .hbm.xml file ( part of it ): |
18. Need to count nulls with other values in one select forum.hibernate.orgI am using hibernate 2.1 with Oracle 8.1.7. I want to count the various types of values in a column (called status), but one of the values is null. A simple "...count(status) group by status" will not work because the null are not compared and counted. If I run a the following query, I get the expected results: select count((nvl(status, 1)), ... |
19. HQL query for selecting based on set of values in a collect forum.hibernate.orgHibernate version: 2.1.6 Name and version of the database you are using: MySQL 4.0.18 Hi: I am new to Hibernate and I went through most of the postings here and I am pretty sure this doesn't belong in the FAQ (I went through them also). My question is regarding the HQL query. It looked simple to me but I couldn't get ... |
20. Criteria query linking one-to-many using a value not a class forum.hibernate.orgAuthor Message aritchie Post subject: Criteria query linking one-to-many using a value not a class Posted: Tue Jul 19, 2005 10:56 am Newbie Joined: Tue Jul 19, 2005 10:33 am Posts: 3 Location: Omaha, Ne hibernate version 3.0 This is my mapping setup for a parent table sowtemplate and its children, goals, tasks and degrees. |
21. Named queries with nullable columns/values forum.hibernate.orgthanks for the reply - but I need matching values in this case (I only want null's if mycolval == null). I would use Criteria as follows: if(obj == null) criteria.add(Restrictions.isNull(mycol)); else criteria.add(Restrictions.eg(mycol, obj)); ??? however I can't figure out using this criteria with an aggregate select eg 'select max(t.num) from table t' --> + above Criteria |
22. Querying against values in a collection of values forum.hibernate.orgas far as I know, Criteria queries cannot be used with Collection objects. They can only be used with entities. Which is probably why you are getting the error. I am also looking for a solution to querying inside maps - I have been unable to do it till now. If someone knows the solution and could post it, it would ... |
23. Criteria queries and value collections forum.hibernate.org |
24. Query for several collection values w/o huge no. of joins forum.hibernate.orgHi, I'm still trying to figure out how to query for an object that has several specified matches in it's collection object. So, say I have a Feature which has multiple Settings. I simply want to find the Features where the Settings are equals to "A", "B", "C" and "D". I can do this with multiple joins on Settings, but doesn't ... |
25. Criteria query for a collection based on a value in the coll forum.hibernate.org |
26. Summing values in distinct objects forum.hibernate.orgHi! I'm new with Hibernate and HQL and I'm sure many of you can easily solve my problem, which seems quite challenging to me! I'm trying to get Hibernate to return a tuple with: 1) an Order object 2) the sum of Bill.value:s, where the Bills are related to the Order in question through one or more OrderItems 3) the sum ... |
27. Query with constant value forum.hibernate.org |
28. Hibernate Projection Problem for Many-to-one Values forum.hibernate.orgHi, Hibernate version: 3.1 Mapping documents: CertCartons.hbm.xml Code between sessionFactory.openSession() and session.close(): List alReasons = hibSession.createCriteria(CertCartonsDTO.class,"carton") .createAlias("certPallets","cp") //association path with alias .setProjection(Projections.projectionList() .add(Projections.property("carton.ccCartonNo"),"ccCartonNo")// working well .add(Projections.property("cp.cpPalletNo"),"certPallets.cpPalletNo")) // Not working for many-to-one .add(Property.forName("carton.ccCartonNo").eq(new String("CA89374238"))) .setResultTransformer(new AliasToBeanResultTransformer(CertCartonsDTO.class)).list(); System.out.println("The list size is what???"+alReasons.size()); for(int i=0;i |
29. Where clause to know if a collections contains some values forum.hibernate.orgI'm new to Hibernate, and I can't find what i'm searching for. Here is what I want to do. I have a Adresse object which contains a array of long. I want to retrieve all Adresse objects that have at least one value (from a list a provide) in their long array. I'm searching for the HQL query to do this ... |
30. Query with where clause on unflushed property values forum.hibernate.orgHI! We are evaluating Hibernate (3.2.0CR1) for a large ERP app, that uses our own OR mapper at the moment. One of the biggest advantages of Hibernate over own OR mapper would be the automatic flush on commit, resulting in minimal lock time (updated, but not yet committed rows). So, I set FlushMode.COMMIT. Also, using EH 2nd level cache. Now, if ... |
31. Finding distinct values from a set forum.hibernate.org@Entity public class Person { private Set |
32. Value truncation while using decimals in select query forum.hibernate.orgHi, The mapping file for hibernate has the following for a db column. |
33. persistin values like SYSDATE without specifying properties. forum.hibernate.org |
34. Select by scalar collection value forum.hibernate.orgI have what seems to be a simple request, but I have found it very difficult to do. I have a scalar collection of strings for an object that represent (choose all that apply) answers. I want a query to find only the objects that contain a particular answer in their string collection. I tried an HQL query "from Member m ... |
35. Select value object with native SQL forum.hibernate.org |
36. Querying against objects in a collection of values forum.hibernate.orgHi again, Having tried substituting the IDs as mentioned earlier I do get the query on the collection to work, however in doing this joins are created rather than a subquery. I am wanting to perform an 'OR' query and the join is not desirable. I understand that to perform a subquery I need to use DetachedCriteria in some way, however ... |
37. ordering by calculated value forum.hibernate.orgDear Hibernate Experts, I need to order the results of a query by a calculated value. Specifically, I have a table with columns Latitude and Longitude and I need to order by Euclidean distance from 0, 0. In other words, i need "ORDER BY Latitude * Latitude + Longitude * Longitude" (Because sqrt is a strictly increasing function it can be ... |
38. executing query and transient values forum.hibernate.org |
39. Selecting objects based on values in sets on the object. forum.hibernate.org |
40. How to Select Distinct Values forum.hibernate.orgHi, How to select the distinct rows with the particular field like there is a particular field say "type" with that i have "TT" field value repeated twice where it should get only the distinct value with the row instead of fetching all the rows. How can this be acheived using the criteria queries or HQL. Pls Anyone help me in ... |
41. Like Query with \ (backslash)as the value forum.hibernate.orghello, Why is it that my like query fails to return any values when I call it in the following way? criteria.add( Restrictions.like(attribute, values.toString(),MatchMode.ANYWHERE)); CASE 1 attribute - Headline values = "\" No values are returned eventhough the DB clearly shows values such as "hello\" CASE 2 attribute - Headline values = "\\" All values with \\ and \ are returned ... |
42. Specifying Ordering from Enumerated Value forum.hibernate.orgHi, I have the following problem with enumerated values and ordering, and can not seem to find an answer. I am trying to use the JPA annotations and queries only. Hibernate entity manager 3.3.1.GA I have these two classes: @Entity @Table(name="SEVERITY") public class Severity implements Serializable, Comparable |
43. Querying against a collection of values forum.hibernate.org |
44. Select Collection of Value Objects forum.hibernate.org |
45. error while finding value from Db using Hibernate .... forum.hibernate.orghi i facing a Exception when i want to find the values from my DB using hibernate... in my Struts Action class i use that code ProductDAO ob=new ProductDAO(); List list=ob.findByTitle(my search value); request.setAttribute("products", list); but it create the Exception can some one Help me out what i m doing wrong and how to prevent or slove that Exception... Witing fr ... |
46. Need Help with selecting a value from DB forum.hibernate.orgHi All, I tried to retrieve a value from DB using session.get(), but in session.get we can pass only the id of the table and we can retrieve according to table's id, but in my case i want to retrieve value by passing a string which is not the id, how can i do this without writing query. Thanks, vyrav. |
47. injecting values into objects created by a query forum.hibernate.orgHi, I have two classes in a simple composition relationship: class A { private B child; } class B { private Policy policy; } At some point, I'm using Spring's Hibernate template to retrieve all entities of type A: hibernateTemplate.find("from A"); This query will return a list of instances of type A, each also having a lazy association to an object ... |
48. selecting dfefault value from a one-to-many collection forum.hibernate.orgI've been dealing with this for a few days now without success. I have a customer object with a collection of addresses. I'm mapped the usual one-to-many relationship successfully so that a customer has a set of addresses. I also have a requirement where I need to only get the default address (marked with a flag on the address field) from ... |
49. HQL query sorted by a computed value forum.hibernate.org |