No i can't use views dirctly, because in the
framwork ervery class maps to one table.
But i found that i can call stored precedures.
Maybe i can call the view in a stored procedure ?
does postgres allow this ?
here is a small sniplet of the castor doc:
The is also a special form of query that
gives a possibility to call stored procedures:
oql = db.getOQLQuery( "CALL sp_something($) AS myapp.Product" );
Here sp_something is a stored procedure returning one or
more ResultSets with the same sequence of fields as Castor-generated
SELECT for the OQL query "SELECT p FROM myapp.Product p"
(for objects without relations the sequence is: identity, then all
other fields in the same order as in mapping.xml).
Von: Joel Burton [mailto:jburton(at)scw(dot)org]
Gesendet: Mittwoch, 25. April 2001 01:03
An: Thorsten Mauch
Betreff: [NOVICE] Re: AW: case insensitive database ?
On Wed, 25 Apr 2001, Thorsten Mauch wrote:
> Thanks for the answers.
> My prob is that i don't query the database
> directly. I use the CASTOR as a persitence-Framework.
> I create QOL-queries that are translated into
> SQL-Queries by the framework.
> So i can't use ILIKE or UPPER(expr) :(
> I also can't force the use of a special index.
> Howerver, i have to maintain a second field with upper
> letters, that i query instead of the orginal field
could you create a view and query that?
CREATE TABLE pers (fname);
INSERT INTO pers VALUES ('Joel');
CREATE VIEW pers_use_me AS SELECT fname, lower(fname) as lower_fname
SELECT * FROM pers WHERE lower_fname = 'joel';
Joel Burton <jburton(at)scw(dot)org>
Director of Information Systems, Support Center of Washington
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly
pgsql-novice by date
|Next:||From: Paul Tomblin||Date: 2001-04-25 00:27:37|
|Subject: Re: Re: BETWEEN clause|
|Previous:||From: Joel Burton||Date: 2001-04-24 23:03:19|
|Subject: Re: AW: case insensitive database ?|