Questions tagged [createquery]

76 questions
16
votes
4 answers

Is there possible to use createQueryBuilder for insert/update? If not, what function should I use?

For now I succeded to create a function that retrieves data from the database using Doctrine's function createQueryBuilder. Does anybody know if there is a similar function to insert or update the database? Or how can i use createQueryBuilder?
user1482442
  • 567
  • 2
  • 7
  • 14
16
votes
3 answers

Can't find CreateQuery() method

I'm a new beginner to the entity framework . and i can't find the following method CreateQuery() why i can't find this method ?!!
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
6
votes
2 answers

Symfony2 createQuery order by field

Hi i have this query writen in phpmyadmin and it works gr8. SELECT u.* FROM users AS u WHERE u.id = 14469 OR u.id = 685 ORDER BY u.id, field(u.id, 14469, 685) But i need to write it in symfony2. How it will looks like?…
Lukas Lukac
  • 7,766
  • 10
  • 65
  • 75
5
votes
1 answer

symfony2 querybuilder orderby count manytomany

I have an entity called School, it has a ManyToMany relation "methods" class School{ /** * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * @ORM\Column(type="integer") */ protected $id; /** * @ORM\ManyToMany(targetEntity="Method",…
Lisa Van Daele
  • 95
  • 1
  • 1
  • 9
4
votes
1 answer

Java check if long lat in 1 km circle

I'm working on a Java EE project an have and entity like this: @Entity public class Location { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long messageId; @ManyToOne private User user; private String name; private…
Erdinç Özdemir
  • 1,363
  • 4
  • 24
  • 52
3
votes
1 answer

Parameter value [100] did not match expected type [java.time.LocalDateTime (n/a)]

I am facing weird problem in one query select * from sbill.act_sub_t where (act_sub_t.unsub_dt - act_sub_t.sub_dt) < 100; Using this query i am getting result in oracle sql developer tool but facing below issue with java. Parameter value [100]…
Harish Bagora
  • 686
  • 1
  • 9
  • 26
3
votes
2 answers

Parameter value [2] did not match expected type [com.cityBike.app.model.User

I receive the error of java.lang.IllegalArgumentException: Parameter value [2] did not match expected type [com.cityBike.app.model.User (n/a)] at org.hibernate.jpa.spi.BaseQueryImpl.validateBinding(BaseQueryImpl.java:885) at…
user4406224
3
votes
1 answer

Entity Framework 5, Code First, Full Text Search but IQueryable via CreateQuery?

I am using .NET 4.5 and EF 5 with Code First approach and now I need to implement Full Text Search. I have already read a lot about it and so far my conclusions are: Stored procedures nor Table Value Functions can not be mapped with Code…
borisdj
  • 2,201
  • 3
  • 24
  • 31
3
votes
2 answers

Doctrine (Symfony 2.0.x) createBuilder one-to-many - no idea how to get the right Entities

I'm searching the net for hours now and can't find a soluting for the following (reduced) problem: I have two entities in my Symfony2-project: /** * @ORM\Entity(repositoryClass="myBundle\Entity\AppuserRepository") * @ORM\Table(name="appuser") …
Sammy
  • 1,178
  • 1
  • 14
  • 27
2
votes
3 answers

hibernate hql sum case when then else end execution in java problem

I need to execute a HQL query with sum when then else end clause in Java that run with no problem in postgres : SELECT r.reviewer_id, sum(case when c.service_type = 'مالتی مدیا' AND c.genre_id = '66c92962-324c-11e7-93ae-92361f002671' then 1 else 0…
Fatemeh Asadi
  • 83
  • 1
  • 11
2
votes
2 answers

Symfony2, doctrine2, createQuery, how to search IN array?

How to search in array? Please advice and esptially advice about case (c) below. I do not understand where is my mistake. I try to search for Doctrine column keyword in array in several ways. The code below is for debugging purposes, query itself is…
olga
  • 959
  • 1
  • 15
  • 42
2
votes
1 answer

Symfony2, get elements from manytomany relation in controller

I have an entity "Clients" with a relation manytomany with an entity "Preferences", so there is an intermediate table clients_preferences of course. The relation works FINE and for a client I can display all its preferences in TWIG with something…
sim100
  • 129
  • 2
  • 12
2
votes
1 answer

NHibernate CreateCriteria and CreateQuery generates different sql?

I'm new to NHibernate and can't figure out why these two statements generates different sql. the first one only get the ClientInformation (with Information and Client being Proxies) which is what i want. return repository …
2
votes
1 answer

How to query by partitionkey in Azure Table Storage?

I have the following TableServiceContext class for books, I want to query the table Books by the partitionKey, please ignore the fact that I'm using the partition key as the book name, this is just for my learning sakes public class…
Nevin Mathai
  • 2,316
  • 13
  • 39
  • 54
2
votes
1 answer

Where is CreateQuery in Entity Framework 6

Simple question - where is dbContext.CreateQuery method in Entity Framework 6 and if the answer is there is not such method my question is what to do to get some data by SQL query to an objectQuery?
user3235395
  • 21
  • 1
  • 3
1
2 3 4 5 6