forked from tada/pljava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriggerData.java
More file actions
124 lines (111 loc) · 3.94 KB
/
Copy pathTriggerData.java
File metadata and controls
124 lines (111 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* This file contains software that has been made available under
* The Mozilla Public License 1.1. Use and distribution hereof are
* subject to the restrictions set forth therein.
*
* Copyright (c) 2003 TADA AB - Taby Sweden
* All Rights Reserved
*/
package org.postgresql.pljava;
import java.sql.SQLException;
/**
* The <code>TriggerData</code> correspons to the internal PostgreSQL
* <code>TriggerData</code>.
*
* @author Thomas Hallgren
*/
public class TriggerData extends NativeStruct
{
/**
* Returns a descriptor for the Tuples exposed by this
* trigger.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native Relation getRelation();
/**
* Returns a <code>Tuple</code> reflecting the row for which
* the trigger was fired. This is the row being inserted,
* updated, or deleted. If this trigger was fired for an <code>
* INSERT</code> or <code>DELETE</code> then this is what you
* should return to from the method if you don't want to replace
* the row with a different one (in the case of <code>INSERT
* </code>) or skip the operation.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native Tuple getTriggerTuple();
/**
* Returns a <code>Tuple</code> reflecting the new version of
* the row, if the trigger was fired for an <code>UPDATE</code>,
* and <code>null</code> if it is for an <code>INSERT</code> or
* a <code>DELETE</code>. This is what you have to return from
* the function if the event is an <code>UPDATE</code> and you
* don't want to replace this row by a different one or skip the
* operation.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native Tuple getNewTuple();
/**
* Returns the arguments for this trigger (as declared
* in the <code>CREATE TRIGGER</code> statement. If
* the trigger has no arguments, this method will return
* an array with size 0.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native String[] getArguments()
throws SQLException;
/**
* Returns the name of the trigger (as declared
* in the <code>CREATE TRIGGER</code> statement).
*/
public native String getName()
throws SQLException;
/**
* Returns <code>true</code> if the trigger was fired after the
* statement or row action that it is associated with.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native boolean isFiredAfter()
throws SQLException;
/**
* Returns <code>true</code> if the trigger was fired before the
* statement or row action that it is associated with.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native boolean isFiredBefore()
throws SQLException;
/**
* Returns <code>true</code> if this trigger is fired once
* for each row (as opposed to once for the entire statement).
* @throws SQLException if the contained native buffer has gone stale.
*/
public native boolean isFiredForEachRow()
throws SQLException;
/**
* Returns <code>true</code> if this trigger is fired once
* for the entire statement (as opposed to once for each row).
* @throws SQLException if the contained native buffer has gone stale.
*/
public native boolean isFiredForStatement()
throws SQLException;
/**
* Returns <code>true</code> if this trigger was fired
* by a <code>DELETE</code>.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native boolean isFiredByDelete()
throws SQLException;
/**
* Returns <code>true</code> if this trigger was fired
* by an <code>INSERT</code>.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native boolean isFiredByInsert()
throws SQLException;
/**
* Returns <code>true</code> if this trigger was fired
* by an <code>UPDATE</code>.
* @throws SQLException if the contained native buffer has gone stale.
*/
public native boolean isFiredByUpdate()
throws SQLException;
}