Questions tagged [createquery]

76 questions
1
vote
2 answers

java.lang.IllegalArgumentException

I am executing a unit test and keep getting this error for the following code: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager: Exception Description: Syntax error parsing [SELECT t1 FROM Test1 t1,…
lamostreta
  • 2,359
  • 7
  • 44
  • 61
1
vote
0 answers

How to create complex query symfony2 doctrine

Hello I want to create a complex query where I need request info from 5 tables and group it by companies.name applying a filter by branches.idMunicipality my query is the next: $em = $this->getDoctrine()->getManager(); $companies =…
EsopMx
  • 85
  • 1
  • 10
1
vote
1 answer

problems executing connection.createQueryDef in Access

I'm new to VBA and I'm having problems using createQueryDef method with a connection object. I'm just trying to create a query from a table that is in a SQL server database, simply to make the data appear in Access. I opened the connection and then…
LeGo
  • 35
  • 4
1
vote
1 answer

symfony 2 doctrine $query->getArrayResult() how to remove selected key->values from result

As I don't want id values from a select with createQuery, but the select command doesn't allow omitting id (primary key) from the actual query (using "partial") I need to remove the id's from the result from getArrayResult()
Chris
  • 175
  • 1
  • 1
  • 12
1
vote
2 answers

UNION in createQuery with symfony2

I'm trying $query = $em->createQuery( 'SELECT id, name, beginDate, endDate FROM SmartguideEntityBundle:Promotion1 UNION SELECT id, name, beginDate, endDate FROM SmartguideEntityBundle:Promotion2' ); But result is Error:…
hoangvu68
  • 845
  • 2
  • 13
  • 28
1
vote
2 answers

Doctrine join query to get all record satisfies count greater than 1

I tried with normal sql query SELECT activity_shares.id FROM `activity_shares` INNER JOIN (SELECT `activity_id` FROM `activity_shares` GROUP BY `activity_id` HAVING COUNT(`activity_id`) > 1 ) dup ON activity_shares.activity_id =…
stefun
  • 1,261
  • 3
  • 24
  • 54
1
vote
1 answer

[ERROR] ORA-00918: column ambiguously defined

There are two entities: @Entity @Inheritance(strategy = InheritanceType.JOINED) public class Person implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; ... } @Entity public class Man…
abg
  • 2,002
  • 7
  • 39
  • 63
1
vote
1 answer

A select JPA query that ignores the related entities of one-to-many relation, is that possible?

I am new in JPA, so excuse me if my question seems basic. I have an entity called User, which is related to a list of other entities like follow: @OneToMany(cascade = CascadeType.ALL , mappedBy = "user") private List sessionList; In a…
Rami
  • 8,044
  • 18
  • 66
  • 108
0
votes
1 answer

executeUpdate in createQuery does not update my database

public void updateUserState(User user) { Session sess=getSession(); sess.setFlushMode(FlushMode.MANUAL); String queryStr = "update User usr set usr.logCount = :logCount , usr.isLocked = :isLocked , usr.lastLogin = :lastLogin…
Sneha
  • 233
  • 2
  • 13
0
votes
1 answer

Symfony createQuery winth multiple table

I would like to recover the user who wrote the post, only I have an error when I try to do it "Attempted to call an undefined method named "getIdPost" of class "App\Entity\User"." $em = $this->getDoctrine()->getManager(); $query =…
Bastien
  • 63
  • 6
0
votes
1 answer

Hibernate createQuery() for Date_add

I am trying to implement the following SQL query in hibernate HSQL. Instead of value '7' I have to pass a dynamic value 'delivery'. SELECT quote_key , delivery_date FROM Orders WHERE delivery_date >= DATE_ADD(now(), INTERVAL '-7' DAY); DAO…
Majo
  • 15
  • 6
0
votes
0 answers

how to join two tables using hibernate createQuery or criteriaQuery how to map using annotation

package com.employee; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import…
BeSmart
  • 1
  • 3
0
votes
1 answer

Hibernate CreateQuery sum() always returning Long type

I did a query to get the sum of values in a table: List resultList = (List) em.createQuery("SELECT sum(v.prices) FROM Ship v).getResultList(); The problem is that even though i typed as Double, the return continues to be Long…
AllanJack
  • 55
  • 1
  • 7
0
votes
1 answer

QuerySyntaxException hibernate invalid path on EntityManager createQuery

I am sending from the frontend a value to search on two properties of my entity Producto. That properties are Codigo and Descripcion. The issue is that when the line TypedQuery typedQuery = em.createQuery(queryCount); hits, this exception is…
Pablo De Luca
  • 795
  • 3
  • 15
  • 29
0
votes
2 answers

Unable to use createQuery() in typescript

I am trying to create a query using the following- https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/api/tfs/workitemtracking/restclient/workitemtrackinghttpclient2_2#method_createQuery I am developing a vsts extension…
Anusha B
  • 95
  • 1
  • 1
  • 8