Questions tagged as 'criteria'

0
answers

Criteria throwing Java heap space due to the size of the Restrictions.in () clause

I am trying to run a query using Criteria but it is returning an Exception from "Java heap". It should probably be the amount of data I'm passing in the "in" clauses Here is a code that represents my query: Criteria c = session.createCriter...
asked by 22.03.2018 / 16:38
1
answer

Criteria to filter a string array list

I'm developing a Java Web application and came across a question. I have a relationship n: n between AgendaTriados and Indicacao thus forming the triados_indicacao. And when saved to the database, it saves a string array of the names of the indi...
asked by 05.03.2018 / 21:51
0
answers

Hibernate should mount query only with the required joins

I have list with createCriteria on it I have several ifs to query only the parameters queried on the form, however, the hibernete by default at the time of the query assembly joins all tables that have constraints: select *from volume this_...
asked by 07.03.2018 / 21:13
0
answers

JPA - You can use MatchMode.ANYWHERE with Predicate

Normally when I need to search using a single word using Criteria and Restrictions I do this as follows: Due to a need of the project, I'm having to do the research in a different way, so I decided to do a test using Predicate Follow th...
asked by 21.02.2018 / 23:41
0
answers

FetchType.EAGER: pagination with repeated data

I'm developing a Java system and came across a problem. There is a page called Calendar Triad that there is a list of enums, since the user could choose more than one answer option in which I will show the type of relationship I made so I could...
asked by 12.02.2018 / 21:17
0
answers

How to retrieve list of records of a given table by the amount of record that appears in another in the criteria / JPA

I'm sorry for the title if it's confusing, but my situation is this: In the system I'm creating a user can log several tips on anything he knows. while persisting the hint in the database will be stored in the hint a reference of the user who re...
asked by 03.02.2018 / 01:10
0
answers

Criteria Hibernate - Error

I'm getting the following Exception , I looked at my code and I can not find the error. The query is performed and returns the objects, but when it returns, it throws the exception . @SuppressWarnings("unchecked") @Override @Transactional...
asked by 23.05.2017 / 21:57
0
answers

Compare year and make the count registered in the bank

I wanted to count clients registered in my bank, born in the year 1930 to the current year (2017). In my bank I have registered as date , the date of birth ex: 2000-10-01 So I wanted to make a for comparing the year 1930 with...
asked by 23.03.2017 / 11:48
1
answer

List the 10 best selling products

I need to list the 10 best selling products in a table using Hibernate. The item_venda table has the following columns: quantity product_id community_value value_sub_Total
asked by 03.09.2016 / 16:36
1
answer

Using a Criteria NOT with Hibernate

Currently, I have a search with Criteria that brings me results normally, but I want to add an implementation of type NOT to it. Does anyone have an idea how I could do this? I put in the code a comment with a possible idea of the i...
asked by 27.07.2018 / 23:49