[jira] [Commented] (DELTASPIKE-1160) Not possible to select non Entity or other Entity object via Native query

2016-06-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15318056#comment-15318056
 ] 

ASF GitHub Bot commented on DELTASPIKE-1160:


Github user Danny02 closed the pull request at:

https://github.com/apache/deltaspike/pull/52


> 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: New Feature
>  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
>Assignee: Daniel Heinrich
>Priority: Minor
> Fix For: 1.7.0
>
>   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
> {
>   @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 getBarFromFooWithAge(int age);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DELTASPIKE-1160) Not possible to select non Entity or other Entity object via Native query

2016-06-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15314322#comment-15314322
 ] 

ASF GitHub Bot commented on DELTASPIKE-1160:


Github user johnament commented on a diff in the pull request:

https://github.com/apache/deltaspike/pull/52#discussion_r65732553
  
--- Diff: 
deltaspike/modules/data/api/src/main/java/org/apache/deltaspike/data/api/Query.java
 ---
@@ -83,7 +82,11 @@
 /**
  * For native queries only, whether or not this query returns the 
defined entity class or not.
  * Due to type erasure from generics, we don't have runtime 
information about the return collection
+ *
+ * @deprecated Native queries can deduce the correct return type and 
mapping. This property has no effect and can be
+ * removed safely.
  */
+@Deprecated
 boolean returnsEntity() default true;
--- End diff --

Please delete this parameter, just like in your original PR.  This was only 
added this week to address this problem originally.


> 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: New Feature
>  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
>Assignee: Daniel Heinrich
>Priority: Minor
> Fix For: 1.7.0
>
>   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
> {
>   @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 getBarFromFooWithAge(int age);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DELTASPIKE-1160) Not possible to select non Entity or other Entity object via Native query

2016-06-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15312305#comment-15312305
 ] 

ASF GitHub Bot commented on DELTASPIKE-1160:


Github user Danny02 commented on a diff in the pull request:

https://github.com/apache/deltaspike/pull/52#discussion_r65539505
  
--- Diff: 
deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
 ---
@@ -88,4 +83,12 @@ else if (query.isNative())
 return context.applyRestrictions(result);
 }
 
+private Class getMethodResultEntityClass(Method m){
--- End diff --

done


> 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
>   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
> {
>   @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 getBarFromFooWithAge(int age);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DELTASPIKE-1160) Not possible to select non Entity or other Entity object via Native query

2016-06-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15312294#comment-15312294
 ] 

ASF GitHub Bot commented on DELTASPIKE-1160:


Github user johnament commented on a diff in the pull request:

https://github.com/apache/deltaspike/pull/52#discussion_r65538667
  
--- Diff: 
deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
 ---
@@ -88,4 +83,12 @@ else if (query.isNative())
 return context.applyRestrictions(result);
 }
 
+private Class getMethodResultEntityClass(Method m){
--- End diff --

Either is fine, your commit message doesn't include a JIRA ticket.


> 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
>   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
> {
>   @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 getBarFromFooWithAge(int age);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DELTASPIKE-1160) Not possible to select non Entity or other Entity object via Native query

2016-06-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15312178#comment-15312178
 ] 

ASF GitHub Bot commented on DELTASPIKE-1160:


Github user Danny02 commented on a diff in the pull request:

https://github.com/apache/deltaspike/pull/52#discussion_r65525461
  
--- Diff: 
deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
 ---
@@ -88,4 +83,12 @@ else if (query.isNative())
 return context.applyRestrictions(result);
 }
 
+private Class getMethodResultEntityClass(Method m){
--- End diff --


[QueryBuilder](https://github.com/apache/deltaspike/blob/master/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/QueryBuilder.java#L64)
 also only checks for java.util.List


> 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
>   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
> {
>   @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 getBarFromFooWithAge(int age);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DELTASPIKE-1160) Not possible to select non Entity or other Entity object via Native query

2016-06-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15312172#comment-15312172
 ] 

ASF GitHub Bot commented on DELTASPIKE-1160:


Github user Danny02 commented on a diff in the pull request:

https://github.com/apache/deltaspike/pull/52#discussion_r65524755
  
--- Diff: 
deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
 ---
@@ -88,4 +83,12 @@ else if (query.isNative())
 return context.applyRestrictions(result);
 }
 
+private Class getMethodResultEntityClass(Method m){
--- End diff --

sry, but which original ticket do you mean? 
[DELTASPIKE-1089](https://issues.apache.org/jira/browse/DELTASPIKE-1089)?


> 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
>   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
> {
>   @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 getBarFromFooWithAge(int age);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DELTASPIKE-1160) Not possible to select non Entity or other Entity object via Native query

2016-06-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-1160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15312162#comment-15312162
 ] 

ASF GitHub Bot commented on DELTASPIKE-1160:


Github user johnament commented on a diff in the pull request:

https://github.com/apache/deltaspike/pull/52#discussion_r65524383
  
--- Diff: 
deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/AnnotatedQueryBuilder.java
 ---
@@ -88,4 +83,12 @@ else if (query.isNative())
 return context.applyRestrictions(result);
 }
 
+private Class getMethodResultEntityClass(Method m){
--- End diff --

HI Danny, good catch, thats what happens when I'm looking at this too late 
in the evening.

Can you please commit this all under the original ticket?  and can you 
expand this method to check for collection types?


> 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
>   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
> {
>   @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 getBarFromFooWithAge(int age);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)