criteria Questions
3
Solved
I am trying to set up a Criteria according to the Doctrine Docs.
Unfortunately they don't tell you how to access attributes of an related Object. Let me give you an example.
I have an ArrayCollec...
Sunshine asked 9/8, 2013 at 16:38
2
I have an entity where I have a field of type integer array.
class User {
@ElementCollection
@Column(name = "`location_ids`", columnDefinition = "int[]")
@Type(ListArrayType...
Disjunctive asked 21/6 at 4:33
5
Solved
I am currently using criteria to retrieve the details of a user, but when trying to query the details object with the right user, I get a ClassCastException.
My Criteria Code;
Criteria criteria ...
7
I have a Criteria with:
Criteria criteria= session.createCriteria(Libro.class).addOrder( Order.asc("ID") );
However, when I want to get the rowcount fail:
criteria.setProjection(Projections.row...
5
Solved
i have a hibernate query that is dynamically put together using the criteria api.
it generates queries that are unbearably slow, if executed as-is.
but i have noted they are about 1000% faster if ...
3
Solved
Summarizing, I Have 3 entities, the main one is the entity named "Rac". It contains a List of "RacNatureza", which contain a attribute "Natureza".
Rac
@Entity
@Table(name = "rac")
public class...
Loiretcher asked 17/12, 2018 at 17:25
6
Solved
I'd like to use Hibernate's criteria api to formulate a particular query that joins two entities. Let's say I have two entities, Pet and Owner with a owner having many pets, but crucially that asso...
2
Solved
Can someone please suggest me how to build up the following query using JPA Criteria builder API?
SELECT id, name, date, version FROM public.upgradeTable
order by (CAST(replace(version, '.', '')AS...
Centerpiece asked 29/8, 2018 at 5:17
5
I am using the averageifs function, and have one column where I need to calculate the average if either of the criteria are true.
I have tried using the OR function, and tried the curly brackets, ...
4
Solved
I have 2 POJO classes in Java, Answer and Collaborator, in a many-to-many relationship.
class Answer {
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "ANSWERS_COLLABORATORS", joinColum...
Leia asked 15/11, 2011 at 11:24
2
Solved
In MS Access 2010, I have a Query which quotes the following in the Criteria;
[Forms]![frm_Add_Item_Subform].[ActiveControl].[Caption]
This lets me use the "Caption" text of a Button within the ...
2
Is it somehow possible to create a criteria query that performs an outer join on another entity if that entity is not mapped?
I know that an inner join is possible when you do a cross join and add ...
9
Solved
Is there a way to get the (to-be-generated) SQL from a Hibernate Criteria?
Ideally, I would have something like:
Criteria criteria = session.createCriteria(Operator.class);
... build up the crit...
8
Solved
Is it possible to query "UNION" in JPA and even "Criteria Builder"?
I'm looking for examples, but so far i got no result.
Does anyone have any examples of how to use it?
Or would that be with na...
8
How do you add NOLOCK when using nhibernate? (criteria query)
Cruz asked 19/8, 2009 at 21:33
3
Solved
Which are the fundamental criterias for using supervised or unsupervised learning?
When is one better than the other?
Is there specific cases when you can only use one of them?
Thanks
Banns asked 4/7, 2017 at 13:49
9
Solved
I have been using Hibernate Restrictions in JPA 1.0 ( Hibernate driver ). There is defined Restrictions.ilike("column","keyword", MatchMode.ANYWHERE) which tests if the keyword matching the column ...
Swirl asked 2/1, 2011 at 20:14
1
I have below table temp_tbl (postgres):
ID(int) NAME(TEXT) LINKS(jsonb)
-------- ---------- -------------------
1 Name1 ["1","23","3", "32]
2 Name2 ["11","3","31", "2]
3 Name3 ["21","13","3",...
Some asked 10/5, 2019 at 6:46
1
Solved
I have a query that I want to translate to Criteria API.
A query
select a, b, c from myTable t where t.e = ANY(?1)
After java processes it (native sql query) the final query looks like this
select...
Jardiniere asked 5/10, 2021 at 19:40
4
Solved
I'm trying to find all entities that have some nested elements and nested elemens have collections of elements, and I need to find it by property of those collections.
It would be something like t...
Bruges asked 7/11, 2016 at 9:15
3
Solved
Consider the following JPQL query:
SELECT foo FROM Foo foo
INNER JOIN FETCH foo.bar bar
WHERE bar.baz = :baz
I'm trying to translate this into a Criteria query. This is as far as I have gotten:
va...
22
Solved
What are the pros and cons of using Criteria or HQL? The Criteria API is a nice object-oriented way to express queries in Hibernate, but sometimes Criteria Queries are more difficult to understand/...
Weak asked 13/10, 2008 at 12:47
5
I’m using JPA 2.0, Hibernate 4.1.0.Final and MySQL 5.5.37. I have the following two entities …
@Entity
@Table(name = "msg")
public class Message
{
@Id
@NotNull
@GeneratedValue(generator = "uui...
3
I have a question about Subquery class in jpa.
I need to create subquery with two custom field, but subquery doesn't have multiselect method and select method has Expression input parameter(In quer...
Engagement asked 26/2, 2014 at 7:29
1
I have a spring app with the user entity and the users table. I would like to get a number of all users grouped by certain fields (not per group but in total).
In sql It would be:
select
count(*) ...
Eniwetok asked 14/9, 2018 at 17:35
1 Next >
© 2022 - 2024 — McMap. All rights reserved.