Re: Return type of Repository native query

2015-08-07 Thread Daniel Cunha
Very nice!!! :D

On Fri, Aug 7, 2015 at 5:45 PM, Thomas Hug thomas@gmail.com wrote:

 Hi Daniel
 Thnx yes I can take this one. It's about time I show up in Git history
 again :-)

 On Fri, Aug 7, 2015 at 6:19 PM, Daniel Cunha daniels...@gmail.com wrote:

  Thomas,
 
  if you don't have time to see it,  I can doing on next week.
  Let me know if you have time to fix it
 
  On Fri, Aug 7, 2015 at 1:07 PM, akm ameh...@ford.com wrote:
 
   Thanks Thomas for the response.
  
   It works with the workaround.
  
   Any idea if the bug will be fixed?
   Thanks
  
  
  
  
   --
   View this message in context:
  
 
 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-tp4661333p4661337.html
   Sent from the Apache DeltaSpike Incubator Discussions mailing list
  archive
   at Nabble.com.
  
 
 
 
  --
  Best regard,
  Daniel Cunha (soro)
 




-- 
Best regard,
Daniel Cunha (soro)


[jira] [Updated] (DELTASPIKE-976) document handling of @PersistenceUnitName EntityManagerFactory

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-976:

Assignee: Daniel Cunha (soro)  (was: Thomas Andraschko)

 document handling of @PersistenceUnitName EntityManagerFactory
 --

 Key: DELTASPIKE-976
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-976
 Project: DeltaSpike
  Issue Type: Task
  Components: Documentation
Affects Versions: 1.5.0
Reporter: Gerhard Petracek
Assignee: Daniel Cunha (soro)





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


Re: Return type of Repository native query

2015-08-07 Thread akm
Thanks Thomas for the response.

It works with the workaround.

Any idea if the bug will be fixed?
Thanks




--
View this message in context: 
http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-tp4661333p4661337.html
Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at 
Nabble.com.


Re: Return type of Repository native query

2015-08-07 Thread Daniel Cunha
Thomas,

if you don't have time to see it,  I can doing on next week.
Let me know if you have time to fix it

On Fri, Aug 7, 2015 at 1:07 PM, akm ameh...@ford.com wrote:

 Thanks Thomas for the response.

 It works with the workaround.

 Any idea if the bug will be fixed?
 Thanks




 --
 View this message in context:
 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-tp4661333p4661337.html
 Sent from the Apache DeltaSpike Incubator Discussions mailing list archive
 at Nabble.com.




-- 
Best regard,
Daniel Cunha (soro)


[jira] [Created] (DELTASPIKE-978) Native Query does not return a correct result type of entity but returns an object which causes ClassCastException

2015-08-07 Thread Amita Mehta (JIRA)
Amita Mehta created DELTASPIKE-978:
--

 Summary: Native Query does not return a correct result type of 
entity but returns an object which causes ClassCastException
 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
Reporter: Amita Mehta


http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-td4661333.html#a4661340



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


Re: Return type of Repository native query

2015-08-07 Thread akm
I don't seem to have access to open an issue



--
View this message in context: 
http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-tp4661333p4661340.html
Sent from the Apache DeltaSpike Incubator Discussions mailing list archive at 
Nabble.com.


Re: Return type of Repository native query

2015-08-07 Thread Gerhard Petracek
hi akm,

everybody can access it after creating an account (see [1]).

regards,
gerhard

[1] http://s.apache.org/Gnz



2015-08-07 18:40 GMT+02:00 akm ameh...@ford.com:

 I don't seem to have access to open an issue



 --
 View this message in context:
 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-tp4661333p4661340.html
 Sent from the Apache DeltaSpike Incubator Discussions mailing list archive
 at Nabble.com.



[jira] [Updated] (DELTASPIKE-978) Native Query does not return a correct result type of entity but returns an object which causes ClassCastException

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-978:

Assignee: Daniel Cunha (soro)

 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 --

 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
  Components: Data-Module
Affects Versions: 1.5.0
Reporter: Amita Mehta
Assignee: Daniel Cunha (soro)
 Fix For: 1.5.1


 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-td4661333.html#a4661340



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


[jira] [Updated] (DELTASPIKE-978) Native Query does not return a correct result type of entity but returns an object which causes ClassCastException

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-978:

Affects Version/s: 1.5.0

 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 --

 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
  Components: Data-Module
Affects Versions: 1.5.0
Reporter: Amita Mehta
Assignee: Daniel Cunha (soro)
 Fix For: 1.5.1


 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-td4661333.html#a4661340



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


[jira] [Updated] (DELTASPIKE-978) Native Query does not return a correct result type of entity but returns an object which causes ClassCastException

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-978:

Fix Version/s: 1.5.1

 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 --

 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
  Components: Data-Module
Affects Versions: 1.5.0
Reporter: Amita Mehta
Assignee: Daniel Cunha (soro)
 Fix For: 1.5.1


 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-td4661333.html#a4661340



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


[jira] [Updated] (DELTASPIKE-978) Native Query does not return a correct result type of entity but returns an object which causes ClassCastException

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-978:

Component/s: Data-Module

 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 --

 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
  Components: Data-Module
Affects Versions: 1.5.0
Reporter: Amita Mehta
Assignee: Daniel Cunha (soro)
 Fix For: 1.5.1


 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-td4661333.html#a4661340



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


[jira] [Updated] (DELTASPIKE-978) Native Query does not return a correct result type of entity but returns an object which causes ClassCastException

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-978:

Description: 
details:
http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3C1438890740891-4661333.post%40n4.nabble.com%3E

workaround:
http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3CCAJEn2S5FzMaSOavkOu36fmF8WOGSun%2BRTxDRziSFPvV1eWOGmQ%40mail.gmail.com%3E

  
was:http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-td4661333.html#a4661340


 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 --

 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
  Components: Data-Module
Affects Versions: 1.5.0
Reporter: Amita Mehta
Assignee: Daniel Cunha (soro)
Priority: Minor
 Fix For: 1.5.1


 details:
 http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3C1438890740891-4661333.post%40n4.nabble.com%3E
 workaround:
 http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3CCAJEn2S5FzMaSOavkOu36fmF8WOGSun%2BRTxDRziSFPvV1eWOGmQ%40mail.gmail.com%3E



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


[jira] [Updated] (DELTASPIKE-978) Native Query does not return a correct result type of entity but returns an object which causes ClassCastException

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-978:

Priority: Minor  (was: Major)

 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 --

 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
  Components: Data-Module
Affects Versions: 1.5.0
Reporter: Amita Mehta
Assignee: Daniel Cunha (soro)
Priority: Minor
 Fix For: 1.5.1


 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-td4661333.html#a4661340



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


[jira] [Updated] (DELTASPIKE-978) ClassCastException with Native Queries

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-978:

Summary: ClassCastException with Native Queries  (was: Native Query does 
not return a correct result type of entity but returns an object which causes 
ClassCastException)

 ClassCastException with Native Queries
 --

 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
  Components: Data-Module
Affects Versions: 1.5.0
Reporter: Amita Mehta
Assignee: Daniel Cunha (soro)
Priority: Minor
 Fix For: 1.5.1


 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 details:
 http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3C1438890740891-4661333.post%40n4.nabble.com%3E
 workaround:
 http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3CCAJEn2S5FzMaSOavkOu36fmF8WOGSun%2BRTxDRziSFPvV1eWOGmQ%40mail.gmail.com%3E



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


[jira] [Updated] (DELTASPIKE-978) Native Query does not return a correct result type of entity but returns an object which causes ClassCastException

2015-08-07 Thread Gerhard Petracek (JIRA)

 [ 
https://issues.apache.org/jira/browse/DELTASPIKE-978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gerhard Petracek updated DELTASPIKE-978:

Description: 
Native Query does not return a correct result type of entity but returns an 
object which causes ClassCastException

details:
http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3C1438890740891-4661333.post%40n4.nabble.com%3E

workaround:
http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3CCAJEn2S5FzMaSOavkOu36fmF8WOGSun%2BRTxDRziSFPvV1eWOGmQ%40mail.gmail.com%3E

  was:
details:
http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3C1438890740891-4661333.post%40n4.nabble.com%3E

workaround:
http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3CCAJEn2S5FzMaSOavkOu36fmF8WOGSun%2BRTxDRziSFPvV1eWOGmQ%40mail.gmail.com%3E


 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 --

 Key: DELTASPIKE-978
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-978
 Project: DeltaSpike
  Issue Type: Bug
  Components: Data-Module
Affects Versions: 1.5.0
Reporter: Amita Mehta
Assignee: Daniel Cunha (soro)
Priority: Minor
 Fix For: 1.5.1


 Native Query does not return a correct result type of entity but returns an 
 object which causes ClassCastException
 details:
 http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3C1438890740891-4661333.post%40n4.nabble.com%3E
 workaround:
 http://mail-archives.apache.org/mod_mbox/deltaspike-dev/201508.mbox/%3CCAJEn2S5FzMaSOavkOu36fmF8WOGSun%2BRTxDRziSFPvV1eWOGmQ%40mail.gmail.com%3E



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


Re: Return type of Repository native query

2015-08-07 Thread Thomas Hug
Hi Daniel
Thnx yes I can take this one. It's about time I show up in Git history
again :-)

On Fri, Aug 7, 2015 at 6:19 PM, Daniel Cunha daniels...@gmail.com wrote:

 Thomas,

 if you don't have time to see it,  I can doing on next week.
 Let me know if you have time to fix it

 On Fri, Aug 7, 2015 at 1:07 PM, akm ameh...@ford.com wrote:

  Thanks Thomas for the response.
 
  It works with the workaround.
 
  Any idea if the bug will be fixed?
  Thanks
 
 
 
 
  --
  View this message in context:
 
 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-tp4661333p4661337.html
  Sent from the Apache DeltaSpike Incubator Discussions mailing list
 archive
  at Nabble.com.
 



 --
 Best regard,
 Daniel Cunha (soro)



Re: Return type of Repository native query

2015-08-07 Thread Thomas Hug
Hi akm

Given it is stated like that in the documentation, I guess we have a bug
here. The code doesn't call the EM with a result class so there's no
mapping happening.
As a workaround, you might specify a @NamedNativeQuery where you can add a
result class and then reference it in the @Query annotation.

Hope that helps,
Thomas


On Thu, Aug 6, 2015 at 9:52 PM, akm ameh...@ford.com wrote:

 I have a simple native query in my repository

 @Query(value = select * from COUNTRY c where c. COUNTRY_C = ?1, isNative
 =
 true)
 public abstract ListCountry findCountryByCode(String countryCode);

 I execute it by the following line –
   ListCountry countryList =
 this.countryRepository.findCountryByCode(this.countryCode);

 I see the right query being executed –
 [EL Finest]: query: Execute query DataReadQuery(sql=select * from COUNTRY
 c
 where c. COUNTRY_C = ?1)

 And my list contains my expected results, but the problem is when I try to
 do any operation on the entity I get an error
 Caused by: java.lang.ClassCastException: [Ljava.lang.Object; incompatible
 with com.domain.Country

 In this test I am just trying to get the names from the country
   for (Country country : countryList) {
 country.getName();
 }

 Casting the result does not work either.
 Shouldn’t the returned objects be of the Entity type?

 What am I doing wrong? How do I get the Entity type result?
 Thanks.




 --
 View this message in context:
 http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/Return-type-of-Repository-native-query-tp4661333.html
 Sent from the Apache DeltaSpike Incubator Discussions mailing list archive
 at Nabble.com.