Query results

View: New views
2 Messages — Rating Filter:   Alert me  

Query results

by JAMES.SUTHERLAND :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I am working a few bugs related to what is returned from queries and native queries, and working on a hint to define this as well.

(bugs 229627 243205).

 

Currently EclipseLink returns the following for getSingleResult() (for getResultList() it returns a List of the value):

JPQL

- Select e from Employee e -> Employee

- Select e.id, e.name from Employee e -> Object[Integer, String]

- Select e.id from Employee e -> Integer

SQL

- SELECT EMP_ID, F_NAME FROM EMPLOYEE -> Vector[BigDecimal, String]

- SELECT EMP_ID FROM EMPLOYEE -> Vector[BigDecimal]

 

From the spec and users it seems we should return,

SQL

- SELECT EMP_ID, F_NAME FROM EMPLOYEE -> Object[BigDecimal, String]

- SELECT EMP_ID FROM EMPLOYEE -> BigDecimal

 

Does this seem correct?

 

However, unlike JPQL, with native queries we don't know ahead of time, what we will get back, so this is a little more tricky.

 


_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

Re: Query results

by Gordon Yorke-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
This would be correct behaviour as per the specification. When building results you could check the size of the row before deciding to build the Object[] in the case there is no SQLResultsetMapping or result Class defined on the query.
--Gordon

James Sutherland wrote:

I am working a few bugs related to what is returned from queries and native queries, and working on a hint to define this as well.

(bugs 229627 243205).

 

Currently EclipseLink returns the following for getSingleResult() (for getResultList() it returns a List of the value):

JPQL

- Select e from Employee e -> Employee

- Select e.id, e.name from Employee e -> Object[Integer, String]

- Select e.id from Employee e -> Integer

SQL

- SELECT EMP_ID, F_NAME FROM EMPLOYEE -> Vector[BigDecimal, String]

- SELECT EMP_ID FROM EMPLOYEE -> Vector[BigDecimal]

 

From the spec and users it seems we should return,

SQL

- SELECT EMP_ID, F_NAME FROM EMPLOYEE -> Object[BigDecimal, String]

- SELECT EMP_ID FROM EMPLOYEE -> BigDecimal

 

Does this seem correct?

 

However, unlike JPQL, with native queries we don't know ahead of time, what we will get back, so this is a little more tricky.

 


_______________________________________________ eclipselink-dev mailing list eclipselink-dev@... https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev
LightInTheBox - Buy quality products at wholesale price!