title: javax.persistence.NoResultException: No entity found for query JPQL Query
body: <pre><code>@Entity
  @Table(name = "ways", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = "gid"))
  public class Ways implements java.io.Serializable {
  private WaysId id;
  
  public Ways() {
  }
  
  public Ways(WaysId id) {
      this.id = id;
  }
  
  @EmbeddedId
  @AttributeOverrides({
          @AttributeOverride(name = "gid", column = @Column(name = "gid", unique = true)),
          @AttributeOverride(name = "classId", column = @Column(name = "class_id", nullable = false)),
          @AttributeOverride(name = "length", column = @Column(name = "length", precision = 17, scale = 17)),
          @AttributeOverride(name = "name", column = @Column(name = "name")),
          @AttributeOverride(name = "x1", column = @Column(name = "x1", precision = 17, scale = 17)),
          @AttributeOverride(name = "y1", column = @Column(name = "y1", precision = 17, scale = 17)),
          @AttributeOverride(name = "x2", column = @Column(name = "x2", precision = 17, scale = 17)),
          @AttributeOverride(name = "y2", column = @Column(name = "y2", precision = 17, scale = 17)),
          @AttributeOverride(name = "reverseCost", column = @Column(name = "reverse_cost", precision = 17, scale = 17)),
          @AttributeOverride(name = "rule", column = @Column(name = "rule")),
          @AttributeOverride(name = "toCost", column = @Column(name = "to_cost", precision = 17, scale = 17)),
          @AttributeOverride(name = "maxspeedForward", column = @Column(name = "maxspeed_forward")),
          @AttributeOverride(name = "maxspeedBackward", column = @Column(name = "maxspeed_backward")),
          @AttributeOverride(name = "osmId", column = @Column(name = "osm_id")),
          @AttributeOverride(name = "priority", column = @Column(name = "priority", precision = 17, scale = 17)),
          @AttributeOverride(name = "theGeom", column = @Column(name = "the_geom")),
          @AttributeOverride(name = "source", column = @Column(name = "source")),
          @AttributeOverride(name = "target", column = @Column(name = "target"))})
          //@AttributeOverride(name = "vitesse", column = @Column(name = "vitesse", precision = 17, scale = 17))})
  public WaysId getId() {
      return this.id;
  }
  
  public void setId(WaysId id) {
      this.id = id;
  }
  
  }
  @Embeddable
  public class WaysId implements java.io.Serializable {
  
  private Integer gid;
  private int classId;
  private Double length;
  private String name;
  private Double x1;
  private Double y1;
  private Double x2;
  private Double y2;
  private Double reverseCost;
  private String rule;
  private Double toCost;
  private Integer maxspeedForward;
  private Integer maxspeedBackward;
  private Long osmId;
  private Double priority;
  private Serializable theGeom;
  private Integer source;
  private Integer target;
  }
  
  
  
  public double convertidTolat1(Integer id) {
      Double lat = null;
      Query query = entityManager
              .createQuery("select n.id.x1 from Ways n where n.id.gid=:id");
      query.setParameter("id", id);
      lat = (Double) query.getSingleResult();
      return lat;
  }
  
  
  @GET
  @Path("lat/{id}")
  @Produces(MediaType.APPLICATION_JSON)
  public BigDecimal getlat(@PathParam(value = "id") long id) {
      BigDecimal d = iservices.getLat(id);
      return d;
  }
  </code></pre>
  
  <p>Hi every body, here is my code, i want to know what's wrong with my query?</p>