Most voted "hql" questions
HQL is a Hibernate (ORM) query language very similar to SQL. However, compared to SQL, HQL is fully object-oriented and comprises notions of inheritance, polymorphism, and associations. If the question is not about "HQL", do not use this tag, even if you are using "HQL" in your project.
Learn more…38 questions
Sort by count of
-
5
votes1
answer588
viewsDifferences between Criteria and HQL
In the booklets I read and tutorials I accompanied the Criteria is more used, but I identified more with HQL. But I have the following doubt, all that is done with Criteria it is possible to do with…
-
4
votes1
answer824
viewsCreate Dto by Constructor with a List parameter of a Hibernate entity
I have a @Query Spring, which performs a database query by an Entity, to create some Objects DTO. And the properties of this DTO object, I pass via Constructor, but I needed to pass as parameter in…
-
3
votes1
answer686
viewsHQL query with ENUM list as parameter
Hello, I have the following problem, follow an example: I have an entity Banda which has as attribute a list of generos List<Generos> generos, Generos is an ENUM with the following values:…
-
3
votes1
answer73
viewsHQL query in C#
Guys, I’m having trouble with HQL and C#. I have the following method: public IList<int> GetListYear(Guid educationalInstitutionId, Guid academicLevelId, Guid? locationId, Guid?…
-
3
votes1
answer726
viewsReturn values of all months of the year extracting by month
I’m with the following SELECT: SELECT coalesce(sum(vs.total), 0) FROM tabela_exemplo t WHERE extract(year from t.data_entrada) = extract(year from current_date) GROUP BY extract(month from…
-
3
votes1
answer458
viewsorg.hibernate.Propertynotfoundexception: Could not find Setter for sum on class Class
People I’m trying to list the best selling products using Sqlquery (if anyone knows of other ways to perform as eg using Criteria, Projections also accepted) with Hibernate, but this error is…
-
3
votes2
answers2261
viewsI need to do a SUM inside Group BY in Lambda
I’m trying to create a summary report where it consists of making a GROUP BY with SUM, i want to know how I could do it in c# with lambda or hql(Nhibernate), I managed to do a GROUP BY, but I can’t…
-
3
votes1
answer562
viewsHow to optimize Hibernate query
I am developing a system in JAVA and use Hibernante to generate my queries with the bank. I need to solve the following problem: I have some classes that belong to an entity and I need to execute a…
-
1
votes1
answer1177
viewsHow to get a value from a list
I need to take the value generated in the ${stores.nmFrameLocator} field and display the value in Alert: lojaMapa() <script> function lojaMapa() { var tc =…
-
1
votes0
answers279
viewsError: Java.lang.Stackoverflowerror:, com like no Hibernate(loop Query.getResultList())
I have a method: public static List<Texto> getTextoPorIdAlternativoLike(String idAlternativoTexto) { Texto texto = new Texto(); String where = "t.idAlternativo like :idAlternativo";…
-
1
votes1
answer336
viewsHow to perform a HQL query in C#?
I need to create an HQL query within a method in C#. The structure goes like this: I have the method: IList<int>GetListYear(Guid educationalInstitutionId, Guid academicLevelId, Guid?…
-
1
votes1
answer153
viewscreateQuery(HQL) returns Nullpointerexception when trying to perform LEFT OUTER JOIN
Personal talk, I have a problem trying to run an HQL on my application. The HQL is basically this: select c.id, c.solicitante from <mypackage>.Exame c LEFT OUTER JOIN…
-
1
votes1
answer69
viewsHibernate - Dynamic Instantiation using Factory
I know that using the Dynamic Instantiation of Hibernate I can instantiate an object according to a constructor. The Problem: I need to optimize the system as much as possible, and with that ended…
-
1
votes1
answer145
viewsRunning Query with SUM in HQL?
I’m trying to use the SUM to sum an attribute of an entity using HQL of NHibernate, but whenever I execute the query returns empty. I am following the example here but I still can’t do it. How to do…
-
1
votes2
answers113
viewsHow to make a query per ID in HQL using the LIKE operator?
How do I make this consultation in HQL? select * from entidadeQualquer where id::text like '%12'; I tried the code below but it didn’t work: select c from entidadeQualquerc where c.id like '%12';…
-
1
votes1
answer62
viewsSQL function with mysql
I am implementing a function for a vendor search field and my sql function is in trouble, would anyone know what problem? This was a function of when using postgree, but now I’m using mysql. package…
-
1
votes0
answers395
viewsJava Hibernate Query (HQL) with foreign key... ERROR!
I need help with my code, I have two tables: -CDF (official register) CREATE TABLE public.cdf( ativo character varying(1) COLLATE pg_catalog."default", reg integer NOT NULL, nome character…
-
1
votes1
answer180
viewsDelete a Hibernate Record Limit (Limit)
I am migrating my web application to the framework Hibernate, but I have several requests SQL with very specific parameters. In one of these requests, I always need to include a new record in the…
-
1
votes2
answers67
viewsTrying to search with specific id in a period
I’m trying to get a car specific between dates, because it works in periods, more need to get the element ID, I do not know if I would have to apply some other query or include in it, the bank I use…
-
1
votes2
answers103
viewsDoubt with Joins in HQL query
I have the following problem when conducting a bank consultation with HQL The table tabela1 has approximately 20000 records. The other tables have "N" records. The table tabela1 has relationships…
hqlasked 6 years, 10 months ago Vinicius Silva 300 -
0
votes1
answer485
viewsHow to insert a String variable into an hql?
I need to make a query in the database and return only the values based on the variable, my code returns the list with all the data of the city field, I want to return only the cities based on the…
-
0
votes1
answer208
viewsQuery in HQL using Hibernate
How to do a query to return the result below in HQL Upshot | quantidade | quantidade erro | desc | | 2 | 1 | TESTE 1 | | 3 | 2 | TESTE 2 | | 1 | 1 | TESTE 3 | Table | DESC | ERRO | | TESTE 1 | 0 | |…
-
0
votes2
answers854
viewsPut default value in column
I need to leave a default value in this table column, I am mapping the Persistances with Hibernate (summarizing the database is created according to the HQL/JPA I define in Omains. How do I set a…
-
0
votes2
answers2013
views -
0
votes1
answer172
viewsReturn person and phone list
I have an entity called Pessoa. This entity has a phone list of the entity Telefone. How do I bring the person information and popular the phone list of this person in a select with only hql? When…
-
0
votes1
answer59
views -
0
votes1
answer2056
viewsorg.hibernate.Queryexception: could not resolve Property: Request of: Classes.Client
I’m having trouble mounting a query in HQL in Hibernate,: Exception in thread "AWT-Eventqueue-0" org.hibernate.Queryexception: could not resolve Property: Request of: Classes.Client [select c from…
-
0
votes1
answer45
viewsJoins with daughter entities
I have a parent entity called OCR, this has 2 that are specialization(inheritance): OCR_A, OCR_B. My hql needs to contemplate the 2, IE, I need to give Join in the 2. I start like this: select o…
-
0
votes1
answer132
viewsReturn search HQL JAVA
I have the following function that searches in BD a user that satisfies the login and password passed by parameter: public Usuario getUsuarioLogin(String pLogin, String pSenha) { String hql = "…
-
0
votes3
answers97
viewsI cannot save my Selectmanycheckbox Primefaces in the database
My View Cad Medico xhtml <p:selectCheckboxMenu id="multiple" value="#{medicoBeanView.objetoSelecionado.especialidades}" label="Especialidades" multiple="true" filter="true"…
-
0
votes2
answers994
viewsSubquery in Java HQL
Hello, I am in a project that uses geolocation and I am doing a feature to list the stores closer to the location chosen by the user. I am using the Postgresql database and I made this query to…
-
0
votes1
answer907
viewsError with Unexpected JPQL token
I made a select JPQL but I’m having this error: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: where near line 1, column 151 [select pes, pEnd from…
-
0
votes1
answer171
viewsDoubt in HQL when doing Sum function
I have a doubt in hql. My system has 3 tables Tabela1 and table 2 and table 3 table 3 stores the primary key records of Table 1 and table2 for making relationships. Table 1 can contain N…
-
0
votes1
answer116
viewsDoubt in JPQL/HQL query
I need to make an appointment in HQL and I have this entity Hibernate. @Entity @Table(name = "TB_TIPO_DOCT", schema = "FEP") @NamedQueries({ @NamedQuery(name =…
-
0
votes1
answer815
viewsHQL with case, sum and max
I’m with a query that is giving problem, I believe the problem occurs for not allow to use the function max, within the function sum, am I correct? How can I get around this? Because I need to add…
-
-1
votes1
answer862
viewsBuilding select in HQL
I’m starting to use JPA with Hibernate and I’m having doubts about the HQL query, I did some research on the Query hql but I couldn’t understand much. I want to do this select in hql only I did not…
-
-1
votes1
answer18
viewsIt is possible to perform queries in a table that is not mapped by Hibernate
I would like to list data from a table that is not mapped by Hibernate; that is, I have an Endity map table and I want to report a search in a table in my database that is not an Entity. That’s…
-
-1
votes1
answer70
viewsHow to remove a Where from @Query in Spring Jparepository
I am using Spring BOOT with Starter JPA and java 8 and I have this query in my Repository : @Query("select p from Product p where p.name like %:name% and p.costValue = :costValue and p.saleValue=…