Questions tagged [hql]

For questions concerning "Hibernate Query Language" (HQL), a query language used by Hibernate and NHibernate. Use the tag [hiveql] for questions about Hive Query Language.

HQL, acronym for "Hibernate Query Language", is a powerful, object oriented query language used by the Hibernate and the NHibernate object relational mappers.

It is used in Java environments and is heavily inspired by SQL. Its syntax resemble SQL queries, but operates with Java Persistence API (JPA) entity objects rather than directly with database tables.

HQL can also be used on platforms such as Adobe ColdFusion

5074 questions
1
vote
1 answer

Multiple Table Join HQL (ASP.NET MVC 2 with Fluent nHibernate)

I have a web application written in asp.net mvc with fluent nhibernate. I have 4 tables in hierarchy. Which Vote -> Post -> Category -> Company I try to build a query which will list all company posts which voted in last 3 days. Take Votes of…
gandil
  • 5,398
  • 5
  • 24
  • 46
1
vote
1 answer

How to use LocalTime in select query with Quarkus Panache

I try to find my entity OpeningTimes for a specific LocalDateTime. My entity knows some days of week as Collection and two LocalTime as begin and end. My entity is this: package org.something.model; import…
Nicklas2751
  • 802
  • 1
  • 9
  • 22
1
vote
3 answers

Hibernate simple query but no rows returned

The following query doesn't return any rows List remedies = session.createQuery("from Remedy").list(); No errors, but nothing in the remedies list and there are rows in the table. What I have is 2 tables: remedy and remedyTranslation I have the…
CarbonMan
  • 4,350
  • 12
  • 54
  • 75
1
vote
1 answer

how to convert date from rows to columns as week numbers and get the price from the highest week number

Problem: I am trying to convert date from rows to columns as week numbers and get the price from the highest week number and call it givenPrice. expected:
Mona
  • 273
  • 1
  • 2
  • 13
1
vote
0 answers

Excel Int to date in Hive

I ingested csv table to a Hive table but the date is being shown as integer value. Is there a way to convert Integer value (stored as string) to date in Hive? When I do this select cast(day_id2 as date) from table1 ...I get null values: Can…
Wkhan
  • 95
  • 3
  • 11
1
vote
1 answer

Hive query fails with file not found error that should not be possible

I have a hive external table that is partitioned by the date and time it was inserted, say for example 20200331_0505 which is in YYYYMMDD_HHMM format. Currently there is only one partition: > hdfs dfs -ls /path/to/external/table -rw-r-----…
Jared DuPont
  • 165
  • 2
  • 14
1
vote
1 answer

Filtering arrays in hive

I have a hive table in that I am having a column called paid_value in an array format for each record. Now I want to filter the array such that the value must be between 1000 and 10000 for each record. I don't know how to do it. I know…
1
vote
1 answer

Hibernate IN query with two parameters

I need to construct a hibernate query that would do something like this: select p from Person p where (p.name, p.surname) in (('Peter', 'Black'), ('Thomas', 'Peterson'), ('Julia', 'Cook')) The length of the name/surname list is not defined upfront…
Matej Tymes
  • 1,694
  • 1
  • 16
  • 30
1
vote
1 answer

Fetching ElementCollecion from Hibernate based on a condition

I have a class named User and it has a element collection groups like below: public class User { @ElementCollection @CollectionTable(name = "user_groups", joinColumns = @JoinColumn(name = "id")) private Set groups; //Other…
Antony Vimal Raj
  • 364
  • 3
  • 14
1
vote
1 answer

Hive: How to output total row count as a variable

I have a dataset that I'm de-duping with the following code: select session_id, sol_id, id, session_context_code, date from ( select *, ROW_NUMBER() OVER (PARTITION BY session_id, sol_id, date) as rn, substr(case_id,2,9) as id …
lydias
  • 841
  • 1
  • 14
  • 32
1
vote
1 answer

HQL query returns different results comparing to same logic criteria query

I need some HQL guru to help me with a complicated query. My mappings are AccountingDocument: AccountingDocument extends Document @ManyToOne @JoinColumn(name = "gestiune_id", nullable = false) private Gestiune gestiune; @OneToMany(fetch =…
1
vote
2 answers

How to query map properties in Hibernate?

I'm learning HQL and I've an object with a Map property like this: @ElementCollection @JoinTable(name = "InfoLicenzaOrdine", joinColumns = @JoinColumn(name = "infolicenza")) @Column(length = 64000) public Map
gotch4
  • 13,093
  • 29
  • 107
  • 170
1
vote
2 answers

HQL not equal and not in Query is not working

@Query("SELECT i FROM ICD10CM i WHERE i.type NOT IN ('C') AND i.name LIKE %:icdString% OR i.code LIKE %:icdString% OR i.desc LIKE %:icdString%") List getICD10CMBySearch(@Param("icdString") String icdString); I'm getting the list of…
RaviChandra T
  • 87
  • 1
  • 3
  • 9
1
vote
1 answer

IllegalArgumentException: Could not locate named parameter

I pass a Map as parameter of the following method: public List getByParameterOrAll(Map paramsMap) { String email = null; String emailValue = null; String phone = null; String phoneValue = null; …
Jelly
  • 972
  • 1
  • 17
  • 40
1
vote
1 answer

java.lang.illegalargumentexception no query defined for that name [...]

I have a native query in plsql like this; create or replace package body DBPK_Monitoring is PROCEDURE monitoring_Search(cur OUT SYS_REFCURSOR,) is query VARCHAR(30000); whereClause VARCHAR(10000); BEGIN whereClause :=…
developers_
  • 31
  • 2
  • 7