| Summary: |
CriteriaBuilder.array(Selection) does not throw IllegalArgumentException if an argument is a tuple- or array-valued selection item |
| Product: |
z_Archived
|
Reporter: |
Stephen DiMilla <stephen.dimilla> |
| Component: |
Eclipselink | Assignee: |
Nobody - feel free to take it <nobody> |
| Status: |
CLOSED
DUPLICATE
|
QA Contact: |
|
| Severity: |
blocker
|
|
|
| Priority: |
P3
|
CC: |
christopher.delahunt, lance.andersen, stephen.dimilla, tom.ware
|
| Version: |
unspecified | |
|
| Target Milestone: |
--- | |
|
| Hardware: |
Macintosh | |
|
| OS: |
Mac OS X - Carbon (unsup.) | |
|
| Whiteboard: |
|
Build Identifier: eclipselink-2.3.0.v20110604-r9504 Using the entity: @Entity @Table(name="CUSTOMER_TABLE") public class Customer implements java.io.Serializable { // Instance variables private String id; private String name; public Customer() { } public Customer (String id, String name) { this.id = id; this.name = name; } @Id @Column(name="ID") public String getId() { return id; } public void setId(String v) { this.id = v; } @Column(name="NAME") public String getName() { return name; } public void setName(String v) { this.name = v; } } ---------------------- Using the client code: CriteriaBuilder qbuilder = em.getCriteriaBuilder(); et.begin(); CriteriaQuery<Tuple> cquery = qbuilder.createTupleQuery(); Root<Customer> cust = cquery.from(Customer.class); Selection[] s = {customer.get("id"), customer.get("name")}; System.out.println("Testing tuple"); try { qbuilder.array(qbuilder.tuple(s)); System.out.println("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { System.out.println("Received expected IllegalArgumentException"); } catch (Exception e) { System.out.println("Received unexpected exception", e); } System.out.println("Testing array"); try { qbuilder.array(qbuilder.array(s)); System.out.println("Did not throw IllegalArgumentException"); } catch (IllegalArgumentException iae) { System.out.println("Received expected IllegalArgumentException"); } catch (Exception e) { System.out.println("Received unexpected exception", e); } et.commit(); --------- output: Testing tuple Did not throw IllegalArgumentException Testing array Did not throw IllegalArgumentException Reproducible: Always