We're updating the issue view to help you get more done. 

Implement @ConstructorResult

Description

1 2 3 4 public class ItemSummary { public ItemSummary(Long itemId, String name, Date auctionEnd) { } }
1 2 3 4 5 6 7 8 9 10 11 12 13 @SqlResultSetMapping( name = "ItemSummaryResult", classes = { @ConstructorResult( targetClass = ItemSummary.class, columns = { @ColumnResult(name = "ITEM_ID"), @ColumnResult(name = "ITEM_NAME"), @ColumnResult(name = "ITEM_AUCTIONEND") } ) } )
1 2 3 4 5 6 7 8 Query q = em.createNativeQuery( "select " + "i.ID as ITEM_ID, i.NAME as ITEM_NAME, i.AUCTIONEND as ITEM_AUCTIONEND " + "from ITEM i ", "ItemSummaryResult" ); List<ItemSummary> result = q.getResultList(); assertTrue(result.get(0) instanceof ItemSummary); // Fails, Object[]

Environment

None

Status

Assignee

Unassigned

Reporter

Christian Bauer

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

4.3.0.Beta2

Priority

Major