Hello (again),
I have the following function defined on my PostgreSQL database;

CREATE OR REPLACE FUNCTION search_employer(firstlast character varying, lim 
bigint, offs bigint)
  RETURNS SETOF employer AS
$BODY$
SELECT * FROM employer
WHERE (LOWER(name || ' ' || lastname) LIKE LOWER('%' || firstlast || '%'))
OR (LOWER(lastname || ' ' || name) LIKE LOWER('%' || firstlast || '%'))
LIMIT lim OFFSET offs;
$BODY$
  LANGUAGE sql VOLATILE
  COST 100
  ROWS 1000;

Basically, it looks for some employers based on first and last name. My 
Java code is the following:

Result<Record> r = f.select(searchEmployer(firstlast, pageSize, 
offset)).fetch();

The problem is I expect to get, in return, a Result<EmployerRecord>, 
because that's what I get when I do a regular select() with jOOQ. Is there 
something I am doing wrong? Or is this the expected behavior? If so, how 
can I transform a RecordImpl (which I've noticed is deprecated too) into a 
EmployerRecord? Casting the Result doesn't throw anything, but if I cast 
the inner object I get a

java.lang.ClassCastException: org.jooq.impl.RecordImpl cannot be cast to 
my.package.jooq.gen.tables.records.EmployerRecord. Thanks!

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to