objective-c-sql-query-builder
|
00001 /* 00002 * Copyright 2011-2015 Ziminji 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at: 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #import "ZIMSqlStatement.h" 00018 #import "ZIMSqlDataDefinitionCommand.h" 00019 00027 @interface ZIMSqlCreateTriggerStatement : NSObject <ZIMSqlStatement, ZIMSqlDataDefinitionCommand, NSXMLParserDelegate> { 00028 00029 @protected 00030 NSString *_trigger; 00031 BOOL _temporary; 00032 NSString *_advice; 00033 NSString *_event; 00034 NSMutableArray *_when; 00035 NSMutableArray *_sql; 00036 NSMutableArray *_stack; 00037 NSString *_cdata; 00038 NSUInteger _counter; 00039 NSError *_error; 00040 00041 } 00052 - (instancetype) initWithXmlSchema: (NSData *)xml error: (NSError **)error; 00059 - (instancetype) init; 00066 - (void) trigger: (NSString *)trigger; 00075 - (void) trigger: (NSString *)trigger temporary: (BOOL)temporary; 00081 - (void) before; 00087 - (void) after; 00093 - (void) insteadOf; 00100 - (void) onDelete: (NSString *)table; 00107 - (void) onInsert: (NSString *)table; 00114 - (void) onUpdate: (NSString *)table; 00123 - (void) onUpdate: (NSString *)table column: (NSString *)column; 00132 - (void) onUpdate: (NSString *)table columns: (NSSet *)columns; 00139 - (void) whenBlock: (NSString *)brace; 00147 - (void) whenBlock: (NSString *)brace connector: (NSString *)connector; 00156 - (void) when: (id)column1 operator: (NSString *)operator column: (id)column2; 00166 - (void) when: (id)column1 operator: (NSString *)operator column: (id)column2 connector: (NSString *)connector; 00175 - (void) when: (id)column operator: (NSString *)operator value: (id)value; // wrap primitives with NSNumber 00185 - (void) when: (id)column operator: (NSString *)operator value: (id)value connector: (NSString *)connector; // wrap primitives with NSNumber 00192 - (void) sql: (NSString *)statement; 00199 - (NSString *) statement; 00200 00201 @end