Questions tagged [named-query]

A Hibernate (and NHibernate) feature that allows for both HQL and SQL queries to be written in the mapping document, keyed by a name. The main advantage is that your query is now residing in the same place as the definition of your mappings, instead of in your Java/C#/VB.NET/... code.

521 questions
-1
votes
2 answers

Query - Join from 3 tables

I need to do a join query from 3 table Professor , teacher and students. Each professor has a list of teachers and each teacher has a list of student. I am working on a web service which will give me only the professor id and base on that I need to…
Alina
  • 369
  • 3
  • 8
  • 18
-1
votes
1 answer

java.lang.IllegalArgumentException: No query defined for that name [Offices.getAllOffices]

I'm getting started with JavaEE and Wildfly(JBoss Server App.). My project is already operational, but, when I try to start my .xhtml page I receive an error from the server app. Caused by: java.lang.IllegalArgumentException: No query defined for…
Lycone
  • 650
  • 9
  • 18
-1
votes
1 answer

Cant get basic JPA working in a dropwizard application

I am trying to persist an object into the database using Dropwizard's JPA annotation. The object to be persisted TheObject.java @JsonIgnoreProperties(ignoreUnknown = true) @Entity @Table(name = "TheObject") @NamedQuery(name =…
user_mda
  • 18,148
  • 27
  • 82
  • 145
-1
votes
1 answer

JPA: Querying an object and single values from other entity

Is it possible with JPA to query a database to get an entity filled with an additional field belonging to another table/entity? I have a reservations table holding a foreign key to a record(an entity) in another table pois which has to columns of…
du-it
  • 2,561
  • 8
  • 42
  • 80
-1
votes
1 answer

jpa named query using foreign key is not working

MY Entity class @Entity @Table(catalog = "", schema = "MYIS") @XmlRootElement @NamedQueries({ @NamedQuery(name = "Answers.findAll", query = "SELECT a FROM Answers a"), @NamedQuery(name = "Answers.findByAid", query = "SELECT a FROM Answers a…
krishna
  • 27
  • 2
  • 7
-1
votes
1 answer

Altough I fixed the @NamedQuery, the previous error still continue, why?

I have a JPQL : @NamedQuery(name = "AsiErtelemeIptal.findPaketHastaAsiErtelemeIptalHastaOzlukByHastaKimlikNumarasi", query = "SELECT h,p,a,ho FROM Hasta h,Paket p,AsiErtelemeIptal a,HastaOzlukBilgileri ho WHERE…
yetAnotherSE
  • 3,178
  • 6
  • 26
  • 33
-1
votes
1 answer

could not resolve property: date

I am working on some codes to query a specific date. I have this in my Person.groovy: Date dateCreated static constraints = { dateCreated type:"date" } static namedQueries = { dateMe{ q-> eq("date.created", q) } } And I call it in a gsp like…
user1577161
  • 165
  • 1
  • 4
  • 18
-2
votes
1 answer

how to make a jpa query for multiple criterias

I'm using spring boot and thymeleaf in my web app, my question it's simple, i have a web form with 3 controls (initialDate, endingDate and name). I wanna catch those parameters and find them in a MySQL table at the same time. Could you help me…
-3
votes
1 answer

Rails named queries to grails

I have this in rails: default_scope { order('created_at DESC') } scope :by_source_name, ->(source_name) { where('source_name = ?', source_name) if source_name } scope :by_check_name, ->(check_name) { where('check_name = ?', check_name.upcase)…
user903772
  • 1,554
  • 5
  • 32
  • 55
-3
votes
1 answer

NamedQueries in JPA

From what I know, UPDATE and DELETE can be done by NamedQueries. However, void updateName (int ID, String name) { EntityManager entityManager = Persistence.createEntityManagerFactory("uPU").createEntityManager(); Query query…
Roam
  • 4,831
  • 9
  • 43
  • 72
-3
votes
1 answer

Perl Catalyst: How to use direct SQL in it Or something like named query

I want to know how to use direct SQL in Perl Catalyst Or something like named query.
jib
  • 1
1 2 3
34
35