Questions tagged [createquery]
76 questions
0
votes
1 answer
SQL Subquery IN SELECT [Symfony3]
I Have Table Actions with the following fields :
idAction
Cloture
Date
I'd Like to loop through and display a list of all idAction In my DB + idAction with Cloture = 0 Group By the same Date (both of them).
I tried below method. But it doesn't…

M.Mery
- 3
- 3
0
votes
0 answers
Symfony 3.2 create query with 2 subquery's
In my Symfony 3.2 project, I want to show all themes which are used in table1 and table2 by user_id = 1.
This is the MySQL-query which works perfect in PhpMyAdmin:
SELECT DISTINCT themes.*
FROM themes
WHERE EXISTS
(SELECT *
FROM table1
…

Jasper Poppe
- 481
- 2
- 7
- 16
0
votes
0 answers
How to compare two Pojo object values in HQL
I have two Pojo's Club and Team both has common table column called clubId, then i need to get records from the both the table when Club.clubId equals Team.clubId.
Could anyone help me to do check the equals based on the id's of two Pojos
I have…

Thirukumaran
- 357
- 3
- 5
- 17
0
votes
1 answer
SetParametres in Query
I'm trying to set a query with lot of parameters.
for a query with 1 param its working fine:
//**
List> list = null;
String query = String.format("from %s where %s = :%s ", a, uniqueField[0], uniqueField[0]);
list =…

FuSsA
- 4,223
- 7
- 39
- 60
0
votes
1 answer
NHibernate IStatelessSession CreateQuery failure
When we released last friday, I received an error which I do not get on acceptance. The error message is:
could not execute update query[SQL: delete from dbo.MyTable where col1=? and col2=? and col3=? and col4=? and col5=?]
My C# code is as…

Tjab
- 368
- 1
- 4
- 18
0
votes
1 answer
How avoid taking an object from a query, beyond a certain depth, in java-ee?
I'm trying to implement the 'following mechanism' in my Java EE application.
I have an Entity Profile that contain, among other things, a List, which is the list of the profiles that the user follows. Le relation is (@OneToMany).
Everithing is…

andrea22
- 1
0
votes
1 answer
How to access objects values of Symfony2 doctrine createQuery result? Call to undefined function MeetingBundle\Controller\getId()
How to access objects values of Symfony2 doctrine createQuery result? I would like to retrieve array of entities objects, and than getId of each entity.
use MeetingBundle\Entity\Event;
class EventController extends Controller{
..
public function…

olga
- 959
- 1
- 15
- 42
0
votes
1 answer
Syntax Error line 0, col 83: Error: Expected end of string, got 'cbfde50'
The following is my class with the method:
class BidsInfoRepository extends EntityRepository
{
public function findbidWinnerQuery($productId) {
return $this->getEntityManager()
->createQuery("SELECT w FROM…

armslegs
- 1
- 1
- 4
0
votes
1 answer
Can not create the query using entity manager
When i am executing this code (JPA)
Query q=entityManager.createQuery(SELECT mc.account_no,mc.expiry_date,
SUM(CAST(CONCAT(mc.sign,mc.balance) AS NUMBER)),mc.moneybank_id FROM muthutcardbalance mc
WHERE mc.account_no='20' AND…
user5122076
0
votes
0 answers
Symfony2 createQuery returns no line because of join which return null
I have a simple query
$query = $em->createQuery(''
. 'SELECT c.id, c.firstname, c.lastname, coun.country '
. 'FROM OandPboBundle:Clients c '
. 'JOIN OandPboBundle:Countries coun WITH coun.id = c.country '
…

sim100
- 129
- 2
- 12
0
votes
1 answer
Intellij IDEA cant resolve symbol on string character
I have an strange problem with Intellij IDEA 14 ultimate
Here my createQuery() argument is in String , but IDE take error for it:
The from Book where isbn= :isbn line is in " ".
user3808021
0
votes
2 answers
JPQL createQuery is incompatible with query return type Collection
I want to get my profile in class Tournee (profil_tournee) list based on my tours ("tournee"). However, I have an exception. Can anyone help me?
Exception in thread "AWT-EventQueue-0"
java.lang.IllegalArgumentException: Type specified for…

melopo
- 1
- 1
- 1
0
votes
1 answer
Doctrine createQueryBuilder - If Where Parameter is Empty Get All Records
My Query Builder :
$nameParameter="david";
$query=$this->entityManager->createQueryBuilder()
->from('Person\Entity\User', 'u')
->select("u")
->where("u.name = :name")
…

S H
- 35
- 2
- 6
0
votes
1 answer
How to show values from list(values from database) in form?
In my db I have 3 tables, show on image. I wan't to get data from store table and show in form. But I've a problem with my list. Query in database work good, and in program also got objects, but don't want to show on form. What problem??
Entity…

badCoder
- 111
- 1
- 16
0
votes
3 answers
JPA createQuery working but createCriteria not working session is closed error
I am trying to use Criteria API from Hibernate by getting hibernate session from EntityManager as following
public org.hibernate.Criteria getCriteria() {
HibernateEntityManager hem = em.unwrap(HibernateEntityManager.class);
…

Niraj Patel
- 33
- 1
- 9