Hi,
is there any special reason why you want to go for a native query? I
would expect the native query being more complex compared to the
corresponding JPQL query.
I'm not sure whether I got your second question right. Is the concern
that the JPA implementation first creates entity instances from the SQL
query result and then evaluate the constructor using the entity
instances? I would be surprised if any entity instances are created,
unless the entire entity instance is passed as an argument to the
constructor expression and thus is part of the query result (e.g. SELECT
NEW mypackage.Detail (e, ...) FROM Employee e WHERE ...).
Regards Michael
> Are you using TopLink Essentials? Enable SQL logging (i.e. FINE
> logging level) and you'll see the actual SQL sent to the database.
>
> Regards,
> -marina
>
> Dru Devore wrote:
>> I am working on recreating the problem but I think I might have solved
>> it. I trying to use sql in the creation. I have since tried to do it
>> using the object references JPQL which is proving to be difficult
>> because I am using a fairly hard query. It links 4 tables conditionally
>> with the resulting object being a conglomerate of the 4.
>> two questions.
>> 1. is there a way to make a query for this using a native query?
>> 2. if I use JPQL will it create the standard sql and execute it or will
>> it do the query using the objects and simply create the resulting object
>> from the objects. I am concerned about memory. This query will return
>> 25,000 objects and with the four tables linked in code it will bring my
>> server to its knees....
>> ---
>> Dru Devore
>> The best Christian community now online.
>> The Faith Haven
>> www.thefaithhaven.com
>> Come join us, bookmark us, and enjoy!
>>
>>
>>> -------- Original Message --------
>>> Subject: Re: Constructor Expressions
>>> From: Wouter van Reeven <wouter_at_van.reeven.nl>
>>> Date: Thu, November 06, 2008 2:04 pm
>>> To: persistence_at_glassfish.dev.java.net
>>>
>>>
>>> On Thu, Nov 06, 2008 at 12:02:36PM -0700, Dru Devore wrote:
>>>
>>>> I have been trying to get a constructor expression working and have
>>>> had
>>>> nothing but errors.
>>>> I have followed an example from a book and have tried this blog
>>>>
>>>> http://weblogs.java.net/blog/mb124283/archive/2007/04/java_persistenc.html
>>>>
>>>>
>>>> But I have had no luck. Any suggestions/examples out there that work?
>>>
>>> Can you post the expression that fails and possibly the error you get?
>>>
>>>
>>> Thanks, Wouter van Reeven
>>>
>>> --
>>>
>>> People: "If she weighs the same as a Duck, she's made of wood!"
>>> Sir Bedevere: "And therefore...?"
>>
>>
>
--
*Michael Bouschen*
*Prokurist*
akquinet tech_at_spree GmbH
Tempelhofer Ufer 23-24, D-10963 Berlin
Bülowstr. 66, D-10783 Berlin
Fon: +49 30 235 520-33
Fax: +49 30 217 520-12
Email: michael.bouschen_at_akquinet.de
Url: www.akquinet.de <http://www.akquinet.de>
akquinet tech_at_spree GmbH, Berlin
Geschäftsführung: Prof. Dr. Christian Roth, Hendrik Saly, Martin Weber
Amtsgericht Berlin-Charlottenburg HRB 86780
USt.-Id. Nr.: DE 225 964 680