users@glassfish.java.net

Computed fields in named query

From: Markus Karg <karg_at_quipsy.de>
Date: Tue, 10 Jun 2008 08:43:36 +0200

I want to use a "computed field" in a named query, but unfortunately it seems that is not possible (in fact what I *really* need to get is the concatination of two data fields, but I do not want to use new X(o.a, o.b) in the QL if possible since I want to return a single String from the SELECT query).

 

What I want to do is to have a getX() method in my entity that computes its return value at runtime, and do "SELECT o.x FROM Entity o" what internally calls the getX method after pulling the object from the database.

 

Is there a way to do that?

 

Thanks

Markus

 

QUIPSY QUALITY GmbH & Co. KG

Ein Unternehmen der MES-Gruppe

Stuttgarter Strasse 23

D-75179 Pforzheim

Tel: 07231-9189-52

Fax: 07231-9189-59

www.quipsy.de

karg_at_quipsy.de

Registergericht Mannheim HRA 701214

Geschäftsführer: Nils Schroeder

 

Diese E-Mail enthält persönliche, vertrauliche und vor Weitergabe geschützte Informationen und ist ausschließlich für den vorgesehenen o.g. Empfänger (Adressaten) bestimmt. Falls Sie diese E-Mail versehentlich erhalten haben und nicht der vorgesehene Empfänger sind, bitten wir Sie, die E-Mail und deren Anhänge nicht aufzubewahren, nicht zu vervielfältigen, nicht zu nutzen und nicht weiterzugeben. Bitte informieren Sie uns als Absender über diesen Zustellungsfehler und löschen Sie die E-Mail.