Project
IntelliJ IDEA
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Fixed
Assignee
Maxim Mossienko
Subsystem
Code Analysis. Inspection
Affected versions
No Affected versions
Fixed in build
108.65  
  • Created by   Craig Day
    5 years ago (09 Dec 2006 09:07)
  • Updated by   root
    2 years ago (17 Jan 2010 20:38)
  • Jira: IDEADEV-12565
    (history, comments)
 
IDEA-35955 JPA QL confuses code analysis / inspection
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
The following code confuses the inspection system, making IDEA think there is an error when there isn't:

package jpatest;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import java.util.Collection;

public class JPATest {
public static void main(String[] args) {

EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("EmployeeService");

EntityManager entityManager = entityManagerFactory.createEntityManager();

Query query3 = entityManager.createQuery("select new jpatest.IdAndSalary(e.id, e.salary) from Employee e");

Collection result = query3.getResultList();

System.out.println("result.iterator().next() = " + result.iterator().next());


entityManager.close();

entityManagerFactory.close();

}

}


Environment: Edgy Eft Ubuntu, Linux, JDK 1.5.0_09

Issue was resolved
Comments (0)
 
History
 
Linked Issues (?)
 
Issue has no comments