From: | filip(dot)hrbek at plz(dot)comstar(dot)cz (Filip Hrbek) |
---|---|
To: | |
Subject: | [Pljava-dev] Cancelling trigger operation |
Date: | 2006-10-23 08:02:42 |
Message-ID: | 003601c6f679$9e1af3c0$1e03a8c0@fhrbek |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pljava-dev |
Hi Thomas,
when a trigger function is written in pl/pgsql, you can decide to cancel the
operation in a trigger(defined as "before event") by returning null instead
of "new", e.g.
create function cancelling_trigger() returns trigger as
'
begin
if new.num < 0 then
-- cancel operation for negative numbers
return null;
else
-- continue
-- do something...
return new;
end if;
end
' language 'plpgsql';
Is there any way to do the same in pljava? I can't see it now, since the
trigger functions are mapped to static java methods with no return values
(void):
public static void cancellingTrigger(TriggerData td) throws SQLException {
if (td.getNew().getInt("num") < 0) {
//Cancel operation - HOW???
}
else {
//Continue
//do something...
}
}
Filip
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Hallgren | 2006-10-23 08:46:27 | [Pljava-dev] Cancelling trigger operation |
Previous Message | Thomas Hallgren | 2006-10-18 19:13:20 | [Pljava-dev] Followup, regarding ResultSet _new in triggers and Tada Wiki |