|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.postgresql.pljava.internal.NativeStruct
org.postgresql.pljava.internal.TriggerData
public class TriggerData
The TriggerData correspons to the internal PostgreSQL TriggerData.
| Constructor Summary | |
|---|---|
TriggerData()
|
|
| Method Summary | |
|---|---|
java.lang.String[] |
getArguments()
Returns the arguments for this trigger (as declared in the CREATE TRIGGER
statement. |
java.lang.String |
getName()
Returns the name of the trigger (as declared in the CREATE TRIGGER
statement). |
java.sql.ResultSet |
getNew()
Returns the ResultSet that represents the new row. |
Tuple |
getNewTuple()
Returns a Tuple reflecting the new version of the row, if
the trigger was fired for an UPDATE, and null
if it is for an INSERT or a DELETE. |
java.sql.ResultSet |
getOld()
Returns the ResultSet that represents the old row. |
Relation |
getRelation()
Returns a descriptor for the Tuples exposed by this trigger. |
java.lang.String |
getTableName()
Returns the name of the table for which this trigger was created (as declared in the CREATE TRIGGER
|
Tuple |
getTriggerReturnTuple()
Commits the changes made on the ResultSet representing
new and returns the new tuple. |
Tuple |
getTriggerTuple()
Returns a Tuple reflecting the row for which the trigger
was fired. |
boolean |
isFiredAfter()
Returns true if the trigger was fired after the statement
or row action that it is associated with. |
boolean |
isFiredBefore()
Returns true if the trigger was fired before the
statement or row action that it is associated with. |
boolean |
isFiredByDelete()
Returns true if this trigger was fired by a DELETE. |
boolean |
isFiredByInsert()
Returns true if this trigger was fired by an INSERT. |
boolean |
isFiredByUpdate()
Returns true if this trigger was fired by an UPDATE. |
boolean |
isFiredForEachRow()
Returns true if this trigger is fired once for each row
(as opposed to once for the entire statement). |
boolean |
isFiredForStatement()
Returns true if this trigger is fired once for the entire
statement (as opposed to once for each row). |
| Methods inherited from class org.postgresql.pljava.internal.NativeStruct |
|---|
getNative, invalidate, isValid, releasePointer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TriggerData()
| Method Detail |
|---|
public java.sql.ResultSet getNew()
throws java.sql.SQLException
getNew in interface TriggerDataResultSet containing one row or
null.
java.sql.SQLException - if the contained native buffer has gone stale.
public java.sql.ResultSet getOld()
throws java.sql.SQLException
getOld in interface TriggerDataResultSet containing one row or
null.
java.sql.SQLException - if the contained native buffer has gone stale.
public Tuple getTriggerReturnTuple()
throws java.sql.SQLException
ResultSet representing
new and returns the new tuple. This method is called
automatically by the trigger handler and should not be called in any
other way.
java.sql.SQLException
public java.lang.String getTableName()
throws java.sql.SQLException
TriggerDataCREATE TRIGGER
getTableName in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public Relation getRelation()
throws java.sql.SQLException
java.sql.SQLException - if the contained native buffer has gone stale.
public Tuple getTriggerTuple()
throws java.sql.SQLException
Tuple 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
INSERT or DELETE
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 INSERT
)
or skip the operation.
java.sql.SQLException - if the contained native buffer has gone stale.
public Tuple getNewTuple()
throws java.sql.SQLException
Tuple reflecting the new version of the row, if
the trigger was fired for an UPDATE, and null
if it is for an INSERT or a DELETE. This
is what you have to return from the function if the event is an UPDATE
and you don't want to replace this row by a different one or skip the
operation.
java.sql.SQLException - if the contained native buffer has gone stale.
public java.lang.String[] getArguments()
throws java.sql.SQLException
CREATE TRIGGER
statement. If the trigger has no arguments, this method will return an
array with size 0.
getArguments in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public java.lang.String getName()
throws java.sql.SQLException
CREATE TRIGGER
statement).
getName in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public boolean isFiredAfter()
throws java.sql.SQLException
true if the trigger was fired after the statement
or row action that it is associated with.
isFiredAfter in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public boolean isFiredBefore()
throws java.sql.SQLException
true if the trigger was fired before the
statement or row action that it is associated with.
isFiredBefore in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public boolean isFiredForEachRow()
throws java.sql.SQLException
true if this trigger is fired once for each row
(as opposed to once for the entire statement).
isFiredForEachRow in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public boolean isFiredForStatement()
throws java.sql.SQLException
true if this trigger is fired once for the entire
statement (as opposed to once for each row).
isFiredForStatement in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public boolean isFiredByDelete()
throws java.sql.SQLException
true if this trigger was fired by a DELETE.
isFiredByDelete in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public boolean isFiredByInsert()
throws java.sql.SQLException
true if this trigger was fired by an INSERT.
isFiredByInsert in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
public boolean isFiredByUpdate()
throws java.sql.SQLException
true if this trigger was fired by an UPDATE.
isFiredByUpdate in interface TriggerDatajava.sql.SQLException - if the contained native buffer has gone stale.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||