class DropTrigger extends SchemaStatement {

    private String triggerName;
    private boolean ifExists;

    public DropTrigger(ServerSession session, Schema schema) {
        super(session, schema);
    }

    @Override
    public int getType() {
        return SQLStatement.DROP_TRIGGER;
    }

    public void setTriggerName(String triggerName) {
        this.triggerName = triggerName;
    }

    public void setIfExists(boolean b) {
        ifExists = b;
    }

    @Override
    public int update() {<FILL_FUNCTION_BODY>}
}

        DbObjectLock lock = schema.tryExclusiveLock(DbObjectType.TRIGGER, session);
        if (lock == null)
            return -1;

        TriggerObject trigger = schema.findTrigger(session, triggerName);
        if (trigger == null) {
            if (!ifExists) {
                throw DbException.get(ErrorCode.TRIGGER_NOT_FOUND_1, triggerName);
            }
        } else {
            Table table = trigger.getTable();
            session.getUser().checkRight(table, Right.ALL);
            schema.remove(session, trigger, lock);
        }
        return 0;
    
<methods>public void <init>(com.lealone.db.session.ServerSession, com.lealone.db.schema.Schema) <variables>protected final non-sealed com.lealone.db.schema.Schema schema