1. Case-insensitive equals using Hibernate Criteria stackoverflow.comI've seen Restrictions.ilike('property', '%value%'), but would like to generate SQL like: lower(property) = 'value'. Any ideas? I used:
since Expression is deprecated. The SimpleExpression will call toLowerCase() ... |
2. iterate array to create hibernate criteria statement stackoverflow.comlet say my array has 3 integer object value= 3,4,5 i would need to create hibernate criteria that look like below
|
3. NULL handling with subselect in Hibernate Criteria API stackoverflow.comI'm constructing a Hibernate Criterion, using a subselect as follows
|
4. Hibernate Criteria API - adding a criterion: string should be in collection stackoverflow.comI have to following entity object
Now I'd like to make a criteria query which ... |
5. How does hibernate use an empty string for an equality restriction? stackoverflow.comI have a column that potentially has some bad data and I can't clean it up, so I need to check for either null or empty string. I'm doing a ... |
6. hibernate criteria filtering on a set of enum values stackoverflow.comHi I'm using Hibernate 3.2 with a 1.6 JDK and Mysql 5.0 I'm trying to use the criteria api to put together a dynamic filter. However when I add a ... |
7. JPA 2 Criteria API: why is isNull being ignored when in conjunction with equal? stackoverflow.comI have the following entity class (ID inherited from PersistentObjectSupport class):
|
8. Using JPA/Hibernate Criteria to pull between a date stackoverflow.comI am trying to using the following code to pull a list of Experience objects from a MySQL table. Each experience has a from datetime column and a to datetime column ... |
9. How to conver date type in hibernate criteria stackoverflow.comI have a situation. I have two kinds of date in the mysql database. One is date and another is datetime. Now in hibernate criteria I have to check whether one ... |
10. Hibernate not equal example criteria stackoverflow.comHibernate has example criteria: For example:
Is there a way to do the opposite,
For example:
or anything similar that to create a not equal criteria. I don't want ... |
11. Equivalent of hibernate's Restrictions.sqlRestriction in JPA2 Criteria API? stackoverflow.comDoes anyone know the equivalent of Hibernate's [Restrictions.sqlRestriction][1] for JPA2 Criteria API ? Also, if there is no equivalent, I'd be interested to know how hard it would be to hack something ... |
12. Using restriction of Criteria API in hibernate for Date stackoverflow.comThe situation is like this. The format of the date in SQL server is different from oracle. In SQL server it is stored as TimeStamp. How does Restriction.eq , Restriction.lt, Restriction.gt ... |
13. Hibernate Criteria for Dates stackoverflow.comIn oracle I have dates in format 17-April-2011 19:20:23.707000000 I would like to retrieve all orders for 17-04-2011.
|
14. Hibernate Criteria API Equivalent to Oracle's Decode stackoverflow.comWhat would the equivalent of Oracle's DECODE() function be in the Hibernate Criteria API? An SQL example of what I need to do:
|
15. Restrictions Between for Date in Hibernate Criteria stackoverflow.comHello I am using hibernate in my example.For bean Table Audit Trial I want to fetch audit trial between a date range with inclusion of upper & lower limits. My code is ... |
16. Hibernate Criteria Date comparison stackoverflow.comI am trying to fetch data according to condition that attribute date1 is 17 minutes later than attribute date2. I can write the code to select based on condition date1 is ... |
17. ResultTransformer in Hibernate return null stackoverflow.comI'm using ResultTransformer to select only particular properties from entity, just i don't need all properties from entity. But the problem i faced is when a property is "one-to-many". Here is a ... |
18. How to apply to_number for a column in Hibernate criteria? stackoverflow.comI am using hibernate detached criteria to get the results from a table (Oracle database). I need to fetch the results order by ascending some column. The column contains numbers but ... |
19. Possible to create this HQL equivalent using Hibernate Criteria? coderanch.comI have two following classes mapped in hibernate mappings Class A1 { long ID; String t1; String t2; } Class B1 { long ID; String t3; String t4; } I am wondering if it's possible to create a HQL equivalent using criteria API SELECT {a.*} FROM A1 AS a, B1 AS b WHERE a.t1 = b.t3 AND a.t2 = b.t4 I ... |
20. time/date HQL vs Hbm3 Criteria coderanch.comhello I want to select some data between given time (not the date - only time hour minute seconds). Usinf HQL in JPA I can do it in a following way: protected EntityManager em; public void selectByTime(Date fromDate, Date tillDate) { Query q = em.createQuery("from Event e where e.startDate between :fromTime and :tillTime") .setParameter("fromTime", fromDate, TemporalType.TIME) .setParameter("tillTime", tillDate, TemporalType.TIME); ... } ... |
21. Hibernate date in criteria coderanch.comHi all, I've developed an application that simply pulls records from the DB out, and allows the user to select the date/time range to choose from (along with a bunch of other criteria). This has worked really well up till recently when the DB server (SQL Server 2005) was physically changed to one in another location. Below is the criteria I'm ... |
22. Restrictions Between for Date in Hibernate Criteria coderanch.com |
23. Why do you need to use strings in criterias? forum.hibernate.orgI want to sort with the Order class in a criteria, like: criteria.addOrder(Order.asc("myColumn")); But why do I need to enter the string name of the column in a non type-safe way? What if I change the name of that column in my database? I guess its ok to update the hibernate bean but I dont wanna keep track of all those ... |
24. Problem with criteria API - Enums and IN forum.hibernate.orgCriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery |
25. Criteria to check date is set, is not 0000-00-00 00:00:00 forum.hibernate.org public List |
26. criteria date inquery forum.hibernate.org |
27. JPA2(Hibernate) Criteria - Problem with greaterThan for Date forum.hibernate.orgHello Everybody, I have critical problem with JPA2 criteria. I want to use "greaterThan" and "lessThan" but it does not work for type Date). I tried to do same for Integer and it worked fine (equal - works fine too). I have this code: Code: public List |
28. Date Set using Criteria API forum.hibernate.org |
29. hibernate criteria object equivalent? forum.hibernate.org |
30. Criteria API's equivalent of JP QL's "TYPE" keyword? forum.hibernate.org |
31. compare between clob and string with Criteria forum.hibernate.orgHi, i have this Criteria Query with a description field in OffertaClass of type Clob and a Variable String desc i have to use a eq or like Criteria c = session.createCriteria(Offerta.class); c.add(desc == null ? Restrictions.eq("desc", "desc"): Restrictions.eq("descrizione", Restrictions.in("desc",new org.hibernate.lob.ClobImpl[]{new org.hibernate.lob.ClobImpl(desc)}))); or c.add(desc == null ? Restrictions.eq("desc", "desc"): Restrictions.like("descrizione", Restrictions.in("desc",new org.hibernate.lob.ClobImpl[]{new org.hibernate.lob.ClobImpl(desc)}))); but i get : java.lang.ClassCastException: org.hibernate.criterion.InExpression cannot be ... |
32. How to add criteria that some number property is even? forum.hibernate.org |
33. JPA Criteria date/time operators forum.hibernate.orgI can't figure out how to do date operations using the JPA CriteriaBuilder API. Basically, I have two date fields in the database, and I want to add a restriction where one date is within 7 days of the other. Here is the code snippet: Code: CriteriaBuilder builder = entityManager.getCriteriaBuilder(); ... |
34. How to ingore null value when using Criteria? forum.hibernate.orgI used Criteria to select record. I hope h2 ingore this condition when argument is null. e.g. crit.add(Expression.ge("inputDate", model.getSearchBeginDate())); if model.getSearchBeginDate() == null, I hope h2 ingore this condition. How can I config it or I should judge null value by myself? By the way sometime when I update record, I also want h2 to remain origin value if new field ... |
35. Criteria and Array forum.hibernate.org |
36. Number of Criteria results forum.hibernate.org |
37. Criteria/Example excludeNone()/excludeZeroes() and boolean forum.hibernate.orgHi Folks, I proven that enableLike works with values of component objects: Code: Criteria critera = createCriteria(); critera.add(Example.create(contactCriteria) .excludeNone() ... |
38. Criteria don't support Date? forum.hibernate.org |
39. Criteria: foo.asso is null or foo.asso.val=something forum.hibernate.orgHibernate version: 3.0 Hello, I'm looking for a Criteria based solution in Hibernate 3 for a query that accesses a many-to-one association where - either a condition on that association is true - or the association is null I succeeded in creating two separate criteria objects, one for each case: Code: List list1 = session.createCriteria(Foo.class) ... |
40. Criteria API when wanting to match a value in a String set? forum.hibernate.orgHibernate 2.1 I'm trying to create a Criteria search where one of the class members is a set. The snippet of hbm. |
41. Criteria - between dates forum.hibernate.orgHi Ram, I changed the mapping as per your suggestion. But still the list is empty. From the log, I saw the query as follows. When I gave the same query in the db client, I got 5 records. Probably hibernate is setting the dates in a wrong way. But hibernate is showing only the query in the log but not ... |
42. Help with Criteria/HQL and java.sql.Time property forum.hibernate.orgHello there! I'm having some problems when dealing with java.sql.Time properties. My Database is a SQL Server 2000 with a DateTime column. My property is mapped as a java.sql.Time My problem is, when I create a criteria I'm doing this: Criteria c = session.createCriteria(Entity.class); c.add(Expression.gt("beginTime", timeObject); But what is being generated on the SQL is column_name > '10:00:00' (suppose our timeObject ... |
43. Use Criteria API against |
44. How to get the SQL string for a Criteria ? forum.hibernate.orgHi, I'm building a Criteria using session.createCriteria(...); I would like to be able to get the SQL string corresponding to this Criteria because I would like to be able to build a request like the following: UPDATE ... FROM table WHERE field IN (criteria SQL string) SET ... I've looked at the hibernate documentation but could not find anything. Is it ... |
45. Criteria, to_date forum.hibernate.orgHi, I have a little problem. I have dates with different hours in my database, and I want to use the function to_date in order to only obtain the date but I don't know how? Here my criteria: DetachedCriteria criteria = DetachedCriteria.forClass(SomeClass.class); criteria.add(Restrictions.between("date1", someDto .getDate1(), someDto.getDate2())); I tried to do this: DetachedCriteria criteria = DetachedCriteria.forClass(SomeClass.class); criteria.add(Restrictions.between("to_date(date1)", someDto .getDate1(), someDto.getDate2())); jojojo but ... |
46. Java 5 Enum with Criteria API forum.hibernate.orgHibernate version: 3.2.2.ga Mapping documents:/b] Annotations: Class in question has this method signature Code: /** * @return the status */ @Enumerated @Column(name = "status", nullable = false, updatable = false) public Status getStatus() { return ... |
47. Problem using date in criteria forum.hibernate.org |
48. Criteria and Date data type forum.hibernate.org |
49. problem with dates on Criteria forum.hibernate.orgHibernate version: 3 Name and version of the database you are using: MySQL 5 Code: Criteria crit; Criteria critCount; ... |
50. How to create this particular HQL equivalent using criteria? forum.hibernate.orgMapping: Class A1 { String ID; } Class B1 { String ID; } HQL: SELECT {a.*}, {b.*} FROM A1 AS a, B1 AS b WHERE a.ID = b.ID How can I create a HQL equivalent of the above query? I tried DetachedCriteria criteria = DetachedCriteria.forEntityName("A1", "a"); DetachedCriteria subCriteria = criteria.createAlias("B1", "b"); subCriteria.add(Restrictions.eq("a.ID", "b.ID")); but it gave me org.springframework.orm.hibernate3.HibernateQueryException: could not resolve ... |
51. Criteria equivalent ? forum.hibernate.org |
52. Criteria and Date Arithmetic forum.hibernate.orgHi there, I have an entity with a start date and a term in months. I need to create a query that will return me all rows that have surpassed their term. eg. I have a start date of 2007-01-01 and my term is 6 months, I need the query to add the 6 months to the start date and determine ... |
53. Date Criteria forum.hibernate.orgI have a java.util.Date field in one of my custom persistable classes named "created." What I want to do is through the Criteria class filter out all results that have a "created" value of before the present. IE: I only want to fetch results that contain a future value in the "created" field. How do I accomplish this? Would I use ... |
54. date criteria forum.hibernate.orgI am using oracle database.In a table there is a column field whoose name is TransactionDate .It's data type is Date. Now i want to write a particular query which matches the transaction date from the database. Now the query is : "from MasterData master where MasterData.dateOfTransaction like '"+new Date(localDate.getTime())+"'"); the criteria is not fulfill.. can anyone give suggestion..... |
55. Setting the Date using Hibernate Criteria API forums.oracle.comI am trying to retrieve the records from a table using criteria API for a particular date. Following is the info regarding the db table, configuration and code. My concern is that I could not able to read the records when the date is passed. Appreciate if some help me out what's wrong with my approach. DB table CREATE TABLE `ws_access` ... |