History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-12565
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Craig Day
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

JPA QL confuses code analysis / inspection

Created: 09 Dec 06 08:07   Updated: 12 Dec 06 23:23
Component/s: Code Analysis. Inspection
Fix Version/s: Demetra 6.0.3, Selena 6656

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Edgy Eft Ubuntu, Linux, JDK 1.5.0_09

Build: 6,107
Fixed in build: 6,596
Severity: High


 Description  « Hide
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(); }

}



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.