criteria Questions
1
I have an entity with a set say like
Library---><Set>books
Now I want to retrieve the libraries where ALL the books have a genre.
So I have something like this:
c.createCriteria("lib...
4
Solved
I have problem with getting rows from my database using Hibernate. When I would like to get only one row, I am receiving 20. When I would like to get all of rows from table with about 1.5k rows, I ...
Verso asked 9/10, 2012 at 8:32
1
Solved
I'm currently doing like this.
final CriteriaBuilder builder = ...;
final boolean flag = ...;
if (flag) {
builder.isTrue(expression);
} else {
builder.isFalse(expression);
}
Can I use it like...
Chrysostom asked 24/8, 2012 at 6:31
1
Solved
Hi i want to write a query using criteria :
The following query has to be created using criteria:
"Select Distinct(s2Taxper) from S2 where s2Tc='601' AND s2Txcd!=''"
thanks in advance
2
Solved
I am creating an application with J2ME. for connecting with database i am using RecordStore.
so to get a record i need to write as follow:
public boolean SearchRecord(String Rec, int pos )
{
St...
2
Solved
I am writing a very simple query, but I am getting duplicate values for some reason.
Criteria cr = session.createCriteria(ProcessInstance.class, "p")
.add(Restrictions.isNull("end"));
@Cleanup Sc...
Teleran asked 10/1, 2011 at 9:47
2
Solved
How can I know the position of a record in a JPA query?
I have a service that returns paged results implementing more or less a method with this signature:
List<Record> getRecordsPage(long ...
2
Solved
In my model I have an abstract "User" class, and multiple subclasses such as Applicant, HiringManager, and Interviewer. They are in a single table, and I have a single DAO to manage them all.
Use...
Lamb asked 7/7, 2010 at 22:52
1
Solved
So I have a Users table, Projects table and User_Roles table. I have one users which is connected to 2 projects, but when I have just one role for him it returns those 2 projects, but if I have 2 r...
Adriene asked 3/7, 2012 at 21:41
1
Solved
I am using python bindings of OpenCV 2.3.1 and I'm stuck. I'm trying to make an LK tracker. I'm using cv2.calcOpticalFlowPyrLK() http://opencv.willowgarage.com/documentation/python/video_motion_ana...
4
I need to get the count of rows from a criteria query and the criteria got group by projections. (needed to get paging to work)
E.g.
projectionList.Add(Projections.GroupProperty("Col1"), "col1")...
Dupree asked 11/4, 2012 at 12:42
1
Solved
I have been trying different combinations of HQL and Criteria and I haven't been able to avoid some unnecessary joins (in both) and some unnecessary selects (in Criteria).
In our scenario, we have...
Refine asked 19/5, 2012 at 12:16
1
In my Grails project, I have the following classes:
class A {
static hasMany = [cs:C]
}
class B {
static hasMany = [cs:C]
}
class C {
static belongsTo = [a:A, b:B]
}
I would like to query t...
3
Solved
does anyone know if and how the solution for following question (which is written in the JPA API) can be written using the hibernate criteria API?
To be more specific I have a Discussion entity th...
2
I have the following scopes defined in my model:
scope :upcoming, -> { where(:start_time.gt => Time.now).asc(:start_time) }
scope :in_progress, -> {
now = Time.now
where(:start_time.lte...
Bombazine asked 21/4, 2012 at 3:51
1
Solved
I'm writing a criteria to make a query, but I can't figure out how to negate an inList criteria...Is there a way to do something like:
def result = c {
not inList('id', ids)
}
Thanks
Refulgent asked 2/5, 2012 at 11:44
4
Solved
I'm used to work with Criteria API in Hibernate, and just watched how the Criteria in JPA 2.0 work.
What i like most in the Criteria of Hibernate is the ease we have to compose with Criterio...
1
Solved
I have a problem with hibernate and criterias. I have two Classes:
public class Place{
long id;
String name;
Set<Street> streets;
}
public class Street{
long id;
String name;
Place pl...
Tropopause asked 2/4, 2012 at 19:46
5
How can I compile Propel Criteria to clear SQL?
I've tried $criteria->toString(); but this is not I expected.
Also I've tried ModelPeer::doSelectStmt($criteria) but it returned raw sql (required pa...
1
Solved
I have the following four tables:
SCHEDULE_REQUEST TABLE:
ID,
APPLICATION_ID (FK)
APPLICATION TABLE:
ID,
CODE
USER_APPLICATION TABLE:
APPLICATION_ID (FK),
USER_ID (FK)
USER TABLE:
ID,
NAME
...
2
Solved
I was going through hibernate and situations when to use Criteria vs HQL and my understanding is that with Hibernate, everytime when we are querying database either by Criteria or HQL in both insta...
1
Solved
I have an odd business requirement.
We have multiple, unrelated entity types that will need to be displayed in a unified list, with some basic information from the entity, sorted by the only field...
Depreciation asked 23/1, 2012 at 14:44
1
Solved
I am looking for a hibernate criteria to get following:
Dokument.class
is mapped to Role
roleId
Role.class
has a ContactPerson
contactId
Contact.class
FirstName
LastName
I want to search for First ...
1
Solved
I have a query created with Hibernate Criteria like this:
Criteria criteria = db.getSession().createCriteria(Vendor.class);
criteria.addOrder(Property.forName("shortName").asc());
List<Vendor&...
Downtrend asked 25/11, 2011 at 13:18
2
I'm using spring-hibernate and using HibernateDAOSupport class.
I have two tables mapped to each other in one-to-many fashion.
I'm implementing the below criteria
DetachedCriteria criteria = get...
© 2022 - 2024 — McMap. All rights reserved.