| Summary: |
Query.getFlushMode() throws NullPointerException instead of the flush mode in effect for the entity manager when a flush mode has not been set for the query object . |
| Product: |
z_Archived
|
Reporter: |
Stephen DiMilla <stephen.dimilla> |
| Component: |
Eclipselink | Assignee: |
Nobody - feel free to take it <nobody> |
| Status: |
CLOSED
FIXED
|
QA Contact: |
|
| Severity: |
blocker
|
|
|
| Priority: |
P3
|
CC: |
lance.andersen, stephen.dimilla, tom.ware
|
| Version: |
unspecified | |
|
| Target Milestone: |
--- | |
|
| Hardware: |
Macintosh | |
|
| OS: |
Mac OS X - Carbon (unsup.) | |
|
| Whiteboard: |
|
| Attachments: |
|
Build Identifier: eclipselink-2.3.0.v20110604-r9504 Using the entity: @Entity @Table(name = "EMPLOYEE") public class Employee implements java.io.Serializable, Comparable<Employee> { private int id; private String firstName; public Employee() { } public Employee(int id, String firstName) { this.id = id; this.firstName = firstName; } // =========================================================== // getters and setters for the state fields @Id @Column(name = "ID") public int getId() { return id; } public void setId(int id) { this.id = id; } @Column(name = "FIRSTNAME") public String getFirstName() { return firstName; } ---------------- Client Code: Query q = em.createQuery("SELECT c FROM Customer c WHERE c.name = 'Michael Bouschen'"); System.out.println("EntityManager.getFlushMode() returned:"+em.getFlushMode()); System.out.println("Calling Query.getFlushMode()"); FlushModeType fmt = q.getFlushMode(); --------------- Output: EM.getFlushMode() returns:AUTO Calling getFlushMode() Caught unexpected exception: java.lang.NullPointerException java.lang.NullPointerException at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getFlushMode(EJBQueryImpl.java:1324) Reproducible: Always