criteria Questions

3

Solved

I'm trying to do something like this, but using Criteria instead of HQL: select user from User where user in ( select user from UserDomain where domain.id = "XXX" ) User being an entity having ...
Spirituality asked 6/12, 2013 at 14:45

1

Hibernate provider does not generate prepared statement for non-string type parameters unless they are set to entityManager.createQuery(criteriaQuery).setParameter(Parameter p, T t); as done by Ecl...
Coquette asked 23/11, 2013 at 11:40

1

Solved

I have a many-to-many relationship in JPA 2.0 provided by Hibernate 4.2.0 CR1 (recently upgraded to Hibernate 4.2.7 final) between Product and Colour as follows. The Product entity class: public ...
Reword asked 10/11, 2013 at 8:56

1

Solved

I'm using JPA 2.0 in EclipseLink 2.3.2 in which I have a many-to-many relationship between products and their colours. A product can have many colours and a colour can be associated with many produ...
Goad asked 7/11, 2013 at 8:17

5

Solved

How is this possible, I have to following criteria Criteria criteria = getSession().createCriteria(c); criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); criteria.add(Restrictions.eq("...
Toughminded asked 2/2, 2010 at 11:28

3

Solved

I have a criteria that returns all data the application requires, basically: Criteria criteria = session.createCriteria(Client.class); criteria.createAlias("address", "address"); criteria.setResul...
Airliah asked 16/8, 2013 at 14:54

2

Solved

I have this class mapped as a entity, lets call it Person. Person has an embedded/component relation to Address. I am having trouble using a Criteria that would return Address objects. I have trie...
Aeromarine asked 24/9, 2009 at 14:2

3

Solved

first post here and hopefully relevant to many people. I'm working on writing integration tests for a domain and on that domain I have a query using the withCriteria() method. I've searched all ov...
Fame asked 3/6, 2011 at 21:36

4

I have a class Person who has a set of Books. It is not meaningful in the particular case to have an ordered or sorted collection. Say now that I have a search page with a table showing the join o...
Amil asked 1/4, 2010 at 13:17

1

for a paged data (paginated) I need to return the total number of records matching my criteria and the results first page. this is useful to display information for the users and calculate the tota...
Magen asked 28/7, 2013 at 8:24

0

I have a serious issue with Criteria Query. My entity class looks like this: class X { ... @Columns(columns = { @Column(name = "priceCurrency", nullable = false), @Column(name = "priceAmount"...
Telemachus asked 11/7, 2013 at 6:3

1

I have the following property in my hibernate entity: @ElementCollection(targetClass = String.class, fetch = FetchType.EAGER) @CollectionTable(name="FORMDATA", joinColumns = @JoinColumn(name="FORM...
Descry asked 6/5, 2013 at 15:1

4

Solved

I have a domain class called Order and that class has hasMany relation with Item class. When I am querying for the list of orders with certain restrictions I am getting as many instances of Order a...
Northman asked 19/10, 2011 at 12:26

4

Solved

I have two tables, DVD and Contact. A DVD can be rented to a contact and a contact can rent many DVD's. The many to one link (dvd-->contact) works fine. But the other way fails: (contact--&gt...
Mordred asked 3/1, 2011 at 12:24

1

Solved

I have to write a method such as public List<Integer> findIds(String someVendor) that gets only the IDs of entities matching a given property value (example, vendor). Given this example pub...
Memory asked 17/6, 2013 at 10:17

3

Solved

Can I use Criteria queries with EJB3 entities? If so, how can I combine them with EntityManager?
Horvitz asked 16/10, 2009 at 13:37

5

My organization is currently implementing Scrum. While working on a product backlog item to change the way some business logic is processed, we realized that some of the business logic is fla...
Hard asked 13/2, 2013 at 17:6

2

Solved

i have two entities named Parent and Child, linked in a one-to-many relationship. The Child entity has a boolean isStudent property. How do i get, using the Hibernate Criteria API, all the Parent...
Afflatus asked 4/6, 2010 at 9:29

1

Solved

This code give me a list of two items Datetime and count. But I need group it by date without time. Can anyone give me a clue how to do it? Thanks! Criteria criteria = getSession().createCriteri...
Berthoud asked 4/5, 2013 at 11:28

2

Solved

If I have an @OrderBy("someProperty") annotation on an object and then use a Criteria to add an ORDER BY clause like so: criteria.addOrder(Order.asc("id")); The resulting SQL will do the orderi...
Haletky asked 21/9, 2010 at 9:58

1

Solved

I have been Googling but do not understand what the consequence of calling the method correlate of javax.persistence.criteria.Subquery en the Criteria API. http://www.objectdb.com/api/java/jpa/cr...
Infecund asked 7/3, 2013 at 13:16

1

Solved

This is the query that I am trying to write in Criteria: SELECT * FROM abc WHERE NOT PartType IN ('0','4','5','6','7','a','b','c') The above is in iBatis. So this is the hbm.xml for the tab...
Gudrin asked 27/2, 2013 at 18:53

2

Solved

I've read about subquery in Criteria, but I am still unable to grasp it properly. Here I am taking one example and if somebody can help me write that using subquery it will be great. Lets say we h...
Olshausen asked 6/5, 2010 at 7:9

1

Solved

I need help on creating hibernate criteria for nested object. For example : class office{ Integer id; OfficeDetails cmdData ; } class OfficeDetails { Integer id; Region region; } class Regi...
Prothorax asked 17/10, 2012 at 15:48

2

Solved

I have a DataTable. I want to select the rows based on the Index/Row Number of the rows in DataTable. Suppose below is the DataTable: ---------------- --------------- | ID | Name | | Index/RowNo...
Kimberlykimberlyn asked 17/10, 2012 at 9:10

© 2022 - 2024 — McMap. All rights reserved.