criteria Questions

2

Despite 3 hours of googling and searching the API I can't find any reference to whether it's possible to use database functions within a hibernate criteria query. To be specific: I'd like to acces...
Deductive asked 14/10, 2011 at 20:13

2

Solved

Is it possible to do an "in" criteria using the GORM criteria. I'm looking for the equivalent of the following SQL select * from Person where age in (20,21,22); If it was possible I guess the sy...
Monde asked 14/10, 2011 at 21:25

3

Solved

Anyone know how to convert an ICriteria into a DetachedCriteria. I need to use an existing ICriteria as part of a subquery using: .Add(Subqueries.PropertyIn("Name", myDetachedCriteriaSubquery)) ...
Jinny asked 18/11, 2009 at 3:12

4

Solved

What are the performance differences between the hql and criteriaApi and QueryOver? Are there any situations where one is faster or slower than the other? Edit: I extended the question with QueryO...
Immixture asked 16/7, 2010 at 7:7

2

Solved

The args' type of method fetch() can be SingularAttribute, PluralAttribute, why not can't be ListAttribute ? Then, how to fetch a collection with critria api ? Thank you.
Talamantes asked 17/2, 2011 at 1:24

3

Solved

I have some problems with projection in Grails. Could you please help me review them and suggest solutions for me? I want to query data on many tables which has many-to-one relationship and proje...
Washday asked 24/4, 2011 at 16:9

1

I'd like to know if it's possible to specify a select clause in a from clause something like select count(*) as Y, this_.NAME as A, sel2.C from TABLE1 this_, (select count(*) as C from (selec...
Alizaalizarin asked 7/4, 2011 at 13:21

2

Solved

I've got the following SQL tables Department |name|employees| Employee |name|gender|type|dead | |John|male |good|yes | |Mary|female|bad |no | |Joe |male |ugly|maybe| I would like to write a ...
Quadratics asked 15/8, 2011 at 14:9

4

This must be a simple question. Given a criteria, how one deletes the entities satisfying the criteria? The rationale: HQL and NH criteria are NHibernate specific constructs and as such they are...
Sporades asked 25/8, 2009 at 8:53

1

I'm trying to construct this query using Criteria typesafe API: select * from xxx_table xxx where CALC_DISTANCE(xxx.latitude, xxx.longitude, :lat, :lng) < :dist CALC_DISTANCE definded PL/SQL ...
Caelum asked 28/4, 2011 at 14:43

1

Solved

Consider the following two relations: @Entity class Foo { @Id id; @ManyToMany @JoinTable(name = "ATag", joinColumns = @JoinColumn(name = "foo_id"), inverseJoinColumns = @...
Catchment asked 19/7, 2011 at 9:22

1

Solved

I am having an issue with creating queries with javax.persistence.criteria.CriteriaBuilder. I am using EclipseLink 2.1 and an Oracle 10g database. When building a query with multiple restrictions i...
Absorption asked 4/7, 2011 at 0:9

1

Solved

How can I write a Hibernate Criteria query, for a super-class, and check for a certain sub-class? Let's imagine we have the following classes all mapped up with Hibernate-JPA: @Entity @Inheritance...
Graces asked 2/7, 2011 at 12:18

2

I'm trying to express a SQL query using NHibernate's Criteria API, and I'm running into difficulty because I'm thinking in a database-centric way while NHibernate is object-centric. SQL (works gre...
Latrice asked 8/11, 2010 at 22:22

1

Solved

I'm struggling to create a Hibernate criteria query that uses setFetchMode(... SELECT) and places a restriction on the returned child records. If I use a creteAlias as recommended it produces an in...
Susurrous asked 6/4, 2011 at 19:50

4

Solved

How to do either a HQL or a Criteria search (the latter is preferred) involving an enum that is used as flags. In other words, I have a persisted enum property that stores some kind of flags. I wan...
Hygrometry asked 10/5, 2010 at 19:10

1

Solved

I am currently working on a project to transfer some legacy jdbc select statements over to using Hibernate and it's criteria api. The two relevant table columns and the SQL query looks like: -QUE...
Johnie asked 5/5, 2011 at 19:11

1

i seem to only be having this issue with 1 particular model when i am searching by ID >> Cart.where(:_id => '4dae5902e1607c232c000009').first => #<Cart _id: 4dae5902e1607c232c000009...
Contrary asked 20/4, 2011 at 4:23

2

I 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 Hibernate Criteria query so I've got the following that r...
Hue asked 11/5, 2010 at 17:53

2

Solved

Using hibernate ctiteria I want to select an object and it's associated oneToMany list of objects. I want to paginate through this list avoiding the dreaded hibernate n+1 select issue Here's a wo...
Help asked 6/4, 2011 at 14:11

1

Solved

Say I have a class Mother with a oneToMany mapping to Kittens @Entity @org.hibernate.annotations.Entity(dynamicUpdate = true) @Table(name = "Mother") ..... @OneToMany(fetch = FetchType.LAZY, tar...
Pitchfork asked 6/4, 2011 at 0:3

2

I'm running into an issue with adding JOIN's to a subquery using DetachedCriteria. The code looks roughly like this: Criteria criteria = createCacheableCriteria(ProductLine.class, "productLine"); ...
Gulp asked 8/4, 2010 at 18:34

1

Solved

Here is a more and maybe better description of the problem: I do a simple select query. The returning list contains the exact number of records/objects as if I do the same query in the DB, but the...
Maloriemalory asked 18/3, 2011 at 13:3

1

Solved

Using Hibernate's Criteria, I want to execute the equivalent of: select distinct uspscity, state from citycomplete where USPSCITY = 'HOUSTON' I thought doing the following would yield the result...
Solomon asked 4/3, 2011 at 16:5

4

Solved

is possible with Hibernate criteria do it? select A.something, B.something, C.something, D.something from A JOIN B on A.id = B.id_fk JOIN C ON B.id = C.id_fk JOIN D ON C.id = D.id_fk;
Aflame asked 12/2, 2010 at 14:33

© 2022 - 2024 — McMap. All rights reserved.