[ https://issues.apache.org/jira/browse/DELTASPIKE-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John D. Ament updated DELTASPIKE-1160: -------------------------------------- Fix Version/s: 1.6.2 > Not possible to select non Entity or other Entity object via Native query > ------------------------------------------------------------------------- > > Key: DELTASPIKE-1160 > URL: https://issues.apache.org/jira/browse/DELTASPIKE-1160 > Project: DeltaSpike > Issue Type: Bug > Components: Data-Module > Affects Versions: 0.6, 0.7, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.2.0, > 1.2.1, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6.0, > 1.6.1 > Reporter: Daniel Heinrich > Priority: Minor > Fix For: 1.6.2 > > Original Estimate: 1h > Remaining Estimate: 1h > > [DELTASPIKE-1089|https://issues.apache.org/jira/browse/DELTASPIKE-1089] > enabled to return none mapped types from a native query from a Repository. > This was done with an extra flag on the Query annotation. > The default for native Queries in Repositories is to return the entity type > fo the repository. > It should be possible to return other entity types from queries of the same > repository. > e.g. > {code:java} > interface FooRepository extends EntityRepository<Foo, Long> > { > @Query(isNative = true,value = "SELECT Bar.* FROM Foo JOIN Bar ON > Foo.bar_fk = Bar.pk WHERE Foo.pk = ?1") > Bar getBarFromFooByPk(long fooPk); > @Query(isNative = true,value = "SELECT Bar.* FROM Foo JOIN Bar ON > Foo.bar_fk = Bar.pk WHERE Foo.age = ?1") > List<Bar> getBarFromFooWithAge(int age); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)