private static boolean bytecode enhancement enabled false private access plan factory bytecodeenhancementenabled accessplanfactory creates an access plan for working with a bean param clazz param property names return an access plan public static access plan get access plan class clazz string property names access plan plan boolean complex false if clazz null property names null complex true else for int i 0 i property names length i if property names i index of 1 property names i index of 1 complex true break if complex plan new complex access plan clazz property names else if map class is assignable from clazz plan new map access plan clazz property names else possibly causes bug 945746 but the bug is unconfirmed can t be reproduced if bytecode enhancement enabled try plan new enhanced property access plan clazz property names catch throwable t try plan new property access plan clazz property names catch throwable t2 plan new complex access plan clazz property names else try plan new property access plan clazz property names catch throwable t plan new complex access plan clazz property names return plan propertynames accessplan getaccessplan propertynames accessplan propertynames propertynames propertynames indexof propertynames indexof complexaccessplan propertynames isassignablefrom mapaccessplan propertynames bytecodeenhancementenabled enhancedpropertyaccessplan propertynames propertyaccessplan propertynames complexaccessplan propertynames propertyaccessplan propertynames complexaccessplan propertynames tells whether or not bytecode enhancement cglib etc is enabled return true if bytecode enhancement is enabled public static boolean is bytecode enhancement enabled return bytecode enhancement enabled isbytecodeenhancementenabled bytecodeenhancementenabled turns on or off bytecode enhancement cglib etc param bytecode enhancement enabled the switch public static void set bytecode enhancement enabled boolean bytecode enhancement enabled access plan factory bytecode enhancement enabled bytecode enhancement enabled bytecodeenhancementenabled setbytecodeenhancementenabled bytecodeenhancementenabled accessplanfactory bytecodeenhancementenabled bytecodeenhancementenabled creates an instance for a prepared statement and column index param statement the prepared statement param column index the column index public parameter setter impl prepared statement statement int column index this ps statement this index column index preparedstatement preparedstatement columnindex parametersetterimpl preparedstatement columnindex columnindex public void set array array x throws sql exception ps set array index x setarray sqlexception setarray public void set ascii stream input stream x int length throws sql exception ps set ascii stream index x length setasciistream inputstream sqlexception setasciistream public void set big decimal big decimal x throws sql exception ps set big decimal index x setbigdecimal bigdecimal sqlexception setbigdecimal public void set binary stream input stream x int length throws sql exception ps set binary stream index x length setbinarystream inputstream sqlexception setbinarystream public void set blob blob x throws sql exception ps set blob index x setblob sqlexception setblob public void set boolean boolean x throws sql exception ps set boolean index x setboolean sqlexception setboolean public void set byte byte x throws sql exception ps set byte index x setbyte sqlexception setbyte public void set bytes byte x throws sql exception ps set bytes index x setbytes sqlexception setbytes public void set character stream reader reader int length throws sql exception ps set character stream index reader length setcharacterstream sqlexception setcharacterstream public void set clob clob x throws sql exception ps set clob index x setclob sqlexception setclob public void set date date x throws sql exception ps set date index x setdate sqlexception setdate public void set date date x calendar cal throws sql exception ps set date index x cal setdate sqlexception setdate public void set double double x throws sql exception ps set double index x setdouble sqlexception setdouble public void set float float x throws sql exception ps set float index x setfloat sqlexception setfloat public void set int int x throws sql exception ps set int index x setint sqlexception setint public void set long long x throws sql exception ps set long index x setlong sqlexception setlong public void set null int sql type throws sql exception ps set null index sql type setnull sqltype sqlexception setnull sqltype public void set null int sql type string type name throws sql exception ps set null index sql type type name setnull sqltype typename sqlexception setnull sqltype typename public void set object object x throws sql exception ps set object index x setobject sqlexception setobject public void set object object x int target sql type throws sql exception ps set object index x target sql type setobject targetsqltype sqlexception setobject targetsqltype public void set object object x int target sql type int scale throws sql exception ps set object index x scale setobject targetsqltype sqlexception setobject public void set ref ref x throws sql exception ps set ref index x setref sqlexception setref public void set short short x throws sql exception ps set short index x setshort sqlexception setshort public void set string string x throws sql exception ps set string index x setstring sqlexception setstring public void set time time x throws sql exception ps set time index x settime sqlexception settime public void set time time x calendar cal throws sql exception ps set time index x cal settime sqlexception settime public void set timestamp timestamp x throws sql exception ps set timestamp index x settimestamp sqlexception settimestamp public void set timestamp timestamp x calendar cal throws sql exception ps set timestamp index x cal settimestamp sqlexception settimestamp public void seturl url x throws sql exception ps seturl index x sqlexception public prepared statement get prepared statement return ps preparedstatement getpreparedstatement public int get parameter index return index getparameterindex public object get result result getter getter throws sql exception string value clob clob getter get clob if clob null int size int clob length value clob get sub string 1 size return value getresult resultgetter sqlexception getclob getsubstring public void set parameter parameter setter setter object parameter throws sql exception string s string parameter if s null string reader reader new string reader s setter set character stream reader s length else setter set string null setparameter parametersetter sqlexception stringreader stringreader setcharacterstream setstring public object value of string s return s valueof private static final inline parameter map parser param parser new inline parameter map parser public sql statement parser variables vars super vars inlineparametermapparser param_parser inlineparametermapparser sqlstatementparser public mapped statement parse general statement node node general statement statement vars error ctx set activity parsing a mapped statement get attributes properties attributes nodelet utils parse attributes node vars current properties string id attributes get property id if vars use statement namespaces id apply namespace id string parameter map name apply namespace attributes get property parameter map string parameter class name attributes get property parameter class string result map name attributes get property result map string result class name attributes get property result class string cache model name apply namespace attributes get property cache model string xml result name attributes get property xml result name string result set type attributes get property result set type string fetch size attributes get property fetch size string allow remapping attributes get property remap results string timeout attributes get property timeout string additional result map names vars error ctx set object id id statement get parameter and result maps vars error ctx set more info check the result map name basic result map result map null if result map name null additional result map names get all but first token result map name result map name get first token result map name statement set result map basic result map vars client get delegate get result map apply namespace result map name for int i 0 i additional result map names length i statement add result map basic result map vars client get delegate get result map apply namespace additional result map names i vars error ctx set more info check the parameter map name if parameter map name null statement set parameter map basic parameter map vars client get delegate get parameter map parameter map name statement set id id statement set resource vars error ctx get resource if result set type null if forward only equals result set type statement set result set type new integer result set type forward only else if scroll insensitive equals result set type statement set result set type new integer result set type scroll insensitive else if scroll sensitive equals result set type statement set result set type new integer result set type scroll sensitive if fetch size null statement set fetch size new integer fetch size set parameter class either from attribute or from map make sure to match parameter map parameter map statement get parameter map if parameter map null try if parameter class name null vars error ctx set more info check the parameter class parameter class name vars type handler factory resolve alias parameter class name class parameter class resources class for name parameter class name statement set parameter class parameter class catch class not found exception e throw new sql map exception error could not set parameter class cause e e else statement set parameter class parameter map get parameter class process sql statement including inline parameter maps vars error ctx set more info check the sql statement process sql statement node statement set up either null result map or automatic result mapping basic result map result map basic result map statement get result map if result map null result class name null statement set result map null else if result map null string first result class get first token result class name result map build auto result map allow remapping statement first result class xml result name statement set result map result map string additional result classes get all but first token result class name for int i 0 i additional result classes length i statement add result map build auto result map allow remapping statement additional result classes i xml result name statement set timeout vars default statement timeout if timeout null try statement set timeout integer value of timeout catch number format exception e throw new sql map exception specified timeout value for statement statement get id is not a valid integer vars error ctx set more info null vars error ctx set object id null statement set sql map client vars client if cache model name null cache model name length 0 vars client get delegate is cache models enabled cache model cache model vars client get delegate get cache model cache model name return new caching statement statement cache model else return statement mappedstatement parsegeneralstatement generalstatement errorctx setactivity nodeletutils parseattributes currentproperties getproperty usestatementnamespaces applynamespace parametermapname applynamespace getproperty parametermap parameterclassname getproperty parameterclass resultmapname getproperty resultmap resultclassname getproperty resultclass cachemodelname applynamespace getproperty cachemodel xmlresultname getproperty xmlresultname resultsettype getproperty resultsettype fetchsize getproperty fetchsize allowremapping getproperty remapresults getproperty additionalresultmapnames errorctx setobjectid errorctx setmoreinfo basicresultmap resultmap resultmapname additionalresultmapnames getallbutfirsttoken resultmapname resultmapname getfirsttoken resultmapname setresultmap basicresultmap getdelegate getresultmap applynamespace resultmapname additionalresultmapnames addresultmap basicresultmap getdelegate getresultmap applynamespace additionalresultmapnames errorctx setmoreinfo parametermapname setparametermap basicparametermap getdelegate getparametermap parametermapname setid setresource errorctx getresource resultsettype forward_only resultsettype setresultsettype resultset type_forward_only scroll_insensitive resultsettype setresultsettype resultset type_scroll_insensitive scroll_sensitive resultsettype setresultsettype resultset type_scroll_sensitive fetchsize setfetchsize fetchsize parametermap parametermap getparametermap parametermap parameterclassname errorctx setmoreinfo parameterclassname typehandlerfactory resolvealias parameterclassname parameterclass classforname parameterclassname setparameterclass parameterclass classnotfoundexception sqlmapexception setparameterclass parametermap getparameterclass errorctx setmoreinfo processsqlstatement basicresultmap resultmap basicresultmap getresultmap resultmap resultclassname setresultmap resultmap firstresultclass getfirsttoken resultclassname resultmap buildautoresultmap allowremapping firstresultclass xmlresultname setresultmap resultmap additionalresultclasses getallbutfirsttoken resultclassname additionalresultclasses addresultmap buildautoresultmap allowremapping additionalresultclasses xmlresultname settimeout defaultstatementtimeout settimeout valueof numberformatexception sqlmapexception getid errorctx setmoreinfo errorctx setobjectid setsqlmapclient cachemodelname cachemodelname getdelegate iscachemodelsenabled cachemodel cachemodel getdelegate getcachemodel cachemodelname cachingstatement cachemodel private basic result map build auto result map string allow remapping general statement statement string first result class string xml result name basic result map result map result map new auto result map vars client get delegate true equals allow remapping result map set id statement get id auto result map result map set result class resolve class first result class result map set xml name xml result name result map set resource statement get resource return result map basicresultmap buildautoresultmap allowremapping generalstatement firstresultclass xmlresultname basicresultmap resultmap resultmap autoresultmap getdelegate allowremapping resultmap setid getid autoresultmap resultmap setresultclass resolveclass firstresultclass resultmap setxmlname xmlresultname resultmap setresource getresource resultmap private class resolve class string result class name try if result class name null vars error ctx set more info check the result class return resources class for name vars type handler factory resolve alias result class name else return null catch class not found exception e throw new sql map exception error could not set result class cause e e resolveclass resultclassname resultclassname errorctx setmoreinfo classforname typehandlerfactory resolvealias resultclassname classnotfoundexception sqlmapexception private string get first token string s return new string tokenizer s false next token getfirsttoken stringtokenizer nexttoken private string get all but first token string s list strings new array list string tokenizer parser new string tokenizer s false parser next token while parser has more tokens strings add parser next token return string strings to array new string strings size getallbutfirsttoken arraylist stringtokenizer stringtokenizer nexttoken hasmoretokens nexttoken toarray private void process sql statement node n general statement statement vars error ctx set activity processing an sql statement boolean is dynamic false dynamic sql dynamic new dynamic sql vars client get delegate string buffer sql buffer new string buffer is dynamic parse dynamic tags n dynamic sql buffer is dynamic false if statement instanceof insert statement insert statement insert statement insert statement statement select key statement select key statement find and parse select key statement n statement insert statement set select key statement select key statement string sql statement sql buffer to string if is dynamic statement set sql dynamic else apply inline parameter map statement sql statement processsqlstatement generalstatement errorctx setactivity isdynamic dynamicsql dynamicsql getdelegate stringbuffer sqlbuffer stringbuffer isdynamic parsedynamictags sqlbuffer isdynamic insertstatement insertstatement insertstatement insertstatement selectkeystatement selectkeystatement findandparseselectkeystatement insertstatement setselectkeystatement selectkeystatement sqlstatement sqlbuffer tostring isdynamic setsql applyinlineparametermap sqlstatement private boolean parse dynamic tags node node dynamic parent dynamic string buffer sql buffer boolean is dynamic boolean post parse required vars error ctx set activity parsing dynamic sql tags node list children node get child nodes for int i 0 i children get length i node child children item i string node name child get node name if child get node type node cdata section node child get node type node text node string data character data child get data data nodelet utils parse property tokens data vars properties sql text sql text if post parse required sql text new sql text sql text set post parse required post parse required sql text set text data else sql text param parser parse inline parameter map vars client get delegate get type handler factory data null sql text set post parse required post parse required dynamic add child sql text sql buffer append data else if include equals node name properties attributes nodelet utils parse attributes child vars properties string refid string attributes get refid node include node node vars sql includes get refid if include node null string nsrefid apply namespace refid include node node vars sql includes get nsrefid if include node null throw new runtime exception could not find sql statement to include with refid refid is dynamic parse dynamic tags include node dynamic sql buffer is dynamic false else vars error ctx set more info check the dynamic tags sql tag handler handler sql tag handler factory get sql tag handler node name if handler null is dynamic true sql tag tag new sql tag tag set name node name tag set handler handler properties attributes nodelet utils parse attributes child vars properties tag set prepend attr attributes get property prepend tag set property attr attributes get property property tag set remove first prepend attributes get property remove first prepend tag set open attr attributes get property open tag set close attr attributes get property close tag set compare property attr attributes get property compare property tag set compare value attr attributes get property compare value tag set conjunction attr attributes get property conjunction an iterate ancestor requires a post parse if dynamic instanceof sql tag sql tag parent sql tag sql tag dynamic if parent sql tag is post parse required tag get handler instanceof iterate tag handler tag set post parse required true else if dynamic instanceof dynamic sql if tag get handler instanceof iterate tag handler tag set post parse required true dynamic add child tag if child has child nodes is dynamic parse dynamic tags child tag sql buffer is dynamic tag is post parse required vars error ctx set more info null return is dynamic parsedynamictags dynamicparent stringbuffer sqlbuffer isdynamic postparserequired errorctx setactivity nodelist getchildnodes getlength nodename getnodename getnodetype cdata_section_node getnodetype text_node characterdata getdata nodeletutils parsepropertytokens sqltext sqltext postparserequired sqltext sqltext sqltext setpostparserequired postparserequired sqltext settext sqltext param_parser parseinlineparametermap getdelegate gettypehandlerfactory sqltext setpostparserequired postparserequired addchild sqltext sqlbuffer nodename nodeletutils parseattributes includenode sqlincludes includenode applynamespace includenode sqlincludes includenode runtimeexception isdynamic parsedynamictags includenode sqlbuffer isdynamic errorctx setmoreinfo sqltaghandler sqltaghandlerfactory getsqltaghandler nodename isdynamic sqltag sqltag setname nodename sethandler nodeletutils parseattributes setprependattr getproperty setpropertyattr getproperty setremovefirstprepend getproperty removefirstprepend setopenattr getproperty setcloseattr getproperty setcomparepropertyattr getproperty compareproperty setcomparevalueattr getproperty comparevalue setconjunctionattr getproperty sqltag sqltag parentsqltag sqltag parentsqltag ispostparserequired gethandler iteratetaghandler setpostparserequired dynamicsql gethandler iteratetaghandler setpostparserequired addchild haschildnodes isdynamic parsedynamictags sqlbuffer isdynamic ispostparserequired errorctx setmoreinfo isdynamic private select key statement find and parse select key statement node n general statement insert statement vars error ctx set activity parsing select key tags select key statement select key statement null boolean found text first false boolean has type false node list children n get child nodes for int i 0 i children get length i node child children item i if child get node type node cdata section node child get node type node text node string data character data child get data if data trim length 0 found text first true else if child get node type node element node select key equals child get node name select key statement new select key statement has type parse select key child insert statement select key statement break if select key statement null has type select key statement set after found text first vars error ctx set more info null return select key statement selectkeystatement findandparseselectkeystatement generalstatement insertstatement errorctx setactivity selectkeystatement selectkeystatement foundtextfirst hastype nodelist getchildnodes getlength getnodetype cdata_section_node getnodetype text_node characterdata getdata foundtextfirst getnodetype element_node selectkey getnodename selectkeystatement selectkeystatement hastype parseselectkey insertstatement selectkeystatement selectkeystatement hastype selectkeystatement setafter foundtextfirst errorctx setmoreinfo selectkeystatement param node param insert statement param select key statement return true is the type pre or post was set from the configuration false if the type pre or post should be inferred from the position of the element in the text the legacy behavior private boolean parse select key node node general statement insert statement select key statement select key statement vars error ctx set activity parsing a select key get attributes properties attributes nodelet utils parse attributes node vars properties string key prop name attributes get property key property string result class name attributes get property result class result class name vars type handler factory resolve alias result class name class result class null get parameter and result maps select key statement set sql map client vars client select key statement set id insert statement get id select key select key statement set resource vars error ctx get resource select key statement set key property key prop name process the type pre or post attribute boolean has type string type attributes get property type if type null has type false else has type true select key statement set after post equals type try if result class name null vars error ctx set more info check the select key result class result class resources class for name result class name else class parameter class insert statement get parameter class if key prop name null parameter class null result class probe get property type for setter parameter class select key statement get key property catch class not found exception e throw new sql map exception error could not set result class cause e e if result class null result class object class process sql statement including inline parameter maps vars error ctx set more info check the select key sql statement process sql statement node select key statement basic result map result map result map new auto result map vars client get delegate false result map set id select key statement get id auto result map result map set result class result class result map set resource select key statement get resource select key statement set result map result map vars error ctx set more info null return has type insertstatement selectkeystatement parseselectkey generalstatement insertstatement selectkeystatement selectkeystatement errorctx setactivity nodeletutils parseattributes keypropname getproperty keyproperty resultclassname getproperty resultclass resultclassname typehandlerfactory resolvealias resultclassname resultclass selectkeystatement setsqlmapclient selectkeystatement setid insertstatement getid selectkey selectkeystatement setresource errorctx getresource selectkeystatement setkeyproperty keypropname hastype getproperty hastype hastype selectkeystatement setafter resultclassname errorctx setmoreinfo resultclass classforname resultclassname parameterclass insertstatement getparameterclass keypropname parameterclass resultclass getpropertytypeforsetter parameterclass selectkeystatement getkeyproperty classnotfoundexception sqlmapexception resultclass resultclass errorctx setmoreinfo processsqlstatement selectkeystatement basicresultmap resultmap resultmap autoresultmap getdelegate resultmap setid selectkeystatement getid autoresultmap resultmap setresultclass resultclass resultmap setresource selectkeystatement getresource selectkeystatement setresultmap resultmap errorctx setmoreinfo hastype private void apply inline parameter map general statement statement string sql statement string new sql sql statement vars error ctx set activity building an inline parameter map parameter map parameter map statement get parameter map vars error ctx set more info check the inline parameters if parameter map null basic parameter map map map new basic parameter map vars client get delegate map set id statement get id inline parameter map map set parameter class statement get parameter class map set resource statement get resource statement set parameter map map sql text sql text param parser parse inline parameter map vars client get delegate get type handler factory new sql statement get parameter class new sql sql text get text list mapping list arrays as list sql text get parameter mappings map set parameter mapping list mapping list sql sql null if simple dynamic sql is simple dynamic sql new sql sql new simple dynamic sql vars client get delegate new sql else sql new static sql new sql statement set sql sql applyinlineparametermap generalstatement sqlstatement newsql sqlstatement errorctx setactivity parametermap parametermap getparametermap errorctx setmoreinfo parametermap basicparametermap basicparametermap getdelegate setid getid inlineparametermap setparameterclass getparameterclass setresource getresource setparametermap sqltext sqltext param_parser parseinlineparametermap getdelegate gettypehandlerfactory newsql getparameterclass newsql sqltext gettext mappinglist aslist sqltext getparametermappings setparametermappinglist mappinglist simpledynamicsql issimpledynamicsql newsql simpledynamicsql getdelegate newsql staticsql newsql setsql private static final string date format hh mm ss public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set time i new java sql time date parameter get time date_format setparameter preparedstatement jdbctype sqlexception settime gettime public object get result result set rs string column name throws sql exception java sql time sql time rs get time column name if rs was null return null else return new java util date sql time get time getresult resultset columnname sqlexception sqltime gettime columnname wasnull sqltime gettime public object get result result set rs int column index throws sql exception java sql time sql time rs get time column index if rs was null return null else return new java util date sql time get time getresult resultset columnindex sqlexception sqltime gettime columnindex wasnull sqltime gettime public object get result callable statement cs int column index throws sql exception java sql time sql time cs get time column index if cs was null return null else return new java util date sql time get time getresult callablestatement columnindex sqlexception sqltime gettime columnindex wasnull sqltime gettime public object value of string s return simple date formatter format date format s valueof simpledateformatter date_format private parameter mapping parameter mappings public string get text return text parametermapping parametermappings gettext public void set text string text this text text replace r replace n this is white space text trim length 0 settext iswhitespace public boolean is white space return is white space iswhitespace iswhitespace public parameter mapping get parameter mappings return parameter mappings parametermapping getparametermappings parametermappings public void set parameter mappings parameter mapping parameter mappings this parameter mappings parameter mappings setparametermappings parametermapping parametermappings parametermappings parametermappings public boolean is post parse required return post parse required ispostparserequired postparserequired public void set post parse required boolean post parse required this post parse required post parse required setpostparserequired postparserequired postparserequired postparserequired public boolean is condition sql tag context ctx sql tag tag object parameter object if parameter object null return true else string prop get resolved property ctx tag object value if prop null value probe get object parameter object prop else value parameter object return value null iscondition sqltagcontext sqltag parameterobject parameterobject getresolvedproperty getobject parameterobject parameterobject private logger log public jdk14 logging impl class clazz log logger get logger clazz to string jdk14loggingimpl getlogger tostring public boolean is debug enabled return log is loggable level fine isdebugenabled isloggable public void error string s throwable e log log level severe s e public void error string s log log level severe s public void debug string s log log level fine s public void warn string s log log level warning s public object get result result getter getter throws sql exception blob blob getter get blob byte return value null if null blob return value blob get bytes 1 int blob length else return value null return return value getresult resultgetter sqlexception getblob returnvalue returnvalue getbytes returnvalue returnvalue public void set parameter parameter setter setter object parameter throws sql exception if null parameter byte bytes byte parameter byte array input stream bis new byte array input stream bytes setter set binary stream bis int bytes length setparameter parametersetter sqlexception bytearrayinputstream bytearrayinputstream setbinarystream public object value of string s return s valueof public external transaction data source ds boolean default auto commit boolean set auto commit allowed int isolation level throws transaction exception check parameters data source ds if data source null throw new transaction exception external transaction initialization failed data source was null this default auto commit default auto commit this set auto commit allowed set auto commit allowed this isolation level set isolation level isolation level externaltransaction datasource defaultautocommit setautocommitallowed isolationlevel transactionexception datasource datasource transactionexception externaltransaction datasource defaultautocommit defaultautocommit setautocommitallowed setautocommitallowed isolationlevel setisolationlevel isolationlevel private void init throws sql exception transaction exception open jdbc transaction connection data source get connection if connection null throw new transaction exception external transaction could not start transaction cause the data source returned a null connection isolation level isolation level apply isolation level connection auto commit if set auto commit allowed if connection get auto commit default auto commit connection set auto commit default auto commit debug if connection log is debug enabled connection connection log proxy new instance connection sqlexception transactionexception datasource getconnection transactionexception externaltransaction datasource isolationlevel applyisolationlevel autocommit setautocommitallowed getautocommit defaultautocommit setautocommit defaultautocommit connectionlog isdebugenabled connectionlogproxy newinstance public void commit throws sql exception transaction exception sqlexception transactionexception public void rollback throws sql exception transaction exception sqlexception transactionexception public void close throws sql exception transaction exception if connection null try isolation level restore isolation level connection finally connection close connection null sqlexception transactionexception isolationlevel restoreisolationlevel public connection get connection throws sql exception transaction exception if connection null init return connection getconnection sqlexception transactionexception public jta transaction user transaction utx data source ds int isolation level throws transaction exception check parameters user transaction utx data source ds if user transaction null throw new transaction exception jta transaction initialization failed user transaction was null if data source null throw new transaction exception jta transaction initialization failed data source was null this isolation level set isolation level isolation level jtatransaction usertransaction datasource isolationlevel transactionexception usertransaction datasource usertransaction transactionexception jtatransaction usertransaction datasource transactionexception jtatransaction datasource isolationlevel setisolationlevel isolationlevel private void init throws transaction exception sql exception start jta transaction try new transaction user transaction get status status status no transaction if new transaction user transaction begin catch exception e throw new transaction exception jta transaction could not start transaction cause e open jdbc connection connection data source get connection if connection null throw new transaction exception jta transaction could not start transaction cause the data source returned a null connection isolation level isolation level apply isolation level connection auto commit if connection get auto commit connection set auto commit false debug if connection log is debug enabled connection connection log proxy new instance connection transactionexception sqlexception newtransaction usertransaction getstatus status_no_transaction newtransaction usertransaction transactionexception jtatransaction datasource getconnection transactionexception jtatransaction datasource isolationlevel applyisolationlevel autocommit getautocommit setautocommit connectionlog isdebugenabled connectionlogproxy newinstance public void commit throws sql exception transaction exception if connection null if commmitted throw new transaction exception jta transaction could not commit because this transaction has already been committed try if new transaction user transaction commit catch exception e throw new transaction exception jta transaction could not commit cause e commmitted true sqlexception transactionexception transactionexception jtatransaction newtransaction usertransaction transactionexception jtatransaction public void rollback throws sql exception transaction exception if connection null if commmitted try if user transaction null if new transaction user transaction rollback else user transaction set rollback only catch exception e throw new transaction exception jta transaction could not rollback cause e sqlexception transactionexception usertransaction newtransaction usertransaction usertransaction setrollbackonly transactionexception jtatransaction public void close throws sql exception transaction exception if connection null try isolation level restore isolation level connection finally connection close connection null sqlexception transactionexception isolationlevel restoreisolationlevel public connection get connection throws sql exception transaction exception if connection null init return connection getconnection sqlexception transactionexception no instantiation allowed protected sql map client builder sqlmapclientbuilder builds an sql map client using the specified reader param reader a reader instance that reads an sql map config xml file the reader should read an well formed sql map config xml file return an sql map client instance public static sql map client build sql map client reader reader return new xml sql map client builder build sql map reader return new sql map config parser parse reader sqlmapclient sqlmapclient sqlmapclient buildsqlmapclient xmlsqlmapclientbuilder buildsqlmap sqlmapconfigparser builds an sql map client using the specified reader and properties file p param reader a reader instance that reads an sql map config xml file the reader should read an well formed sql map config xml file param props properties to be used to provide values to dynamic property tokens in the sql map config xml configuration file this provides an easy way to achieve some level of programmatic configuration return an sql map client instance public static sql map client build sql map client reader reader properties props return new xml sql map client builder build sql map reader props return new sql map config parser parse reader props sqlmapclient sqlmapclient sqlmapclient buildsqlmapclient xmlsqlmapclientbuilder buildsqlmap sqlmapconfigparser builds an sql map client using the specified input stream param input stream an input stream instance that reads an sql map config xml file the stream should read a well formed sql map config xml file return an sql map client instance public static sql map client build sql map client input stream input stream return new sql map config parser parse input stream sqlmapclient inputstream inputstream sqlmapclient sqlmapclient buildsqlmapclient inputstream inputstream sqlmapconfigparser inputstream builds an sql map client using the specified input stream and properties file p param input stream an input stream instance that reads an sql map config xml file the stream should read an well formed sql map config xml file param props properties to be used to provide values to dynamic property tokens in the sql map config xml configuration file this provides an easy way to achieve some level of programmatic configuration return an sql map client instance public static sql map client build sql map client input stream input stream properties props return new sql map config parser parse input stream props sqlmapclient inputstream inputstream sqlmapclient sqlmapclient buildsqlmapclient inputstream inputstream sqlmapconfigparser inputstream public basic parameter mapping mode in input allowed true output allowed false basicparametermapping inputallowed outputallowed public string get null value return null value getnullvalue nullvalue public void set null value string null value this null value null value setnullvalue nullvalue nullvalue nullvalue public string get property name return property name getpropertyname propertyname public void set property name string property name this error string check the parameter mapping for the property name property this property name property name setpropertyname propertyname errorstring propertyname propertyname propertyname public string get error string return error string geterrorstring errorstring public type handler get type handler return type handler typehandler gettypehandler typehandler public void set type handler type handler type handler this type handler type handler settypehandler typehandler typehandler typehandler typehandler public class get java type return java type getjavatype javatype public void set java type class java type this java type java type setjavatype javatype javatype javatype public string get java type name if java type null return null else return java type get name getjavatypename javatype javatype getname public void set java type name string java type name try if java type name null this java type null else this java type resources class for name java type name catch class not found exception e throw new sql map exception error setting java type property of parameter map cause e e setjavatypename javatypename javatypename javatype javatype classforname javatypename classnotfoundexception sqlmapexception javatype parametermap public int get jdbc type return jdbc type getjdbctype jdbctype public string get jdbc type name return jdbc type name getjdbctypename jdbctypename public void set jdbc type name string jdbc type name this jdbc type name jdbc type name this jdbc type jdbc type registry get type jdbc type name setjdbctypename jdbctypename jdbctypename jdbctypename jdbctype jdbctyperegistry gettype jdbctypename public string get mode return mode getmode public void set mode string mode this mode mode input allowed mode in equals mode mode inout equals mode output allowed mode out equals mode mode inout equals mode setmode inputallowed mode_in mode_inout outputallowed mode_out mode_inout public boolean is input allowed return input allowed isinputallowed inputallowed public boolean is output allowed return output allowed isoutputallowed outputallowed user defined or ref types return type name public string get type name return type name typename gettypename typename for user defined or ref types param type name public void set type name string type name this type name type name typename settypename typename typename typename public string get result map name return result map name getresultmapname resultmapname public void set result map name string result map name this result map name result map name setresultmapname resultmapname resultmapname resultmapname public integer get numeric scale return numeric scale getnumericscale numericscale public void set numeric scale integer numeric scale this numeric scale numeric scale setnumericscale numericscale numericscale numericscale private data exchange factory data exchange factory protected base data exchange data exchange factory data exchange factory this data exchange factory data exchange factory dataexchangefactory dataexchangefactory basedataexchange dataexchangefactory dataexchangefactory dataexchangefactory dataexchangefactory public cache key get cache key request scope request parameter map parameter map object parameter object cache key key new cache key object data get data request parameter map parameter object for int i 0 i data length i if data i null key update data i return key cachekey getcachekey requestscope parametermap parametermap parameterobject cachekey cachekey getdata parametermap parameterobject getter for the factory that created this object return the factory public data exchange factory get data exchange factory return data exchange factory dataexchangefactory getdataexchangefactory dataexchangefactory default constructor public cache model this flush interval no flush interval this flush interval seconds no flush interval this last flush system current time millis this flush trigger statements new hash set cachemodel flushinterval no_flush_interval flushintervalseconds no_flush_interval lastflush currenttimemillis flushtriggerstatements hashset getter for the cache model s id return the id public string get id return id getid setter for the cache model s id param id the new id public void set id string id this id id setid getter for read only property return true if a read only model public boolean is read only return read only isreadonly readonly setter for read only property param read only the new setting public void set read only boolean read only this read only read only readonly setreadonly readonly readonly readonly getter to tell if the cache serializes return true if the cache model serializes objects public boolean is serialize return serialize isserialize setter to tell the cache to serialize objects param serialize if the cache model is to serialize objects public void set serialize boolean serialize this serialize serialize setserialize getter for resource property return the value of the resource property public string get resource return resource getresource setter for resource property param resource the new value public void set resource string resource this resource resource setresource sets up the controller for the cache model param implementation the class fqcn for the controller throws class not found exception if the class cannot be found throws instantiation exception if the class cannot be instantiated throws illegal access exception if the classes constructor is not accessible public void set controller class name string implementation throws class not found exception instantiation exception illegal access exception class clazz resources class for name implementation controller cache controller resources instantiate clazz classnotfoundexception instantiationexception illegalaccessexception setcontrollerclassname classnotfoundexception instantiationexception illegalaccessexception classforname cachecontroller getter for flush interval property return the flush interval in milliseconds public long get flush interval return flush interval flushinterval flushinterval getflushinterval flushinterval getter for flush interval property return the flush interval in milliseconds public long get flush interval seconds return flush interval seconds flushinterval flushinterval getflushintervalseconds flushintervalseconds setter for flush interval property param flush interval the new flush interval in milliseconds public void set flush interval long flush interval this flush interval flush interval this flush interval seconds flush interval 1000 flushinterval flushinterval flushinterval setflushinterval flushinterval flushinterval flushinterval flushintervalseconds flushinterval adds a flush trigger statment when a flush trigger statment is executed the cache is flushed cleared param statement name the statement to add public void add flush trigger statement string statement name flush trigger statements add statement name flushtriggerstatment flushtriggerstatment statementname addflushtriggerstatement statementname flushtriggerstatements statementname gets an iterator containing all flush trigger statment objects for this cache return the iterator public iterator get flush trigger statement names return flush trigger statements iterator flushtriggerstatment getflushtriggerstatementnames flushtriggerstatements execute listener event this will be called by a mapped statement for which this cache is registered as a execute listener it will be called each time an executexxxxxx method is called in the case of the cache class it is registered in order to flush the cache whenever a certain statement is executed i e the flush on execute cache policy param statement the statement to execute public void on execute statement mapped statement statement flush executelistener mappedstatement executelistener flushonexecute onexecutestatement mappedstatement returns statistical information about the cache return the number of cache hits divided by the total requests public double get hit ratio return double hits double requests gethitratio configures the cache param props public void configure properties props controller configure props clears the cache public void flush synchronized this controller flush this last flush system current time millis if log is debug enabled log flushed false null lastflush currenttimemillis isdebugenabled get an object out of the cache a side effect of this method is that is may clear the cache if it has not been cleared in the flush interval param key the key of the object to be returned return the cached object or null public object get object cache key key object value null synchronized this if flush interval no flush interval system current time millis last flush flush interval flush value controller get object this key if serialize read only value null object value null try byte array input stream bis new byte array input stream byte value object input stream ois new object input stream bis value ois read object ois close catch exception e throw new runtime exception error caching serializable object be sure you re not attempting to use a serialized cache for an object that may be taking advantage of lazy loading cause e e requests if value null hits if log is debug enabled if value null log retrieved object true value else log cache miss false null return value flushinterval getobject cachekey flushinterval no_flush_interval currenttimemillis lastflush flushinterval getobject readonly null_object bytearrayinputstream bytearrayinputstream objectinputstream objectinputstream readobject runtimeexception isdebugenabled add an object to the cache param key the key of the object to be cached param value the object to be cached public void put object cache key key object value if null value value null object synchronized this if serialize read only value null object try byte array output stream bos new byte array output stream object output stream oos new object output stream bos oos write object value oos flush oos close value bos to byte array catch io exception e throw new runtime exception error caching serializable object cause e e controller put object this key value if log is debug enabled log stored object true value putobject cachekey null_object readonly null_object bytearrayoutputstream bytearrayoutputstream objectoutputstream objectoutputstream writeobject tobytearray ioexception runtimeexception putobject isdebugenabled get the maximum size of an object in the log output return maximum size of a logged object in the output protected int get max object log size return max object log size getmaxobjectlogsize max_object_log_size log a cache action since this method is pretty heavy weight it s best to enclose it with a log is debug enabled when called param action string to output param add value add the value being cached to the log param cache value the value being logged protected void log string action boolean add value object cache value string buffer output new string buffer cache output append get id output append output append action if add value string cache object str cache value null null cache value to string output append if cache object str length get max object log size output append cache object str to string else output append cache object str substring 1 get max object log size output append output append log debug output to string isdebugenabled addvalue cachevalue addvalue cachevalue stringbuffer stringbuffer getid addvalue cacheobjectstr cachevalue cachevalue tostring cacheobjectstr getmaxobjectlogsize cacheobjectstr tostring cacheobjectstr getmaxobjectlogsize tostring public class is greater equal tag handler extends conditional tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object long x compare ctx tag parameter object return x 0 x conditional tag handler not comparable isgreaterequaltaghandler conditionaltaghandler iscondition sqltagcontext sqltag parameterobject parameterobject conditionaltaghandler not_comparable private sql map executor delegate delegate public basic parameter map sql map executor delegate delegate this delegate delegate sqlmapexecutordelegate basicparametermap sqlmapexecutordelegate public sql map executor delegate get delegate return delegate sqlmapexecutordelegate getdelegate public string get id return id getid public void set id string id this id id setid public class get parameter class return parameter class getparameterclass parameterclass public void set parameter class class parameter class this parameter class parameter class setparameterclass parameterclass parameterclass parameterclass public data exchange get data exchange return data exchange dataexchange getdataexchange dataexchange public void set data exchange data exchange data exchange this data exchange data exchange setdataexchange dataexchange dataexchange dataexchange dataexchange public parameter mapping get parameter mappings return parameter mappings parametermapping getparametermappings parametermappings public void set parameter mapping list list parameter mapping list this parameter mappings basic parameter mapping parameter mapping list to array new basic parameter mapping parameter mapping list size for int i 0 i parameter mappings length i parameter mapping index put parameter mappings i get property name new integer i map props new hash map props put map this data exchange delegate get data exchange factory get data exchange for class parameter class data exchange initialize props setparametermappinglist parametermappinglist parametermappings basicparametermapping parametermappinglist toarray basicparametermapping parametermappinglist parametermappings parametermappingindex parametermappings getpropertyname hashmap dataexchange getdataexchangefactory getdataexchangeforclass parameterclass dataexchange public int get parameter index string property name integer idx null idx integer parameter mapping index get property name return idx null 1 idx int value getparameterindex propertyname parametermappingindex propertyname intvalue public int get parameter count return this parameter mappings length getparametercount parametermappings param ps param parameters throws java sql sql exception public void set parameters request scope request prepared statement ps object parameters throws sql exception error context error context request get error context error context set activity applying a parameter map error context set object id this get id error context set resource this get resource error context set more info check the parameter map if parameter mappings null for int i 0 i parameter mappings length i basic parameter mapping mapping basic parameter mapping parameter mappings i error context set more info mapping get error string if mapping is input allowed set parameter ps mapping parameters i sqlexception setparameters requestscope preparedstatement sqlexception errorcontext errorcontext geterrorcontext errorcontext setactivity errorcontext setobjectid getid errorcontext setresource getresource errorcontext setmoreinfo parametermappings parametermappings basicparametermapping basicparametermapping parametermappings errorcontext setmoreinfo geterrorstring isinputallowed setparameter public object get parameter object values request scope request object parameter object return data exchange get data request this parameter object getparameterobjectvalues requestscope parameterobject dataexchange getdata parameterobject public cache key get cache key request scope request object parameter object return data exchange get cache key request this parameter object cachekey getcachekey requestscope parameterobject dataexchange getcachekey parameterobject public void refresh parameter object values request scope request object parameter object object values data exchange set data request this parameter object values refreshparameterobjectvalues requestscope parameterobject dataexchange setdata parameterobject public string get resource return resource getresource public void set resource string resource this resource resource setresource protected void set parameter prepared statement ps basic parameter mapping mapping object parameters int i throws sql exception object value parameters i apply null value string null value string mapping get null value if null value string null type handler handler mapping get type handler if handler equals value null value string value null set parameter type handler type handler mapping get type handler if value null type handler set parameter ps i 1 value mapping get jdbc type name else if type handler instanceof custom type handler type handler set parameter ps i 1 value mapping get jdbc type name else int jdbc type mapping get jdbc type if jdbc type jdbc type registry unknown type ps set null i 1 jdbc type else ps set null i 1 types other setparameter preparedstatement basicparametermapping sqlexception nullvaluestring getnullvalue nullvaluestring typehandler gettypehandler nullvaluestring typehandler typehandler gettypehandler typehandler setparameter getjdbctypename typehandler customtypehandler typehandler setparameter getjdbctypename jdbctype getjdbctype jdbctype jdbctyperegistry unknown_type setnull jdbctype setnull public class is not null tag handler extends is null tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object return super is condition ctx tag parameter object isnotnulltaghandler isnulltaghandler iscondition sqltagcontext sqltag parameterobject iscondition parameterobject public class is not equal tag handler extends is equal tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object return super is condition ctx tag parameter object isnotequaltaghandler isequaltaghandler iscondition sqltagcontext sqltag parameterobject iscondition parameterobject private static charset charset private resources returns the default classloader may be null return the default classloader public static class loader get default class loader return default class loader classloader getdefaultclassloader defaultclassloader sets the default classloader param default class loader the new default class loader public static void set default class loader class loader default class loader resources default class loader default class loader defaultclassloader classloader setdefaultclassloader classloader defaultclassloader defaultclassloader defaultclassloader returns the url of the resource on the classpath param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static url get resourceurl string resource throws io exception return get resourceurl get class loader resource ioexception getresourceurl ioexception getresourceurl getclassloader returns the url of the resource on the classpath param loader the classloader used to load the resource param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static url get resourceurl class loader loader string resource throws io exception url url null if loader null url loader get resource resource if url null url class loader get system resource resource if url null throw new io exception could not find resource resource return url ioexception getresourceurl classloader ioexception getresource classloader getsystemresource ioexception returns a resource on the classpath as a stream object param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static input stream get resource as stream string resource throws io exception return get resource as stream get class loader resource ioexception inputstream getresourceasstream ioexception getresourceasstream getclassloader returns a resource on the classpath as a stream object param loader the classloader used to load the resource param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static input stream get resource as stream class loader loader string resource throws io exception input stream in null if loader null in loader get resource as stream resource if in null in class loader get system resource as stream resource if in null throw new io exception could not find resource resource return in ioexception inputstream getresourceasstream classloader ioexception inputstream getresourceasstream classloader getsystemresourceasstream ioexception returns a resource on the classpath as a properties object param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static properties get resource as properties string resource throws io exception properties props new properties input stream in null string propfile resource in get resource as stream propfile props load in in close return props ioexception getresourceasproperties ioexception inputstream getresourceasstream returns a resource on the classpath as a properties object param loader the classloader used to load the resource param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static properties get resource as properties class loader loader string resource throws io exception properties props new properties input stream in null string propfile resource in get resource as stream loader propfile props load in in close return props ioexception getresourceasproperties classloader ioexception inputstream getresourceasstream returns a resource on the classpath as a reader object param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static reader get resource as reader string resource throws io exception reader reader if charset null reader new input stream reader get resource as stream resource else reader new input stream reader get resource as stream resource charset return reader ioexception getresourceasreader ioexception inputstreamreader getresourceasstream inputstreamreader getresourceasstream returns a resource on the classpath as a reader object param loader the classloader used to load the resource param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static reader get resource as reader class loader loader string resource throws io exception reader reader if charset null reader new input stream reader get resource as stream loader resource else reader new input stream reader get resource as stream loader resource charset return reader ioexception getresourceasreader classloader ioexception inputstreamreader getresourceasstream inputstreamreader getresourceasstream returns a resource on the classpath as a file object param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static file get resource as file string resource throws io exception return new file get resourceurl resource get file ioexception getresourceasfile ioexception getresourceurl getfile returns a resource on the classpath as a file object param loader the classloader used to load the resource param resource the resource to find return the resource throws io exception if the resource cannot be found or read public static file get resource as file class loader loader string resource throws io exception return new file get resourceurl loader resource get file ioexception getresourceasfile classloader ioexception getresourceurl getfile gets a url as an input stream param url string the url to get return an input stream with the data from the url throws io exception if the resource cannot be found or read public static input stream get url as stream string url string throws io exception url url new url url string url connection conn url open connection return conn get input stream urlstring ioexception inputstream geturlasstream urlstring ioexception urlstring urlconnection openconnection getinputstream gets a url as a reader param url string the url to get return a reader with the data from the url throws io exception if the resource cannot be found or read public static reader get url as reader string url string throws io exception return new input stream reader get url as stream url string urlstring ioexception geturlasreader urlstring ioexception inputstreamreader geturlasstream urlstring gets a url as a properties object param url string the url to get return a properties object with the data from the url throws io exception if the resource cannot be found or read public static properties get url as properties string url string throws io exception properties props new properties input stream in null string propfile url string in get url as stream propfile props load in in close return props urlstring ioexception geturlasproperties urlstring ioexception inputstream urlstring geturlasstream loads a class param class name the class to load return the loaded class throws class not found exception if the class cannot be found duh public static class class for name string class name throws class not found exception class clazz null try clazz get class loader load class class name catch exception e ignore failsafe below if clazz null clazz class for name class name return clazz classname classnotfoundexception classforname classname classnotfoundexception getclassloader loadclass classname forname classname creates an instance of a class param class name the class to create return an instance of the class throws class not found exception if the class cannot be found duh throws instantiation exception if the class cannot be instantiaed throws illegal access exception if the class is not public or other access problems arise public static object instantiate string class name throws class not found exception instantiation exception illegal access exception return instantiate class for name class name classname classnotfoundexception instantiationexception illegalaccessexception classname classnotfoundexception instantiationexception illegalaccessexception classforname classname creates an instance of a class param clazz the class to create return an instance of the class throws instantiation exception if the class cannot be instantiaed throws illegal access exception if the class is not public or other access problems arise public static object instantiate class clazz throws instantiation exception illegal access exception return clazz new instance instantiationexception illegalaccessexception instantiationexception illegalaccessexception newinstance private static class loader get class loader if default class loader null return default class loader else return thread current thread get context class loader classloader getclassloader defaultclassloader defaultclassloader currentthread getcontextclassloader public static charset get charset return charset getcharset use this method to set the charset to be used when calling the get resource as reader methods this will allow ibatis to function properly when the system default encoding doesn t deal well with unicode ibatis 340 ibatis 349 param charset public static void set charset charset charset resources charset charset getresourceasreader setcharset public class is not parameter present tag handler extends is parameter present tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object return super is condition ctx tag parameter object isnotparameterpresenttaghandler isparameterpresenttaghandler iscondition sqltagcontext sqltag parameterobject iscondition parameterobject constructor for the factory param data exchange factory the factory public dom data exchange data exchange factory data exchange factory super data exchange factory dataexchangefactory domdataexchange dataexchangefactory dataexchangefactory dataexchangefactory public void initialize map properties public object get data request scope request parameter map parameter map object parameter object probe probe probe factory get probe parameter object parameter mapping mappings parameter map get parameter mappings object values new object mappings length for int i 0 i mappings length i values i probe get object parameter object mappings i get property name return values getdata requestscope parametermap parametermap parameterobject probefactory getprobe parameterobject parametermapping parametermap getparametermappings getobject parameterobject getpropertyname public object set data request scope request result map result map object result object object values string name basic result map result map get xml name if name null name result if result object null try document doc document builder factory new instance new document builder new document doc append child doc create element name result object doc catch parser configuration exception e throw new sql map exception error creating new document for dom result cause e e probe probe probe factory get probe result object result mapping mappings result map get result mappings for int i 0 i mappings length i if values i null probe set object result object mappings i get property name values i return result object setdata requestscope resultmap resultmap resultobject basicresultmap resultmap getxmlname resultobject documentbuilderfactory newinstance newdocumentbuilder newdocument appendchild createelement resultobject parserconfigurationexception sqlmapexception probefactory getprobe resultobject resultmapping resultmap getresultmappings setobject resultobject getpropertyname resultobject public object set data request scope request parameter map parameter map object parameter object object values probe probe probe factory get probe parameter object parameter mapping mappings parameter map get parameter mappings for int i 0 i mappings length i if values i null if mappings i is output allowed probe set object parameter object mappings i get property name values i return parameter object setdata requestscope parametermap parametermap parameterobject probefactory getprobe parameterobject parametermapping parametermap getparametermappings isoutputallowed setobject parameterobject getpropertyname parameterobject public sql map parser variables vars super vars parser set validation true parser set entity resolver new sql map classpath entity resolver add sql map nodelets add sql nodelets add type alias nodelets add cache model nodelets add parameter map nodelets add result map nodelets add statement nodelets sqlmapparser setvalidation setentityresolver sqlmapclasspathentityresolver addsqlmapnodelets addsqlnodelets addtypealiasnodelets addcachemodelnodelets addparametermapnodelets addresultmapnodelets addstatementnodelets public void parse reader reader throws nodelet exception parser parse reader nodeletexception public void parse input stream input stream throws nodelet exception parser parse input stream inputstream inputstream nodeletexception inputstream private void add sql map nodelets parser add nodelet sql map new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties vars current namespace attributes get property namespace parser add nodelet sql map end new nodelet public void process node node throws exception iterator names vars delegate get result map names while names has next string name string names next result map rm vars delegate get result map name discriminator disc rm get discriminator if disc null disc bind sub maps addsqlmapnodelets addnodelet sqlmap nodeletutils parseattributes currentnamespace getproperty addnodelet sqlmap getresultmapnames hasnext resultmap getresultmap getdiscriminator bindsubmaps private void add sql map nodelets parser add nodelet sql map new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties vars current namespace attributes get property namespace addsqlmapnodelets addnodelet sqlmap nodeletutils parseattributes currentnamespace getproperty parser add nodelet sql map end new nodelet public void process node node throws exception iterator names vars delegate get result map names while names has next string name string names next result map rm vars delegate get result map name discriminator disc rm get discriminator if disc null disc bind sub maps addnodelet sqlmap getresultmapnames hasnext resultmap getresultmap getdiscriminator bindsubmaps private void add sql nodelets parser add nodelet sql map sql new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties string id attributes get property id if vars use statement namespaces id apply namespace id if vars sql includes contains key id to be upgraded to throwing of a runtime exception later on log warn duplicate sql include id found else vars sql includes put id node addsqlnodelets addnodelet sqlmap nodeletutils parseattributes getproperty usestatementnamespaces applynamespace sqlincludes containskey runtimeexception sqlincludes parser add nodelet sql map sql new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties string id attributes get property id if vars use statement namespaces id apply namespace id if vars sql includes contains key id to be upgraded to throwing of a runtime exception later on log warn duplicate sql include id found else vars sql includes put id node addnodelet sqlmap nodeletutils parseattributes getproperty usestatementnamespaces applynamespace sqlincludes containskey runtimeexception sqlincludes private void add type alias nodelets parser add nodelet sql map type alias new nodelet public void process node node throws exception properties prop nodelet utils parse attributes node vars properties string alias prop get property alias string type prop get property type vars type handler factory put type alias alias type addtypealiasnodelets addnodelet sqlmap typealias nodeletutils parseattributes getproperty getproperty typehandlerfactory puttypealias parser add nodelet sql map type alias new nodelet public void process node node throws exception properties prop nodelet utils parse attributes node vars properties string alias prop get property alias string type prop get property type vars type handler factory put type alias alias type addnodelet sqlmap typealias nodeletutils parseattributes getproperty getproperty typehandlerfactory puttypealias private void add cache model nodelets parser add nodelet sql map cache model new nodelet public void process node node throws exception vars current cache model new cache model vars current properties new properties parser add nodelet sql map cache model end new nodelet public void process node node throws exception vars error ctx set activity building a cache model properties attributes nodelet utils parse attributes node vars properties string id apply namespace attributes get property id string type attributes get property type type vars type handler factory resolve alias type string read only attributes get property read only if read only null read only length 0 vars current cache model set read only true equals read only else vars current cache model set read only true string serialize attributes get property serialize if serialize null serialize length 0 vars current cache model set serialize true equals serialize else vars current cache model set serialize false vars error ctx set object id id cache model vars error ctx set more info check the cache model type vars current cache model set id id vars current cache model set resource vars error ctx get resource try vars current cache model set controller class name type catch exception e throw new runtime exception error setting cache controller class cause e e vars error ctx set more info check the cache model configuration vars current cache model configure vars current properties if vars client get delegate is cache models enabled vars client get delegate add cache model vars current cache model vars error ctx set more info null vars error ctx set object id null vars current properties null vars current cache model null parser add nodelet sql map cache model property new nodelet public void process node node throws exception vars error ctx set more info check the cache model properties properties attributes nodelet utils parse attributes node vars properties string name attributes get property name string value nodelet utils parse property tokens attributes get property value vars properties vars current properties put name value parser add nodelet sql map cache model flush on execute new nodelet public void process node node throws exception vars error ctx set more info check the cache model flush on statement elements properties child attributes nodelet utils parse attributes node vars properties vars current cache model add flush trigger statement child attributes get property statement parser add nodelet sql map cache model flush interval new nodelet public void process node node throws exception properties child attributes nodelet utils parse attributes node vars properties long t 0 try vars error ctx set more info check the cache model flush interval string milliseconds child attributes get property milliseconds string seconds child attributes get property seconds string minutes child attributes get property minutes string hours child attributes get property hours if milliseconds null t integer parse int milliseconds if seconds null t integer parse int seconds 1000 if minutes null t integer parse int minutes 60 1000 if hours null t integer parse int hours 60 60 1000 if t 1 throw new runtime exception a flush interval must specify one or more of milliseconds seconds minutes or hours vars current cache model set flush interval t catch number format exception e throw new runtime exception error building cache vars current cache model get id in resourcename flush interval milliseconds must be a valid long integer value cause e e addcachemodelnodelets addnodelet sqlmap cachemodel currentcachemodel cachemodel currentproperties addnodelet sqlmap cachemodel errorctx setactivity nodeletutils parseattributes applynamespace getproperty getproperty typehandlerfactory resolvealias readonly getproperty readonly readonly readonly currentcachemodel setreadonly readonly currentcachemodel setreadonly getproperty currentcachemodel setserialize currentcachemodel setserialize errorctx setobjectid errorctx setmoreinfo currentcachemodel setid currentcachemodel setresource errorctx getresource currentcachemodel setcontrollerclassname runtimeexception errorctx setmoreinfo currentcachemodel currentproperties getdelegate iscachemodelsenabled getdelegate addcachemodel currentcachemodel errorctx setmoreinfo errorctx setobjectid currentproperties currentcachemodel addnodelet sqlmap cachemodel errorctx setmoreinfo nodeletutils parseattributes getproperty nodeletutils parsepropertytokens getproperty currentproperties addnodelet sqlmap cachemodel flushonexecute errorctx setmoreinfo childattributes nodeletutils parseattributes currentcachemodel addflushtriggerstatement childattributes getproperty addnodelet sqlmap cachemodel flushinterval childattributes nodeletutils parseattributes errorctx setmoreinfo childattributes getproperty childattributes getproperty childattributes getproperty childattributes getproperty parseint parseint parseint parseint runtimeexception currentcachemodel setflushinterval numberformatexception runtimeexception currentcachemodel getid private void add cache model nodelets parser add nodelet sql map cache model new nodelet public void process node node throws exception vars current cache model new cache model vars current properties new properties addcachemodelnodelets addnodelet sqlmap cachemodel currentcachemodel cachemodel currentproperties parser add nodelet sql map cache model end new nodelet public void process node node throws exception vars error ctx set activity building a cache model properties attributes nodelet utils parse attributes node vars properties string id apply namespace attributes get property id string type attributes get property type type vars type handler factory resolve alias type string read only attributes get property read only if read only null read only length 0 vars current cache model set read only true equals read only else vars current cache model set read only true string serialize attributes get property serialize if serialize null serialize length 0 vars current cache model set serialize true equals serialize else vars current cache model set serialize false vars error ctx set object id id cache model vars error ctx set more info check the cache model type vars current cache model set id id vars current cache model set resource vars error ctx get resource try vars current cache model set controller class name type catch exception e throw new runtime exception error setting cache controller class cause e e vars error ctx set more info check the cache model configuration vars current cache model configure vars current properties if vars client get delegate is cache models enabled vars client get delegate add cache model vars current cache model vars error ctx set more info null vars error ctx set object id null vars current properties null vars current cache model null addnodelet sqlmap cachemodel errorctx setactivity nodeletutils parseattributes applynamespace getproperty getproperty typehandlerfactory resolvealias readonly getproperty readonly readonly readonly currentcachemodel setreadonly readonly currentcachemodel setreadonly getproperty currentcachemodel setserialize currentcachemodel setserialize errorctx setobjectid errorctx setmoreinfo currentcachemodel setid currentcachemodel setresource errorctx getresource currentcachemodel setcontrollerclassname runtimeexception errorctx setmoreinfo currentcachemodel currentproperties getdelegate iscachemodelsenabled getdelegate addcachemodel currentcachemodel errorctx setmoreinfo errorctx setobjectid currentproperties currentcachemodel parser add nodelet sql map cache model property new nodelet public void process node node throws exception vars error ctx set more info check the cache model properties properties attributes nodelet utils parse attributes node vars properties string name attributes get property name string value nodelet utils parse property tokens attributes get property value vars properties vars current properties put name value addnodelet sqlmap cachemodel errorctx setmoreinfo nodeletutils parseattributes getproperty nodeletutils parsepropertytokens getproperty currentproperties parser add nodelet sql map cache model flush on execute new nodelet public void process node node throws exception vars error ctx set more info check the cache model flush on statement elements properties child attributes nodelet utils parse attributes node vars properties vars current cache model add flush trigger statement child attributes get property statement addnodelet sqlmap cachemodel flushonexecute errorctx setmoreinfo childattributes nodeletutils parseattributes currentcachemodel addflushtriggerstatement childattributes getproperty parser add nodelet sql map cache model flush interval new nodelet public void process node node throws exception properties child attributes nodelet utils parse attributes node vars properties long t 0 try vars error ctx set more info check the cache model flush interval string milliseconds child attributes get property milliseconds string seconds child attributes get property seconds string minutes child attributes get property minutes string hours child attributes get property hours if milliseconds null t integer parse int milliseconds if seconds null t integer parse int seconds 1000 if minutes null t integer parse int minutes 60 1000 if hours null t integer parse int hours 60 60 1000 if t 1 throw new runtime exception a flush interval must specify one or more of milliseconds seconds minutes or hours vars current cache model set flush interval t catch number format exception e throw new runtime exception error building cache vars current cache model get id in resourcename flush interval milliseconds must be a valid long integer value cause e e addnodelet sqlmap cachemodel flushinterval childattributes nodeletutils parseattributes errorctx setmoreinfo childattributes getproperty childattributes getproperty childattributes getproperty childattributes getproperty parseint parseint parseint parseint runtimeexception currentcachemodel setflushinterval numberformatexception runtimeexception currentcachemodel getid private void add parameter map nodelets parser add nodelet sql map parameter map end new nodelet public void process node node throws exception vars current parameter map set parameter mapping list vars parameter mapping list vars client get delegate add parameter map vars current parameter map vars error ctx set more info null vars error ctx set object id null parser add nodelet sql map parameter map new nodelet public void process node node throws exception vars error ctx set activity building a parameter map vars current parameter map new basic parameter map vars client get delegate properties attributes nodelet utils parse attributes node vars properties string id apply namespace attributes get property id string parameter class name attributes get property class parameter class name vars type handler factory resolve alias parameter class name vars current parameter map set id id vars current parameter map set resource vars error ctx get resource vars error ctx set object id id parameter map class parameter class null try vars error ctx set more info check the parameter class parameter class resources class for name parameter class name catch exception e todo why is this commented out throw new sql map exception error configuring parameter map could not set parameter class cause e e vars current parameter map set parameter class parameter class vars parameter mapping list new array list vars error ctx set more info check the parameter mappings parser add nodelet sql map parameter map parameter new nodelet public void process node node throws exception properties child attributes nodelet utils parse attributes node vars properties string property name child attributes get property property string jdbc type child attributes get property jdbc type string type child attributes get property type name string java type child attributes get property java type string result map child attributes get property result map string null value child attributes get property null value string mode child attributes get property mode string callback child attributes get property type handler string numeric scale child attributes get property numeric scale callback vars type handler factory resolve alias callback java type vars type handler factory resolve alias java type result map apply namespace result map vars error ctx set object id property name mapping of the vars current parameter map get id parameter map type handler handler null if callback null vars error ctx set more info check the parameter mapping type handler attribute callback must be a type handler or type handler callback implementation try object impl resources class for name callback new instance if impl instanceof type handler callback handler new custom type handler type handler callback impl else if impl instanceof type handler handler type handler impl else throw new runtime exception the class callback is not a valid implementation of type handler or type handler callback catch exception e throw new runtime exception error occurred during custom type handler configuration cause e e else vars error ctx set more info check the parameter mapping property type or name handler resolve type handler vars client get delegate get type handler factory vars current parameter map get parameter class property name java type jdbc type basic parameter mapping mapping new basic parameter mapping mapping set property name property name mapping set jdbc type name jdbc type mapping set type name type mapping set result map name result map mapping set null value null value if mode null mode length 0 mapping set mode mode mapping set type handler handler try if java type null java type length 0 mapping set java type resources class for name java type catch class not found exception e throw new runtime exception error setting java type on parameter mapping cause e if numeric scale null try integer scale integer value of numeric scale if scale int value 0 throw new runtime exception error setting numeric scale on parameter mapping cause scale must be greater than or equal to zero mapping set numeric scale scale catch number format exception e throw new runtime exception error setting numeric scale on parameter mapping cause numeric scale is not a valid integer vars parameter mapping list add mapping addparametermapnodelets addnodelet sqlmap parametermap currentparametermap setparametermappinglist parametermappinglist getdelegate addparametermap currentparametermap errorctx setmoreinfo errorctx setobjectid addnodelet sqlmap parametermap errorctx setactivity currentparametermap basicparametermap getdelegate nodeletutils parseattributes applynamespace getproperty parameterclassname getproperty parameterclassname typehandlerfactory resolvealias parameterclassname currentparametermap setid currentparametermap setresource errorctx getresource errorctx setobjectid parameterclass errorctx setmoreinfo parameterclass classforname parameterclassname sqlmapexception parametermap parameterclass currentparametermap setparameterclass parameterclass parametermappinglist arraylist errorctx setmoreinfo addnodelet sqlmap parametermap childattributes nodeletutils parseattributes propertyname childattributes getproperty jdbctype childattributes getproperty jdbctype childattributes getproperty typename javatype childattributes getproperty javatype resultmap childattributes getproperty resultmap nullvalue childattributes getproperty nullvalue childattributes getproperty childattributes getproperty typehandler numericscale childattributes getproperty numericscale typehandlerfactory resolvealias javatype typehandlerfactory resolvealias javatype resultmap applynamespace resultmap errorctx setobjectid propertyname currentparametermap getid typehandler errorctx setmoreinfo typehandler typehandler typehandlercallback classforname newinstance typehandlercallback customtypehandler typehandlercallback typehandler typehandler runtimeexception typehandler typehandlercallback runtimeexception errorctx setmoreinfo resolvetypehandler getdelegate gettypehandlerfactory currentparametermap getparameterclass propertyname javatype jdbctype basicparametermapping basicparametermapping setpropertyname propertyname setjdbctypename jdbctype settypename setresultmapname resultmap setnullvalue nullvalue setmode settypehandler javatype javatype setjavatype classforname javatype classnotfoundexception runtimeexception javatype numericscale valueof numericscale intvalue runtimeexception numericscale setnumericscale numberformatexception runtimeexception numericscale numericscale parametermappinglist parser add nodelet sql map parameter map end new nodelet public void process node node throws exception vars current parameter map set parameter mapping list vars parameter mapping list vars client get delegate add parameter map vars current parameter map vars error ctx set more info null vars error ctx set object id null addnodelet sqlmap parametermap currentparametermap setparametermappinglist parametermappinglist getdelegate addparametermap currentparametermap errorctx setmoreinfo errorctx setobjectid parser add nodelet sql map parameter map new nodelet public void process node node throws exception vars error ctx set activity building a parameter map vars current parameter map new basic parameter map vars client get delegate properties attributes nodelet utils parse attributes node vars properties string id apply namespace attributes get property id string parameter class name attributes get property class parameter class name vars type handler factory resolve alias parameter class name vars current parameter map set id id vars current parameter map set resource vars error ctx get resource vars error ctx set object id id parameter map class parameter class null try vars error ctx set more info check the parameter class parameter class resources class for name parameter class name catch exception e todo why is this commented out throw new sql map exception error configuring parameter map could not set parameter class cause e e vars current parameter map set parameter class parameter class vars parameter mapping list new array list vars error ctx set more info check the parameter mappings addnodelet sqlmap parametermap errorctx setactivity currentparametermap basicparametermap getdelegate nodeletutils parseattributes applynamespace getproperty parameterclassname getproperty parameterclassname typehandlerfactory resolvealias parameterclassname currentparametermap setid currentparametermap setresource errorctx getresource errorctx setobjectid parameterclass errorctx setmoreinfo parameterclass classforname parameterclassname sqlmapexception parametermap parameterclass currentparametermap setparameterclass parameterclass parametermappinglist arraylist errorctx setmoreinfo parser add nodelet sql map parameter map parameter new nodelet public void process node node throws exception properties child attributes nodelet utils parse attributes node vars properties string property name child attributes get property property string jdbc type child attributes get property jdbc type string type child attributes get property type name string java type child attributes get property java type string result map child attributes get property result map string null value child attributes get property null value string mode child attributes get property mode string callback child attributes get property type handler string numeric scale child attributes get property numeric scale callback vars type handler factory resolve alias callback java type vars type handler factory resolve alias java type result map apply namespace result map vars error ctx set object id property name mapping of the vars current parameter map get id parameter map type handler handler null if callback null vars error ctx set more info check the parameter mapping type handler attribute callback must be a type handler or type handler callback implementation try object impl resources class for name callback new instance if impl instanceof type handler callback handler new custom type handler type handler callback impl else if impl instanceof type handler handler type handler impl else throw new runtime exception the class callback is not a valid implementation of type handler or type handler callback catch exception e throw new runtime exception error occurred during custom type handler configuration cause e e else vars error ctx set more info check the parameter mapping property type or name handler resolve type handler vars client get delegate get type handler factory vars current parameter map get parameter class property name java type jdbc type basic parameter mapping mapping new basic parameter mapping mapping set property name property name mapping set jdbc type name jdbc type mapping set type name type mapping set result map name result map mapping set null value null value if mode null mode length 0 mapping set mode mode mapping set type handler handler try if java type null java type length 0 mapping set java type resources class for name java type catch class not found exception e throw new runtime exception error setting java type on parameter mapping cause e if numeric scale null try integer scale integer value of numeric scale if scale int value 0 throw new runtime exception error setting numeric scale on parameter mapping cause scale must be greater than or equal to zero mapping set numeric scale scale catch number format exception e throw new runtime exception error setting numeric scale on parameter mapping cause numeric scale is not a valid integer vars parameter mapping list add mapping addnodelet sqlmap parametermap childattributes nodeletutils parseattributes propertyname childattributes getproperty jdbctype childattributes getproperty jdbctype childattributes getproperty typename javatype childattributes getproperty javatype resultmap childattributes getproperty resultmap nullvalue childattributes getproperty nullvalue childattributes getproperty childattributes getproperty typehandler numericscale childattributes getproperty numericscale typehandlerfactory resolvealias javatype typehandlerfactory resolvealias javatype resultmap applynamespace resultmap errorctx setobjectid propertyname currentparametermap getid typehandler errorctx setmoreinfo typehandler typehandler typehandlercallback classforname newinstance typehandlercallback customtypehandler typehandlercallback typehandler typehandler runtimeexception typehandler typehandlercallback runtimeexception errorctx setmoreinfo resolvetypehandler getdelegate gettypehandlerfactory currentparametermap getparameterclass propertyname javatype jdbctype basicparametermapping basicparametermapping setpropertyname propertyname setjdbctypename jdbctype settypename setresultmapname resultmap setnullvalue nullvalue setmode settypehandler javatype javatype setjavatype classforname javatype classnotfoundexception runtimeexception javatype numericscale valueof numericscale intvalue runtimeexception numericscale setnumericscale numberformatexception runtimeexception numericscale numericscale parametermappinglist private void add result map nodelets parser add nodelet sql map result map end new nodelet public void process node node throws exception if vars result mapping list size 0 throw new runtime exception result map vars current result map get id must have at least one result mapping vars current result map set result mapping list vars result mapping list vars current result map set discriminator vars discriminator vars discriminator null vars client get delegate add result map vars current result map vars error ctx set more info null vars error ctx set object id null parser add nodelet sql map result map new nodelet public void process node node throws exception vars error ctx set activity building a result map vars current result map new basic result map vars client get delegate properties attributes nodelet utils parse attributes node vars properties string id apply namespace attributes get property id string result class name attributes get property class string extended apply namespace attributes get property extends string xml name attributes get property xml name string group by attributes get property group by result class name vars type handler factory resolve alias result class name vars error ctx set object id id result map vars current result map set id id vars current result map set xml name xml name vars current result map set resource vars error ctx get resource if group by null group by length 0 string tokenizer parser new string tokenizer group by false while parser has more tokens vars current result map add group by property parser next token class result class null try vars error ctx set more info check the result class result class resources class for name result class name catch exception e throw new runtime exception error configuring result could not set result class cause e e vars current result map set result class result class vars result mapping list new array list vars error ctx set more info check the extended result map if extended null basic result map extended result map basic result map vars client get delegate get result map extended result mapping result mappings extended result map get result mappings for int i 0 i result mappings length i vars result mapping list add result mappings i list nested result mappings extended result map get nested result mappings if nested result mappings null iterator iter nested result mappings iterator while iter has next vars current result map add nested result mappings result mapping iter next if group by null group by length 0 if extended result map has group by iterator i extended result map group by props while i has next vars current result map add group by property string i next vars error ctx set more info check the result mappings vars result mapping index vars result mapping list size parser add nodelet sql map result map result new nodelet public void process node node throws exception properties child attributes nodelet utils parse attributes node vars properties string property name child attributes get property property string null value child attributes get property null value string jdbc type child attributes get property jdbc type string java type child attributes get property java type string column name child attributes get property column string column index child attributes get property column index string statement name child attributes get property select string result map name child attributes get property result map string callback child attributes get property type handler callback vars type handler factory resolve alias callback java type vars type handler factory resolve alias java type vars error ctx set object id property name mapping of the vars current result map get id result map type handler handler null if callback null vars error ctx set more info check the result mapping type handler attribute callback must be a type handler or type handler callback implementation try object impl resources class for name callback new instance if impl instanceof type handler callback handler new custom type handler type handler callback impl else if impl instanceof type handler handler type handler impl else throw new runtime exception the class callback is not a valid implementation of type handler or type handler callback catch exception e throw new runtime exception error occurred during custom type handler configuration cause e e else vars error ctx set more info check the result mapping property type or name handler resolve type handler vars client get delegate get type handler factory vars current result map get result class property name java type jdbc type true basic result mapping mapping new basic result mapping mapping set property name property name mapping set column name column name mapping set jdbc type name jdbc type mapping set type handler handler mapping set null value null value mapping set statement name statement name mapping set nested result map name result map name if result map name null result map name length 0 vars current result map add nested result mappings mapping try if java type null java type length 0 mapping set java type resources class for name java type catch class not found exception e throw new runtime exception error setting java type on result mapping cause e if column index null column index length 0 mapping set column index integer parse int column index else vars result mapping index mapping set column index vars result mapping index vars result mapping list add mapping parser add nodelet sql map result map discriminator sub map new nodelet public void process node node throws exception if vars discriminator null throw new runtime exception the discriminator is null but somehow a sub map was reached this is a bug properties child attributes nodelet utils parse attributes node vars properties string value child attributes get property value string result map child attributes get property result map vars discriminator add sub map value apply namespace result map parser add nodelet sql map result map discriminator new nodelet public void process node node throws exception properties child attributes nodelet utils parse attributes node vars properties string null value child attributes get property null value string jdbc type child attributes get property jdbc type string java type child attributes get property java type string column name child attributes get property column string column index child attributes get property column index string callback child attributes get property type handler callback vars type handler factory resolve alias callback java type vars type handler factory resolve alias java type type handler handler null if callback null vars error ctx set more info check the result mapping type handler attribute callback must be a type handler callback implementation try object impl resources class for name callback new instance if impl instanceof type handler callback handler new custom type handler type handler callback impl else if impl instanceof type handler handler type handler impl else throw new runtime exception the class is not a valid implementation of type handler or type handler callback catch exception e throw new runtime exception error occurred during custom type handler configuration cause e e else vars error ctx set more info check the result mapping property type or name handler resolve type handler vars client get delegate get type handler factory vars current result map get result class java type jdbc type true basic result mapping mapping new basic result mapping mapping set column name column name mapping set jdbc type name jdbc type mapping set type handler handler mapping set null value null value try if java type null java type length 0 mapping set java type resources class for name java type addresultmapnodelets addnodelet sqlmap resultmap resultmappinglist runtimeexception resultmap currentresultmap getid currentresultmap setresultmappinglist resultmappinglist currentresultmap setdiscriminator getdelegate addresultmap currentresultmap errorctx setmoreinfo errorctx setobjectid addnodelet sqlmap resultmap errorctx setactivity currentresultmap basicresultmap getdelegate nodeletutils parseattributes applynamespace getproperty resultclassname getproperty applynamespace getproperty xmlname getproperty xmlname groupby getproperty groupby resultclassname typehandlerfactory resolvealias resultclassname errorctx setobjectid currentresultmap setid currentresultmap setxmlname xmlname currentresultmap setresource errorctx getresource groupby groupby stringtokenizer stringtokenizer groupby hasmoretokens currentresultmap addgroupbyproperty nexttoken resultclass errorctx setmoreinfo resultclass classforname resultclassname runtimeexception resultclass currentresultmap setresultclass resultclass resultmappinglist arraylist errorctx setmoreinfo basicresultmap extendedresultmap basicresultmap getdelegate getresultmap resultmapping resultmappings extendedresultmap getresultmappings resultmappings resultmappinglist resultmappings nestedresultmappings extendedresultmap getnestedresultmappings nestedresultmappings nestedresultmappings hasnext currentresultmap addnestedresultmappings resultmapping groupby groupby extendedresultmap hasgroupby extendedresultmap groupbyprops hasnext currentresultmap addgroupbyproperty errorctx setmoreinfo resultmappingindex resultmappinglist addnodelet sqlmap resultmap childattributes nodeletutils parseattributes propertyname childattributes getproperty nullvalue childattributes getproperty nullvalue jdbctype childattributes getproperty jdbctype javatype childattributes getproperty javatype columnname childattributes getproperty columnindex childattributes getproperty columnindex statementname childattributes getproperty resultmapname childattributes getproperty resultmap childattributes getproperty typehandler typehandlerfactory resolvealias javatype typehandlerfactory resolvealias javatype errorctx setobjectid propertyname currentresultmap getid typehandler errorctx setmoreinfo typehandler typehandler typehandlercallback classforname newinstance typehandlercallback customtypehandler typehandlercallback typehandler typehandler runtimeexception typehandler typehandlercallback runtimeexception errorctx setmoreinfo resolvetypehandler getdelegate gettypehandlerfactory currentresultmap getresultclass propertyname javatype jdbctype basicresultmapping basicresultmapping setpropertyname propertyname setcolumnname columnname setjdbctypename jdbctype settypehandler setnullvalue nullvalue setstatementname statementname setnestedresultmapname resultmapname resultmapname resultmapname currentresultmap addnestedresultmappings javatype javatype setjavatype classforname javatype classnotfoundexception runtimeexception javatype columnindex columnindex setcolumnindex parseint columnindex resultmappingindex setcolumnindex resultmappingindex resultmappinglist addnodelet sqlmap resultmap submap runtimeexception submap childattributes nodeletutils parseattributes childattributes getproperty resultmap childattributes getproperty resultmap addsubmap applynamespace resultmap addnodelet sqlmap resultmap childattributes nodeletutils parseattributes nullvalue childattributes getproperty nullvalue jdbctype childattributes getproperty jdbctype javatype childattributes getproperty javatype columnname childattributes getproperty columnindex childattributes getproperty columnindex childattributes getproperty typehandler typehandlerfactory resolvealias javatype typehandlerfactory resolvealias javatype typehandler errorctx setmoreinfo typehandler typehandlercallback classforname newinstance typehandlercallback customtypehandler typehandlercallback typehandler typehandler runtimeexception typehandler typehandlercallback runtimeexception errorctx setmoreinfo resolvetypehandler getdelegate gettypehandlerfactory currentresultmap getresultclass javatype jdbctype basicresultmapping basicresultmapping setcolumnname columnname setjdbctypename jdbctype settypehandler setnullvalue nullvalue javatype javatype setjavatype classforname javatype parser add nodelet sql map result map end new nodelet public void process node node throws exception if vars result mapping list size 0 throw new runtime exception result map vars current result map get id must have at least one result mapping vars current result map set result mapping list vars result mapping list vars current result map set discriminator vars discriminator vars discriminator null vars client get delegate add result map vars current result map vars error ctx set more info null vars error ctx set object id null addnodelet sqlmap resultmap resultmappinglist runtimeexception resultmap currentresultmap getid currentresultmap setresultmappinglist resultmappinglist currentresultmap setdiscriminator getdelegate addresultmap currentresultmap errorctx setmoreinfo errorctx setobjectid parser add nodelet sql map result map new nodelet public void process node node throws exception vars error ctx set activity building a result map vars current result map new basic result map vars client get delegate properties attributes nodelet utils parse attributes node vars properties string id apply namespace attributes get property id string result class name attributes get property class string extended apply namespace attributes get property extends string xml name attributes get property xml name string group by attributes get property group by result class name vars type handler factory resolve alias result class name vars error ctx set object id id result map vars current result map set id id vars current result map set xml name xml name vars current result map set resource vars error ctx get resource if group by null group by length 0 string tokenizer parser new string tokenizer group by false while parser has more tokens vars current result map add group by property parser next token class result class null try vars error ctx set more info check the result class result class resources class for name result class name catch exception e throw new runtime exception error configuring result could not set result class cause e e vars current result map set result class result class vars result mapping list new array list vars error ctx set more info check the extended result map if extended null basic result map extended result map basic result map vars client get delegate get result map extended result mapping result mappings extended result map get result mappings for int i 0 i result mappings length i vars result mapping list add result mappings i list nested result mappings extended result map get nested result mappings if nested result mappings null iterator iter nested result mappings iterator while iter has next vars current result map add nested result mappings result mapping iter next if group by null group by length 0 if extended result map has group by iterator i extended result map group by props while i has next vars current result map add group by property string i next vars error ctx set more info check the result mappings vars result mapping index vars result mapping list size addnodelet sqlmap resultmap errorctx setactivity currentresultmap basicresultmap getdelegate nodeletutils parseattributes applynamespace getproperty resultclassname getproperty applynamespace getproperty xmlname getproperty xmlname groupby getproperty groupby resultclassname typehandlerfactory resolvealias resultclassname errorctx setobjectid currentresultmap setid currentresultmap setxmlname xmlname currentresultmap setresource errorctx getresource groupby groupby stringtokenizer stringtokenizer groupby hasmoretokens currentresultmap addgroupbyproperty nexttoken resultclass errorctx setmoreinfo resultclass classforname resultclassname runtimeexception resultclass currentresultmap setresultclass resultclass resultmappinglist arraylist errorctx setmoreinfo basicresultmap extendedresultmap basicresultmap getdelegate getresultmap resultmapping resultmappings extendedresultmap getresultmappings resultmappings resultmappinglist resultmappings nestedresultmappings extendedresultmap getnestedresultmappings nestedresultmappings nestedresultmappings hasnext currentresultmap addnestedresultmappings resultmapping groupby groupby extendedresultmap hasgroupby extendedresultmap groupbyprops hasnext currentresultmap addgroupbyproperty errorctx setmoreinfo resultmappingindex resultmappinglist parser add nodelet sql map result map result new nodelet public void process node node throws exception properties child attributes nodelet utils parse attributes node vars properties string property name child attributes get property property string null value child attributes get property null value string jdbc type child attributes get property jdbc type string java type child attributes get property java type string column name child attributes get property column string column index child attributes get property column index string statement name child attributes get property select string result map name child attributes get property result map string callback child attributes get property type handler callback vars type handler factory resolve alias callback java type vars type handler factory resolve alias java type vars error ctx set object id property name mapping of the vars current result map get id result map type handler handler null if callback null vars error ctx set more info check the result mapping type handler attribute callback must be a type handler or type handler callback implementation try object impl resources class for name callback new instance if impl instanceof type handler callback handler new custom type handler type handler callback impl else if impl instanceof type handler handler type handler impl else throw new runtime exception the class callback is not a valid implementation of type handler or type handler callback catch exception e throw new runtime exception error occurred during custom type handler configuration cause e e else vars error ctx set more info check the result mapping property type or name handler resolve type handler vars client get delegate get type handler factory vars current result map get result class property name java type jdbc type true basic result mapping mapping new basic result mapping mapping set property name property name mapping set column name column name mapping set jdbc type name jdbc type mapping set type handler handler mapping set null value null value mapping set statement name statement name mapping set nested result map name result map name if result map name null result map name length 0 vars current result map add nested result mappings mapping try if java type null java type length 0 mapping set java type resources class for name java type catch class not found exception e throw new runtime exception error setting java type on result mapping cause e if column index null column index length 0 mapping set column index integer parse int column index else vars result mapping index mapping set column index vars result mapping index vars result mapping list add mapping addnodelet sqlmap resultmap childattributes nodeletutils parseattributes propertyname childattributes getproperty nullvalue childattributes getproperty nullvalue jdbctype childattributes getproperty jdbctype javatype childattributes getproperty javatype columnname childattributes getproperty columnindex childattributes getproperty columnindex statementname childattributes getproperty resultmapname childattributes getproperty resultmap childattributes getproperty typehandler typehandlerfactory resolvealias javatype typehandlerfactory resolvealias javatype errorctx setobjectid propertyname currentresultmap getid typehandler errorctx setmoreinfo typehandler typehandler typehandlercallback classforname newinstance typehandlercallback customtypehandler typehandlercallback typehandler typehandler runtimeexception typehandler typehandlercallback runtimeexception errorctx setmoreinfo resolvetypehandler getdelegate gettypehandlerfactory currentresultmap getresultclass propertyname javatype jdbctype basicresultmapping basicresultmapping setpropertyname propertyname setcolumnname columnname setjdbctypename jdbctype settypehandler setnullvalue nullvalue setstatementname statementname setnestedresultmapname resultmapname resultmapname resultmapname currentresultmap addnestedresultmappings javatype javatype setjavatype classforname javatype classnotfoundexception runtimeexception javatype columnindex columnindex setcolumnindex parseint columnindex resultmappingindex setcolumnindex resultmappingindex resultmappinglist parser add nodelet sql map result map discriminator sub map new nodelet public void process node node throws exception if vars discriminator null throw new runtime exception the discriminator is null but somehow a sub map was reached this is a bug properties child attributes nodelet utils parse attributes node vars properties string value child attributes get property value string result map child attributes get property result map vars discriminator add sub map value apply namespace result map addnodelet sqlmap resultmap submap runtimeexception submap childattributes nodeletutils parseattributes childattributes getproperty resultmap childattributes getproperty resultmap addsubmap applynamespace resultmap parser add nodelet sql map result map discriminator new nodelet public void process node node throws exception properties child attributes nodelet utils parse attributes node vars properties string null value child attributes get property null value string jdbc type child attributes get property jdbc type string java type child attributes get property java type string column name child attributes get property column string column index child attributes get property column index string callback child attributes get property type handler callback vars type handler factory resolve alias callback java type vars type handler factory resolve alias java type type handler handler null if callback null vars error ctx set more info check the result mapping type handler attribute callback must be a type handler callback implementation try object impl resources class for name callback new instance if impl instanceof type handler callback handler new custom type handler type handler callback impl else if impl instanceof type handler handler type handler impl else throw new runtime exception the class is not a valid implementation of type handler or type handler callback catch exception e throw new runtime exception error occurred during custom type handler configuration cause e e else vars error ctx set more info check the result mapping property type or name handler resolve type handler vars client get delegate get type handler factory vars current result map get result class java type jdbc type true basic result mapping mapping new basic result mapping mapping set column name column name mapping set jdbc type name jdbc type mapping set type handler handler mapping set null value null value try if java type null java type length 0 mapping set java type resources class for name java type catch class not found exception e throw new runtime exception error setting java type on result mapping cause e if column index null column index length 0 mapping set column index integer parse int column index vars discriminator new discriminator vars delegate mapping addnodelet sqlmap resultmap childattributes nodeletutils parseattributes nullvalue childattributes getproperty nullvalue jdbctype childattributes getproperty jdbctype javatype childattributes getproperty javatype columnname childattributes getproperty columnindex childattributes getproperty columnindex childattributes getproperty typehandler typehandlerfactory resolvealias javatype typehandlerfactory resolvealias javatype typehandler errorctx setmoreinfo typehandler typehandlercallback classforname newinstance typehandlercallback customtypehandler typehandlercallback typehandler typehandler runtimeexception typehandler typehandlercallback runtimeexception errorctx setmoreinfo resolvetypehandler getdelegate gettypehandlerfactory currentresultmap getresultclass javatype jdbctype basicresultmapping basicresultmapping setcolumnname columnname setjdbctypename jdbctype settypehandler setnullvalue nullvalue javatype javatype setjavatype classforname javatype classnotfoundexception runtimeexception javatype columnindex columnindex setcolumnindex parseint columnindex protected void add statement nodelets parser add nodelet sql map statement new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new general statement vars delegate add mapped statement vars current statement parser add nodelet sql map insert new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new insert statement vars delegate add mapped statement vars current statement parser add nodelet sql map update new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new update statement vars delegate add mapped statement vars current statement parser add nodelet sql map delete new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new delete statement vars delegate add mapped statement vars current statement parser add nodelet sql map select new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new select statement vars delegate add mapped statement vars current statement parser add nodelet sql map procedure new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new procedure statement vars delegate add mapped statement vars current statement addstatementnodelets addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement generalstatement addmappedstatement currentstatement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement insertstatement addmappedstatement currentstatement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement updatestatement addmappedstatement currentstatement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement deletestatement addmappedstatement currentstatement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement selectstatement addmappedstatement currentstatement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement procedurestatement addmappedstatement currentstatement protected void add statement nodelets parser add nodelet sql map statement new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new general statement vars delegate add mapped statement vars current statement addstatementnodelets addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement generalstatement addmappedstatement currentstatement parser add nodelet sql map insert new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new insert statement vars delegate add mapped statement vars current statement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement insertstatement addmappedstatement currentstatement parser add nodelet sql map update new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new update statement vars delegate add mapped statement vars current statement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement updatestatement addmappedstatement currentstatement parser add nodelet sql map delete new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new delete statement vars delegate add mapped statement vars current statement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement deletestatement addmappedstatement currentstatement parser add nodelet sql map select new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new select statement vars delegate add mapped statement vars current statement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement selectstatement addmappedstatement currentstatement parser add nodelet sql map procedure new nodelet public void process node node throws exception vars current statement new sql statement parser vars parse general statement node new procedure statement vars delegate add mapped statement vars current statement addnodelet sqlmap currentstatement sqlstatementparser parsegeneralstatement procedurestatement addmappedstatement currentstatement public class string type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set string i string parameter stringtypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setstring public object get result result set rs string column name throws sql exception object s rs get string column name if rs was null return null else return s getresult resultset columnname sqlexception getstring columnname wasnull public object get result result set rs int column index throws sql exception object s rs get string column index if rs was null return null else return s getresult resultset columnindex sqlexception getstring columnindex wasnull public object get result callable statement cs int column index throws sql exception object s cs get string column index if cs was null return null else return s getresult callablestatement columnindex sqlexception getstring columnindex wasnull public object value of string s return s valueof public static final statement type procedure new statement type private statement type statementtype statementtype statementtype private static final string date format hh mm ss public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set time i java sql time parameter date_format setparameter preparedstatement jdbctype sqlexception settime public object get result result set rs string column name throws sql exception object sql time rs get time column name if rs was null return null else return sql time getresult resultset columnname sqlexception sqltime gettime columnname wasnull sqltime public object get result result set rs int column index throws sql exception object sql time rs get time column index if rs was null return null else return sql time getresult resultset columnindex sqlexception sqltime gettime columnindex wasnull sqltime public object get result callable statement cs int column index throws sql exception object sql time cs get time column index if cs was null return null else return sql time getresult callablestatement columnindex sqlexception sqltime gettime columnindex wasnull sqltime public object value of string s return simple date formatter format date format s valueof simpledateformatter date_format private cache model cache model public caching statement mapped statement statement cache model cache model this statement statement this cache model cache model cachemodel cachemodel cachingstatement mappedstatement cachemodel cachemodel cachemodel cachemodel public string get id return statement get id getid getid public statement type get statement type return statement get statement type statementtype getstatementtype getstatementtype public integer get result set type return statement get result set type getresultsettype getresultsettype public integer get fetch size return statement get fetch size getfetchsize getfetchsize public parameter map get parameter map return statement get parameter map parametermap getparametermap getparametermap public result map get result map return statement get result map resultmap getresultmap getresultmap public int execute update request scope request transaction trans object parameter object throws sql exception int n statement execute update request trans parameter object return n executeupdate requestscope parameterobject sqlexception executeupdate parameterobject public object execute query for object request scope request transaction trans object parameter object object result object throws sql exception cache key cache key get cache key request parameter object cache key update execute query for object object object cache model get object cache key if object cache model null object this was cached but null object null else if object null object statement execute query for object request trans parameter object result object cache model put object cache key object return object executequeryforobject requestscope parameterobject resultobject sqlexception cachekey cachekey getcachekey parameterobject cachekey executequeryforobject cachemodel getobject cachekey cachemodel null_object executequeryforobject parameterobject resultobject cachemodel putobject cachekey public list execute query for list request scope request transaction trans object parameter object int skip results int max results throws sql exception cache key cache key get cache key request parameter object cache key update execute query for list cache key update skip results cache key update max results object list as object cache model get object cache key list list if list as object cache model null object the cached object was null list null else if list as object null list statement execute query for list request trans parameter object skip results max results cache model put object cache key list else list list list as object return list executequeryforlist requestscope parameterobject skipresults maxresults sqlexception cachekey cachekey getcachekey parameterobject cachekey executequeryforlist cachekey skipresults cachekey maxresults listasobject cachemodel getobject cachekey listasobject cachemodel null_object listasobject executequeryforlist parameterobject skipresults maxresults cachemodel putobject cachekey listasobject public void execute query with row handler request scope request transaction trans object parameter object row handler row handler throws sql exception statement execute query with row handler request trans parameter object row handler executequerywithrowhandler requestscope parameterobject rowhandler rowhandler sqlexception executequerywithrowhandler parameterobject rowhandler public cache key get cache key request scope request object parameter object cache key key statement get cache key request parameter object if cache model is read only cache model is serialize key update request get session return key cachekey getcachekey requestscope parameterobject cachekey getcachekey parameterobject cachemodel isreadonly cachemodel isserialize getsession public void set base cache key int base statement set base cache key base setbasecachekey setbasecachekey public void add execute listener execute listener listener statement add execute listener listener addexecutelistener executelistener addexecutelistener public void notify listeners statement notify listeners notifylisteners notifylisteners public void init request request scope request statement init request request initrequest requestscope initrequest public sql get sql return statement get sql getsql getsql public class get parameter class return statement get parameter class getparameterclass getparameterclass public integer get timeout return statement get timeout gettimeout gettimeout public boolean has multiple result maps return statement has multiple result maps hasmultipleresultmaps hasmultipleresultmaps public result map get additional result maps return statement get additional result maps resultmap getadditionalresultmaps getadditionalresultmaps public batch result string statement id string sql super this statement id statement id this sql sql batchresult statementid statementid statementid public string get sql return sql getsql public int get update counts return update counts getupdatecounts updatecounts public void set update counts int update counts this update counts update counts setupdatecounts updatecounts updatecounts updatecounts public string get statement id return statement id getstatementid statementid default constructor public script runner connection connection boolean auto commit boolean stop on error this connection connection this auto commit auto commit this stop on error stop on error scriptrunner autocommit stoponerror autocommit autocommit stoponerror stoponerror public script runner string driver string url string username string password boolean auto commit boolean stop on error this driver driver this url url this username username this password password this auto commit auto commit this stop on error stop on error scriptrunner autocommit stoponerror autocommit autocommit stoponerror stoponerror setter for log writer property param log writer the new value of the log writer property public void set log writer print writer log writer this log writer log writer logwriter logwriter logwriter setlogwriter printwriter logwriter logwriter logwriter setter for error log writer property param error log writer the new value of the error log writer property public void set error log writer print writer error log writer this error log writer error log writer errorlogwriter errorlogwriter errorlogwriter seterrorlogwriter printwriter errorlogwriter errorlogwriter errorlogwriter runs an sql script read in using the reader parameter param reader the source of the script public void run script reader reader throws io exception sql exception try if connection null driver manager register driver driver resources class for name driver new instance connection conn driver manager get connection url username password try if conn get auto commit auto commit conn set auto commit auto commit run script conn reader finally conn close else boolean original auto commit connection get auto commit try if original auto commit this auto commit connection set auto commit this auto commit run script connection reader finally connection set auto commit original auto commit catch io exception e throw e catch sql exception e throw e catch exception e throw new runtime exception error running script cause e e runscript ioexception sqlexception drivermanager registerdriver classforname newinstance drivermanager getconnection getautocommit autocommit setautocommit autocommit runscript originalautocommit getautocommit originalautocommit autocommit setautocommit autocommit runscript setautocommit originalautocommit ioexception sqlexception runtimeexception runs an sql script read in using the reader parameter using the connection passed in param conn the connection to use for the script param reader the source of the script throws sql exception if any sql errors occur throws io exception if there is an error reading from the reader private void run script connection conn reader reader throws io exception sql exception string buffer command null try line number reader line reader new line number reader reader string line null while line line reader read line null if command null command new string buffer string trimmed line line trim if trimmed line starts with println trimmed line else if trimmed line length 1 trimmed line starts with do nothing else if trimmed line length 1 trimmed line starts with do nothing else if trimmed line ends with command append line substring 0 line last index of command append statement statement conn create statement println command boolean has results false if stop on error has results statement execute command to string else try statement execute command to string catch sql exception e e fill in stack trace println error error executing command println error e if auto commit conn get auto commit conn commit result set rs statement get result set if has results rs null result set meta data md rs get meta data int cols md get column count for int i 0 i cols i string name md get column name i print name t println while rs next for int i 0 i cols i string value rs get string i print value t println command null try statement close catch exception e ignore to workaround a bug in jakarta dbcp thread yield else command append line command append if auto commit conn commit catch sql exception e e fill in stack trace println error error executing command println error e throw e catch io exception e e fill in stack trace println error error executing command println error e throw e finally conn rollback flush sqlexception ioexception runscript ioexception sqlexception stringbuffer linenumberreader linereader linenumberreader linereader readline stringbuffer trimmedline trimmedline startswith trimmedline trimmedline trimmedline startswith trimmedline trimmedline startswith trimmedline endswith lastindexof createstatement hasresults stoponerror hasresults tostring tostring sqlexception fillinstacktrace printlnerror printlnerror autocommit getautocommit resultset getresultset hasresults resultsetmetadata getmetadata getcolumncount getcolumnname getstring autocommit sqlexception fillinstacktrace printlnerror printlnerror ioexception fillinstacktrace printlnerror printlnerror private void print object o if log writer null system out print o logwriter private void println object o if log writer null log writer println o logwriter logwriter private void println error object o if error log writer null error log writer println o printlnerror errorlogwriter errorlogwriter private void flush if log writer null log writer flush if error log writer null error log writer flush logwriter logwriter errorlogwriter errorlogwriter public class procedure statement extends general statement protected void post process parameter object request scope request object parameter object object parameters request get parameter map refresh parameter object values request parameter object parameters procedurestatement generalstatement postprocessparameterobject requestscope parameterobject getparametermap refreshparameterobjectvalues parameterobject protected int sql execute update request scope request connection conn string sql string object parameters throws sql exception return get sql executor execute update procedure request conn sql string trim parameters sqlexecuteupdate requestscope sqlstring sqlexception getsqlexecutor executeupdateprocedure sqlstring protected void sql execute query request scope request connection conn string sql string object parameters int skip results int max results row handler callback callback throws sql exception get sql executor execute query procedure request conn sql string trim parameters skip results max results callback sqlexecutequery requestscope sqlstring skipresults maxresults rowhandlercallback sqlexception getsqlexecutor executequeryprocedure sqlstring skipresults maxresults public statement type get statement type return statement type procedure statementtype getstatementtype statementtype public class no logging impl implements log public no logging impl class clazz nologgingimpl nologgingimpl public boolean is debug enabled return false isdebugenabled public void error string s throwable e public void error string s public void debug string s public void warn string s property access plan class clazz string property names super clazz property names setters get setters property names getters get getters property names propertyaccessplan propertynames propertynames getsetters propertynames getgetters propertynames public void set properties object object object values int i 0 try object arg new object 1 for i 0 i property names length i arg 0 values i try setters i invoke object arg catch throwable t throw class info unwrap throwable t catch throwable t throw new runtime exception error setting property setters i get name of object cause t t setproperties propertynames classinfo unwrapthrowable runtimeexception getname public object get properties object object int i 0 object values new object property names length try for i 0 i property names length i try values i getters i invoke object no arguments catch throwable t throw class info unwrap throwable t catch throwable t throw new runtime exception error getting property getters i get name of object cause t t return values getproperties propertynames propertynames no_arguments classinfo unwrapthrowable runtimeexception getname public class is parameter present tag handler extends conditional tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object return parameter object null isparameterpresenttaghandler conditionaltaghandler iscondition sqltagcontext sqltag parameterobject parameterobject public class byte type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set byte i byte parameter byte value bytetypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setbyte bytevalue public object get result result set rs string column name throws sql exception byte b rs get byte column name if rs was null return null else return new byte b getresult resultset columnname sqlexception getbyte columnname wasnull public object get result result set rs int column index throws sql exception byte b rs get byte column index if rs was null return null else return new byte b getresult resultset columnindex sqlexception getbyte columnindex wasnull public object get result callable statement cs int column index throws sql exception byte b cs get byte column index if cs was null return null else return new byte b getresult callablestatement columnindex sqlexception getbyte columnindex wasnull public object value of string s return byte value of s valueof valueof public class big decimal type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set big decimal i big decimal parameter bigdecimaltypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setbigdecimal bigdecimal public object get result result set rs string column name throws sql exception object bigdec rs get big decimal column name if rs was null return null else return bigdec getresult resultset columnname sqlexception getbigdecimal columnname wasnull public object get result result set rs int column index throws sql exception object bigdec rs get big decimal column index if rs was null return null else return bigdec getresult resultset columnindex sqlexception getbigdecimal columnindex wasnull public object get result callable statement cs int column index throws sql exception object bigdec cs get big decimal column index if cs was null return null else return bigdec getresult callablestatement columnindex sqlexception getbigdecimal columnindex wasnull public object value of string s return java math big decimal value of long value of s long value valueof bigdecimal valueof valueof longvalue build a list from another list param list a base list public xml list list list this list list xmllist public int size return list size public boolean is empty return list is empty isempty isempty public boolean contains object o return list contains o public iterator iterator return list iterator public object to array return list to array toarray toarray public object to array object a return list to array a toarray toarray public boolean add object o return list add o public boolean remove object o return list remove o public boolean contains all collection c return list contains all c containsall containsall public boolean add all collection c return list add all c addall addall public boolean add all int index collection c return list add all index c addall addall public boolean remove all collection c return list remove all c removeall removeall public boolean retain all collection c return list retain all c retainall retainall public void clear list clear public object get int index return list get index public object set int index object element return list set index element public void add int index object element list add index element public object remove int index return list remove index public int index of object o return list index of o indexof indexof public int last index of object o return list last index of o lastindexof lastindexof public list iterator list iterator return list list iterator listiterator listiterator listiterator public list iterator list iterator int index return list list iterator index listiterator listiterator listiterator public list sub list int from index int to index return list sub list from index to index sublist fromindex toindex sublist fromindex toindex public string to string string buffer buffer new string buffer for int i 0 n list size i n i buffer append list get i buffer append r n return buffer to string tostring stringbuffer stringbuffer tostring public static boolean get boolean attribute properties attribs string name boolean def string value attribs get property name if value null return def else return true equals value getbooleanattribute getproperty public static int get int attribute properties attribs string name int def string value attribs get property name if value null return def else return integer parse int value getintattribute getproperty parseint public static properties parse attributes node n return parse attributes n null parseattributes parseattributes public static properties parse attributes node n properties variables properties attributes new properties named node map attribute nodes n get attributes for int i 0 i attribute nodes get length i node attribute attribute nodes item i string value parse property tokens attribute get node value variables attributes put attribute get node name value return attributes parseattributes namednodemap attributenodes getattributes attributenodes getlength attributenodes parsepropertytokens getnodevalue getnodename public static string parse property tokens string string properties variables final string open final string close string new string string if new string null variables null int start new string index of open int end new string index of close while start 1 end start string prepend new string substring 0 start string append new string substring end close length string prop name new string substring start open length end string prop value variables get property prop name if prop value null new string prepend prop name append else new string prepend prop value append start new string index of open end new string index of close return new string parsepropertytokens newstring newstring newstring indexof newstring indexof newstring newstring propname newstring propvalue getproperty propname propvalue newstring propname newstring propvalue newstring indexof newstring indexof newstring public sql tag context sw new string writer out new print writer sw attributes new hash map remove first prepend stack new linked list iterate context stack new linked list sqltagcontext stringwriter printwriter hashmap removefirstprependstack linkedlist iteratecontextstack linkedlist public print writer get writer return out printwriter getwriter public string get body text out flush return sw get buffer to string getbodytext getbuffer tostring public void set attribute object key object value attributes put key value setattribute public object get attribute object key return attributes get key getattribute public void add parameter mapping parameter mapping mapping parameter mappings add mapping addparametermapping parametermapping parametermappings public list get parameter mappings return parameter mappings getparametermappings parametermappings public boolean is empty remove firt prepend return remove first prepend stack size 0 isemptyremovefirtprepend removefirstprependstack examine the value of the top remove first prepend marker object on the stack return was the first prepend removed public boolean peek remove first prepend marker sql tag sql tag remove first prepend marker remove first prepend remove first prepend marker remove first prepend stack get 1 return remove first prepend is remove first prepend removefirstprependmarker peekremovefirstprependmarker sqltag sqltag removefirstprependmarker removefirstprepend removefirstprependmarker removefirstprependstack removefirstprepend isremovefirstprepend pop the first remove first prepend marker once the recursion is on it s way out of the recursion loop and return it s internal value param tag public void pop remove first prepend marker sql tag tag remove first prepend marker remove first prepend remove first prepend marker remove first prepend stack get first if tag remove first prepend get sql tag remove first prepend stack remove first removefirstprependmarker popremovefirstprependmarker sqltag removefirstprependmarker removefirstprepend removefirstprependmarker removefirstprependstack getfirst removefirstprepend getsqltag removefirstprependstack removefirst push a new remove first prepend marker object with the specified internal state param tag public void push remove first prepend marker sql tag tag if tag get handler instanceof dynamic tag handler this was added to retain default behavior if tag is prepend available remove first prepend stack add first new remove first prepend marker tag true else remove first prepend stack add first new remove first prepend marker tag false else if true equals tag get remove first prepend iterate equals tag get remove first prepend you must be specific about the removal otherwise it will function as ibatis has always functioned and add the prepend remove first prepend stack add first new remove first prepend marker tag true else if tag is prepend available true equals tag get remove first prepend iterate equals tag get remove first prepend tag get parent null if no prepend or remove first prepend is specified we need to look to the parent tag for default values if true equals tag get parent get remove first prepend iterate equals tag get parent get remove first prepend remove first prepend stack add first new remove first prepend marker tag true else remove first prepend stack add first new remove first prepend marker tag false removefirstprependmarker pushremovefirstprependmarker sqltag gethandler dynamictaghandler isprependavailable removefirstprependstack addfirst removefirstprependmarker removefirstprependstack addfirst removefirstprependmarker getremovefirstprepend getremovefirstprepend removefirstprependstack addfirst removefirstprependmarker isprependavailable getremovefirstprepend getremovefirstprepend getparent removefirstprepend getparent getremovefirstprepend getparent getremovefirstprepend removefirstprependstack addfirst removefirstprependmarker removefirstprependstack addfirst removefirstprependmarker set a new internal state for top remove first prepend marker object public void disable remove first prepend marker remove first prepend marker remove first prepend stack get 1 set remove first prepend false removefirstprependmarker disableremovefirstprependmarker removefirstprependmarker removefirstprependstack setremovefirstprepend public void re enable remove first prepend marker remove first prepend marker remove first prepend stack get 0 set remove first prepend true reenableremovefirstprependmarker removefirstprependmarker removefirstprependstack setremovefirstprepend iterate context is stored here for nested dynamic tags in the body of the iterate tag param iterate context public void push iterate context iterate context iterate context iterate context stack add first iterate context iteratecontext pushiteratecontext iteratecontext iteratecontext iteratecontextstack addfirst iteratecontext iterate context is removed here from the stack when iterate tag is finished being processed return the top element of the context stack public iterate context pop iterate context iterate context ret val null if iterate context stack is empty ret val iterate context iterate context stack remove first return ret val iteratecontext popiteratecontext iteratecontext retval iteratecontextstack isempty retval iteratecontext iteratecontextstack removefirst retval iterate context is removed here from the stack when iterate tag is finished being processed return the top element on the context stack public iterate context peek iterate context iterate context ret val null if iterate context stack is empty ret val iterate context iterate context stack get first return ret val iteratecontext peekiteratecontext iteratecontext retval iteratecontextstack isempty retval iteratecontext iteratecontextstack getfirst retval public remove first prepend marker sql tag tag boolean remove first prepend this remove first prepend remove first prepend this tag tag removefirstprependmarker sqltag removefirstprepend removefirstprepend removefirstprepend return returns the remove first prepend public boolean is remove first prepend return remove first prepend removefirstprepend isremovefirstprepend removefirstprepend param remove first prepend the remove first prepend to set public void set remove first prepend boolean remove first prepend this remove first prepend remove first prepend removefirstprepend removefirstprepend setremovefirstprepend removefirstprepend removefirstprepend removefirstprepend return returns the sql tag public sql tag get sql tag return tag sqltag sqltag getsqltag protected final variables vars protected base parser variables vars this vars vars baseparser public type handler resolve type handler type handler factory type handler factory class clazz string property name string java type string jdbc type return resolve type handler type handler factory clazz property name java type jdbc type false typehandler resolvetypehandler typehandlerfactory typehandlerfactory propertyname javatype jdbctype resolvetypehandler typehandlerfactory propertyname javatype jdbctype public type handler resolve type handler type handler factory type handler factory class clazz string property name string java type string jdbc type boolean use setter to resolve type handler handler null if clazz null unknown handler type handler factory get unkown type handler else if dom type marker class is assignable from clazz dom handler type handler factory get type handler string class jdbc type else if java util map class is assignable from clazz map if java type null handler type handler factory get unkown type handler bug 1012591 type handler factory get type handler java lang object class jdbc type else try class java class resources class for name java type handler type handler factory get type handler java class jdbc type catch exception e throw new runtime exception error could not set type handler cause e e else if type handler factory get type handler clazz jdbc type null primitive handler type handler factory get type handler clazz jdbc type else java bean if java type null if use setter to resolve class type probe get property type for setter clazz property name handler type handler factory get type handler type jdbc type else class type probe get property type for getter clazz property name handler type handler factory get type handler type jdbc type else try class java class resources class for name java type handler type handler factory get type handler java class jdbc type catch exception e throw new runtime exception error could not set type handler cause e e return handler typehandler resolvetypehandler typehandlerfactory typehandlerfactory propertyname javatype jdbctype usesettertoresolve typehandler typehandlerfactory getunkowntypehandler domtypemarker isassignablefrom typehandlerfactory gettypehandler jdbctype isassignablefrom javatype typehandlerfactory getunkowntypehandler typehandlerfactory gettypehandler jdbctype javaclass classforname javatype typehandlerfactory gettypehandler javaclass jdbctype runtimeexception typehandler typehandlerfactory gettypehandler jdbctype typehandlerfactory gettypehandler jdbctype javabean javatype usesettertoresolve getpropertytypeforsetter propertyname typehandlerfactory gettypehandler jdbctype getpropertytypeforgetter propertyname typehandlerfactory gettypehandler jdbctype javaclass classforname javatype typehandlerfactory gettypehandler javaclass jdbctype runtimeexception typehandler public string apply namespace string id string new id id if vars current namespace null vars current namespace length 0 id null id index of 0 new id vars current namespace id return new id applynamespace newid currentnamespace currentnamespace indexof newid currentnamespace newid converts a public dtd into a local one param public id unused but required by entity resolver interface param system id the dtd that is being requested return the input source for the dtd throws sax exception if anything goes wrong public input source resolve entity string public id string system id throws sax exception if public id null public id public id to upper case if system id null system id system id to upper case input source source null try string path string doctype map get public id source get input source path source if source null path string doctype map get system id source get input source path source catch exception e throw new sax exception e to string return source publicid entityresolver systemid inputsource saxexception inputsource resolveentity publicid systemid saxexception publicid publicid publicid touppercase systemid systemid systemid touppercase inputsource doctypemap publicid getinputsource doctypemap systemid getinputsource saxexception tostring private input source get input source string path input source source if path null input stream in null try in resources get resource as stream path source new input source in catch io exception e ignore null is ok return source inputsource getinputsource inputsource inputstream getresourceasstream inputsource ioexception default constructor public probe exception probeexception constructor to set the message for the exception param msg the message for the exception public probe exception string msg super msg probeexception constructor to create a nested exception param cause the reason the exception is being thrown public probe exception throwable cause super cause probeexception constructor to create a nested exception with a message param msg the message for the exception param cause the reason the exception is being thrown public probe exception string msg throwable cause super msg cause probeexception factory method for getting a probe object return an implementation of the probe interface public static probe get probe return generic getprobe factory method for getting a probe object that is the best choice for the type of object supplied by the object parameter param object the object to get a probe for return an implementation of the probe interface public static probe get probe object object if object instanceof org w3c dom document return dom else return bean getprobe public static final transaction state state user provided new transaction state private transaction state transactionstate state_user_provided transactionstate transactionstate public boolean equals object object string string if object null string null return object string else object casted object value of string return object equals casted object castedobject valueof castedobject create a throttle object with just a limit param limit the number of references to allow public throttle int limit this limit limit this max wait 0 maxwait create a throttle object with a limit and a wait time param limit the number of references to allow param max wait the maximum wait time allowed for a reference public throttle int limit long max wait this limit limit this max wait max wait maxwait maxwait maxwait maxwait add a reference if a reference is not available an exception is thrown public void increment synchronized lock long total wait time 0 while count limit if max wait 0 long wait time system current time millis try lock wait max wait total wait time catch interrupted exception e ignore total wait time system current time millis wait time if total wait time max wait throw new runtime exception throttle waited too long total wait time milliseconds for lock else try lock wait catch interrupted exception e ignore count totalwaittime maxwait waittime currenttimemillis maxwait totalwaittime interruptedexception totalwaittime currenttimemillis waittime totalwaittime maxwait runtimeexception totalwaittime interruptedexception remove a reference public void decrement synchronized lock count lock notify creates an instance for a prepared statement and column index param result set the result set param column index the column index public result getter impl result set result set int column index this rs result set this index column index preparedstatement resultset columnindex resultgetterimpl resultset resultset columnindex resultset columnindex creates an instance for a prepared statement and column name param result set the result set param column name the column index public result getter impl result set result set string column name this rs result set this name column name preparedstatement resultset columnname resultgetterimpl resultset resultset columnname resultset columnname public array get array throws sql exception if name null return rs get array name else return rs get array index getarray sqlexception getarray getarray public big decimal get big decimal throws sql exception if name null return rs get big decimal name else return rs get big decimal index bigdecimal getbigdecimal sqlexception getbigdecimal getbigdecimal public blob get blob throws sql exception if name null return rs get blob name else return rs get blob index getblob sqlexception getblob getblob public boolean get boolean throws sql exception if name null return rs get boolean name else return rs get boolean index getboolean sqlexception getboolean getboolean public byte get byte throws sql exception if name null return rs get byte name else return rs get byte index getbyte sqlexception getbyte getbyte public byte get bytes throws sql exception if name null return rs get bytes name else return rs get bytes index getbytes sqlexception getbytes getbytes public clob get clob throws sql exception if name null return rs get clob name else return rs get clob index getclob sqlexception getclob getclob public date get date throws sql exception if name null return rs get date name else return rs get date index getdate sqlexception getdate getdate public date get date calendar cal throws sql exception if name null return rs get date name cal else return rs get date index cal getdate sqlexception getdate getdate public double get double throws sql exception if name null return rs get double name else return rs get double index getdouble sqlexception getdouble getdouble public float get float throws sql exception if name null return rs get float name else return rs get float index getfloat sqlexception getfloat getfloat public int get int throws sql exception if name null return rs get int name else return rs get int index getint sqlexception getint getint public long get long throws sql exception if name null return rs get long name else return rs get long index getlong sqlexception getlong getlong public object get object throws sql exception if name null return rs get object name else return rs get object index getobject sqlexception getobject getobject public object get object map map throws sql exception if name null return rs get object name map else return rs get object index map getobject sqlexception getobject getobject public ref get ref throws sql exception if name null return rs get ref name else return rs get ref index getref sqlexception getref getref public short get short throws sql exception if name null return rs get short name else return rs get short index getshort sqlexception getshort getshort public string get string throws sql exception if name null return rs get string name else return rs get string index getstring sqlexception getstring getstring public time get time throws sql exception if name null return rs get time name else return rs get time index gettime sqlexception gettime gettime public time get time calendar cal throws sql exception if name null return rs get time name else return rs get time index gettime sqlexception gettime gettime public timestamp get timestamp throws sql exception if name null return rs get timestamp name else return rs get timestamp index gettimestamp sqlexception gettimestamp gettimestamp public timestamp get timestamp calendar cal throws sql exception if name null return rs get timestamp name cal else return rs get timestamp index cal gettimestamp sqlexception gettimestamp gettimestamp public url geturl throws sql exception if name null return rs geturl name else return rs geturl index sqlexception public boolean was null throws sql exception return rs was null wasnull sqlexception wasnull public result set get result set return rs resultset getresultset public int get column index return index getcolumnindex public string get column name return name getcolumnname public class is less equal tag handler extends conditional tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object long x compare ctx tag parameter object return x 0 x conditional tag handler not comparable islessequaltaghandler conditionaltaghandler iscondition sqltagcontext sqltag parameterobject parameterobject conditionaltaghandler not_comparable public class simple date formatter public static date format string format string datetime try return new simple date format format parse datetime catch parse exception e throw new sql map exception error parsing default null value date format must be format cause e simpledateformatter simpledateformat parseexception sqlmapexception constructor to supply a reader param reader the reader used by the input stream public reader input stream reader reader this reader reader byte array out new byte array output stream writer new output stream writer byte array out chars new char 1024 inputstream readerinputstream bytearrayout bytearrayoutputstream outputstreamwriter bytearrayout constructor to supply a reader and an encoding param reader the reader used by the input stream param encoding the encoding to use for the input stream throws unsupported encoding exception if the encoding is not supported public reader input stream reader reader string encoding throws unsupported encoding exception this reader reader byte array out new byte array output stream writer new output stream writer byte array out encoding chars new char 1024 inputstream inputstream unsupportedencodingexception readerinputstream unsupportedencodingexception bytearrayout bytearrayoutputstream outputstreamwriter bytearrayout see java io input stream read public int read throws io exception if index length fill buffer if index length return 1 return 0xff buffer index inputstream ioexception fillbuffer protected void fill buffer throws io exception if length 0 return int num chars reader read chars if num chars 0 length 1 else byte array out reset writer write chars 0 num chars writer flush buffer byte array out to byte array length buffer length index 0 fillbuffer ioexception numchars numchars bytearrayout numchars bytearrayout tobytearray see java io input stream read byte int int public int read byte data int off int len throws io exception if index length fill buffer if index length return 1 int amount math min len length index system arraycopy buffer index data off amount index amount return amount inputstream ioexception fillbuffer see java io input stream available public int available throws io exception return index length length index length 0 reader ready 1 0 inputstream ioexception see java io input stream close public void close throws io exception reader close inputstream ioexception public abstract class base probe implements probe protected abstract void set property object object string property object value baseprobe setproperty protected abstract void set property object object string property object value protected abstract object get property object object string property setproperty getproperty returns an array of the readable properties exposed by an object param object the object return the array of property names returns an array of the writeable properties exposed by an object param object the object return the array of property names protected object get indexed property object object string indexed name object value null try string name indexed name substring 0 indexed name index of int i integer parse int indexed name substring indexed name index of 1 indexed name index of object list null if equals name list object else list get property object name if list instanceof list value list list get i else if list instanceof object value object list i else if list instanceof char value new character char list i else if list instanceof boolean value new boolean boolean list i else if list instanceof byte value new byte byte list i else if list instanceof double value new double double list i else if list instanceof float value new float float list i else if list instanceof int value new integer int list i else if list instanceof long value new long long list i else if list instanceof short value new short short list i else throw new probe exception the name property of the object get class get name class is not a list or array catch probe exception e throw e catch exception e throw new probe exception error getting ordinal list from java bean cause e e return value getindexedproperty indexedname indexedname indexedname indexof parseint indexedname indexedname indexof indexedname indexof getproperty probeexception getclass getname probeexception probeexception javabean protected class get indexed type object object string indexed name class value null try string name indexed name substring 0 indexed name index of int i integer parse int indexed name substring indexed name index of 1 indexed name index of object list null if equals name list get property object name else list object if list instanceof list value list list get i get class else if list instanceof object value object list i get class else if list instanceof char value character class else if list instanceof boolean value boolean class else if list instanceof byte value byte class else if list instanceof double value double class else if list instanceof float value float class else if list instanceof int value integer class else if list instanceof long value long class else if list instanceof short value short class else throw new probe exception the name property of the object get class get name class is not a list or array catch probe exception e throw e catch exception e throw new probe exception error getting ordinal list from java bean cause e e return value getindexedtype indexedname indexedname indexedname indexof parseint indexedname indexedname indexof indexedname indexof getproperty getclass getclass probeexception getclass getname probeexception probeexception javabean protected void set indexed property object object string indexed name object value try string name indexed name substring 0 indexed name index of int i integer parse int indexed name substring indexed name index of 1 indexed name index of object list get property object name if list instanceof list list list set i value else if list instanceof object object list i value else if list instanceof char char list i character value char value else if list instanceof boolean boolean list i boolean value boolean value else if list instanceof byte byte list i byte value byte value else if list instanceof double double list i double value double value else if list instanceof float float list i float value float value else if list instanceof int int list i integer value int value else if list instanceof long long list i long value long value else if list instanceof short short list i short value short value else throw new probe exception the name property of the object get class get name class is not a list or array catch probe exception e throw e catch exception e throw new probe exception error getting ordinal value from java bean cause e e setindexedproperty indexedname indexedname indexedname indexof parseint indexedname indexedname indexof indexedname indexof getproperty charvalue booleanvalue bytevalue doublevalue floatvalue intvalue longvalue shortvalue probeexception getclass getname probeexception probeexception javabean default constructor public runtimesql exception runtimesqlexception constructor to pass along a message see com ibatis common exception runtime exception param msg the message public runtimesql exception string msg super msg runtimeexception runtimesqlexception constructor to pass along another exception see com ibatis common exception runtime exception param sql exception the exception public runtimesql exception sql exception sql exception super sql exception runtimeexception sqlexception runtimesqlexception sqlexception sqlexception sqlexception constructor to pass along a message and an exception see com ibatis common exception runtime exception param msg the message param sql exception the exception public runtimesql exception string msg sql exception sql exception super msg sql exception runtimeexception sqlexception runtimesqlexception sqlexception sqlexception sqlexception getter for the sql state return the state public string getsql state throwable cause get cause if cause instanceof sql exception return sql exception cause getsql state else return null getsqlstate getcause sqlexception sqlexception getsqlstate getter for the error code return the error code public int get error code throwable cause get cause if cause instanceof sql exception return sql exception cause get error code else return 1 geterrorcode getcause sqlexception sqlexception geterrorcode get the next exception in the chain return the next exception public sql exception get next exception throwable cause get cause if cause instanceof sql exception return sql exception cause get next exception else return null sqlexception getnextexception getcause sqlexception sqlexception getnextexception set the next exception in the chain param ex the next exception public synchronized void set next exception sql exception ex throwable cause get cause if cause instanceof sql exception sql exception cause set next exception ex setnextexception sqlexception getcause sqlexception sqlexception setnextexception private boolean set auto commit allowed true public data source get data source return data source setautocommitallowed datasource getdatasource datasource public void set data source data source ds this data source ds setdatasource datasource datasource public void initialize properties props throws sql exception transaction exception string dac prop props get property default auto commit string saca prop props get property set auto commit allowed default auto commit true equals dac prop set auto commit allowed true equals saca prop saca prop null sqlexception transactionexception dacprop getproperty defaultautocommit sacaprop getproperty setautocommitallowed defaultautocommit dacprop setautocommitallowed sacaprop sacaprop public transaction new transaction int transaction isolation throws sql exception transaction exception return new external transaction data source default auto commit set auto commit allowed transaction isolation newtransaction transactionisolation sqlexception transactionexception externaltransaction datasource defaultautocommit setautocommitallowed transactionisolation default constructor public base log proxy id get next id baselogproxy getnextid protected void set column object key object value column map put key value column names add key column values add value setcolumn columnmap columnnames columnvalues protected object get column object key return column map get key getcolumn columnmap protected string get value string return column values to string getvaluestring columnvalues tostring protected string get type string list type list new array list column values size for int i 0 i column values size i object value column values get i if value null type list add null else type list add value get class get name return type list to string gettypestring typelist arraylist columnvalues columnvalues columnvalues typelist typelist getclass getname typelist tostring protected string get column string return column names to string getcolumnstring columnnames tostring protected void clear column info column map clear column names clear column values clear clearcolumninfo columnmap columnnames columnvalues protected string remove breaking whitespace string original return original replace n replace r replace t removebreakingwhitespace protected synchronized static int get next id return next id getnextid nextid public class short type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set short i short parameter short value shorttypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setshort shortvalue public object get result result set rs string column name throws sql exception short s rs get short column name if rs was null return null else return new short s getresult resultset columnname sqlexception getshort columnname wasnull public object get result result set rs int column index throws sql exception short s rs get short column index if rs was null return null else return new short s getresult resultset columnindex sqlexception getshort columnindex wasnull public object get result callable statement cs int column index throws sql exception short s cs get short column index if cs was null return null else return new short s getresult callablestatement columnindex sqlexception getshort columnindex wasnull public object value of string s return short value of s valueof valueof private string error string public string get property name return property name errorstring getpropertyname propertyname setter for the object property name used by the automap and the builder param property name the property name public void set property name string property name this error string check the result mapping for the property name property this property name property name propertyname setpropertyname propertyname errorstring propertyname propertyname propertyname getter for the error message when something goes wrong mapping this property return the error message public string get error string return error string geterrorstring errorstring getter for the column name that we are mapping return the column name public string get column name return column name getcolumnname columnname setter for the column name we are mapping used by the automap or builder param column name the column name public void set column name string column name this column name column name columnname setcolumnname columnname columnname columnname getter for the column index that we are mapping return the column index public int get column index return column index getcolumnindex columnindex setter for the column index we are mapping used by the automap or builder param column index the column index public void set column index int column index this column index column index columnindex setcolumnindex columnindex columnindex columnindex getter for the type handler for the column return the type handler public type handler get type handler return type handler typehandler gettypehandler typehandler setter for the type handler for the column param type handler the type handler public void set type handler type handler type handler this type handler type handler typehandler settypehandler typehandler typehandler typehandler typehandler setter for the java type of the column return the java type public class get java type return java type getjavatype javatype setter for the java type of the column param java type the java type public void set java type class java type this java type java type javatype setjavatype javatype javatype javatype getter for the jdbc type of the column return the jdbc type public int get jdbc type return jdbc type getjdbctype jdbctype getter for the jdbc type name of the column return the jdbc type name public string get jdbc type name return jdbc type name getjdbctypename jdbctypename setter for the jdbc type name of the column param jdbc type name the jdbc type name public void set jdbc type name string jdbc type name this jdbc type name jdbc type name this jdbc type jdbc type registry get type jdbc type name jdbctypename setjdbctypename jdbctypename jdbctypename jdbctypename jdbctype jdbctyperegistry gettype jdbctypename getter for what to return if the column is null return the null substitution public string get null value return null value getnullvalue nullvalue setter for what to return if the column is null param null value the null substitution public void set null value string null value this null value null value nullvalue setnullvalue nullvalue nullvalue nullvalue getter for the name of the statement return the name public string get statement name return statement name getstatementname statementname setter for the name of the statement param statement name the name public void set statement name string statement name this statement name statement name statementname setstatementname statementname statementname statementname public string get nested result map name return nested result map name getnestedresultmapname nestedresultmapname public void set nested result map name string nested result map name this nested result map name nested result map name setnestedresultmapname nestedresultmapname nestedresultmapname nestedresultmapname public class is not property available tag handler extends is property available tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object return super is condition ctx tag parameter object isnotpropertyavailabletaghandler ispropertyavailabletaghandler iscondition sqltagcontext sqltag parameterobject iscondition parameterobject private static final object no data new object 0 public no parameter map sql map executor delegate delegate super delegate no_data noparametermap sqlmapexecutordelegate public parameter mapping get parameter mappings return no parameters parametermapping getparametermappings no_parameters public object get parameter object values request scope request object parameter object return no data getparameterobjectvalues requestscope parameterobject no_data constructor to stretch a result set interface over a callable statement param cs the callable statement public callable statement result set callable statement cs this cs cs resultset callablestatement callablestatement callablestatementresultset callablestatement public boolean absolute int row throws sql exception throw new unsupported operation exception callable statement does not support this method sqlexception unsupportedoperationexception callablestatement public void after last throws sql exception throw new unsupported operation exception callable statement does not support this method afterlast sqlexception unsupportedoperationexception callablestatement public void before first throws sql exception throw new unsupported operation exception callable statement does not support this method beforefirst sqlexception unsupportedoperationexception callablestatement public void cancel row updates throws sql exception throw new unsupported operation exception callable statement does not support this method cancelrowupdates sqlexception unsupportedoperationexception callablestatement public void clear warnings throws sql exception throw new unsupported operation exception callable statement does not support this method clearwarnings sqlexception unsupportedoperationexception callablestatement public void close throws sql exception throw new unsupported operation exception callable statement does not support this method sqlexception unsupportedoperationexception callablestatement public void delete row throws sql exception throw new unsupported operation exception callable statement does not support this method deleterow sqlexception unsupportedoperationexception callablestatement public int find column string column name throws sql exception throw new unsupported operation exception callable statement does not support this method findcolumn columnname sqlexception unsupportedoperationexception callablestatement public boolean first throws sql exception throw new unsupported operation exception callable statement does not support this method sqlexception unsupportedoperationexception callablestatement public array get array string col name throws sql exception return cs get array col name getarray colname sqlexception getarray colname public array get array int i throws sql exception return cs get array i getarray sqlexception getarray public input stream get ascii stream int column index throws sql exception throw new unsupported operation exception callable statement does not support this method inputstream getasciistream columnindex sqlexception unsupportedoperationexception callablestatement public input stream get ascii stream string column name throws sql exception throw new unsupported operation exception callable statement does not support this method inputstream getasciistream columnname sqlexception unsupportedoperationexception callablestatement public big decimal get big decimal int column index throws sql exception return cs get big decimal column index bigdecimal getbigdecimal columnindex sqlexception getbigdecimal columnindex public big decimal get big decimal int column index int scale throws sql exception throw new unsupported operation exception callable statement does not support this method bigdecimal getbigdecimal columnindex sqlexception unsupportedoperationexception callablestatement public big decimal get big decimal string column name throws sql exception return cs get big decimal column name bigdecimal getbigdecimal columnname sqlexception getbigdecimal columnname public big decimal get big decimal string column name int scale throws sql exception throw new unsupported operation exception callable statement does not support this method bigdecimal getbigdecimal columnname sqlexception unsupportedoperationexception callablestatement public input stream get binary stream int column index throws sql exception throw new unsupported operation exception callable statement does not support this method inputstream getbinarystream columnindex sqlexception unsupportedoperationexception callablestatement public input stream get binary stream string column name throws sql exception throw new unsupported operation exception callable statement does not support this method inputstream getbinarystream columnname sqlexception unsupportedoperationexception callablestatement public blob get blob string col name throws sql exception return cs get blob col name getblob colname sqlexception getblob colname public blob get blob int i throws sql exception return cs get blob i getblob sqlexception getblob public boolean get boolean int column index throws sql exception return cs get boolean column index getboolean columnindex sqlexception getboolean columnindex public boolean get boolean string column name throws sql exception return cs get boolean column name getboolean columnname sqlexception getboolean columnname public byte get byte int column index throws sql exception return cs get byte column index getbyte columnindex sqlexception getbyte columnindex public byte get byte string column name throws sql exception return cs get byte column name getbyte columnname sqlexception getbyte columnname public byte get bytes int column index throws sql exception return cs get bytes column index getbytes columnindex sqlexception getbytes columnindex public byte get bytes string column name throws sql exception return cs get bytes column name getbytes columnname sqlexception getbytes columnname public reader get character stream int column index throws sql exception throw new unsupported operation exception callable statement does not support this method getcharacterstream columnindex sqlexception unsupportedoperationexception callablestatement public reader get character stream string column name throws sql exception throw new unsupported operation exception callable statement does not support this method getcharacterstream columnname sqlexception unsupportedoperationexception callablestatement public clob get clob string col name throws sql exception return cs get clob col name getclob colname sqlexception getclob colname public clob get clob int i throws sql exception return cs get clob i getclob sqlexception getclob public int get concurrency throws sql exception throw new unsupported operation exception callable statement does not support this method getconcurrency sqlexception unsupportedoperationexception callablestatement public string get cursor name throws sql exception throw new unsupported operation exception callable statement does not support this method getcursorname sqlexception unsupportedoperationexception callablestatement public date get date int column index throws sql exception return cs get date column index getdate columnindex sqlexception getdate columnindex public date get date int column index calendar cal throws sql exception return cs get date column index cal getdate columnindex sqlexception getdate columnindex public date get date string column name throws sql exception return cs get date column name getdate columnname sqlexception getdate columnname public date get date string column name calendar cal throws sql exception return cs get date column name cal getdate columnname sqlexception getdate columnname public double get double int column index throws sql exception return cs get double column index getdouble columnindex sqlexception getdouble columnindex public double get double string column name throws sql exception return cs get double column name getdouble columnname sqlexception getdouble columnname public int get fetch direction throws sql exception throw new unsupported operation exception callable statement does not support this method getfetchdirection sqlexception unsupportedoperationexception callablestatement public int get fetch size throws sql exception throw new unsupported operation exception callable statement does not support this method getfetchsize sqlexception unsupportedoperationexception callablestatement public float get float int column index throws sql exception return cs get float column index getfloat columnindex sqlexception getfloat columnindex public float get float string column name throws sql exception return cs get float column name getfloat columnname sqlexception getfloat columnname public int get int int column index throws sql exception return cs get int column index getint columnindex sqlexception getint columnindex public int get int string column name throws sql exception return cs get int column name getint columnname sqlexception getint columnname public long get long int column index throws sql exception return cs get long column index getlong columnindex sqlexception getlong columnindex public long get long string column name throws sql exception return cs get long column name getlong columnname sqlexception getlong columnname public result set meta data get meta data throws sql exception throw new unsupported operation exception callable statement does not support this method resultsetmetadata getmetadata sqlexception unsupportedoperationexception callablestatement public object get object string col name map map throws sql exception return cs get object col name map getobject colname sqlexception getobject colname public object get object int column index throws sql exception return cs get object column index getobject columnindex sqlexception getobject columnindex public object get object string column name throws sql exception return cs get object column name getobject columnname sqlexception getobject columnname public object get object int i map map throws sql exception return cs get object i map getobject sqlexception getobject public ref get ref string col name throws sql exception return cs get ref col name getref colname sqlexception getref colname public ref get ref int i throws sql exception return cs get ref i getref sqlexception getref public int get row throws sql exception throw new unsupported operation exception callable statement does not support this method getrow sqlexception unsupportedoperationexception callablestatement public short get short int column index throws sql exception return cs get short column index getshort columnindex sqlexception getshort columnindex public short get short string column name throws sql exception return cs get short column name getshort columnname sqlexception getshort columnname public statement get statement throws sql exception throw new unsupported operation exception callable statement does not support this method getstatement sqlexception unsupportedoperationexception callablestatement public string get string int column index throws sql exception return cs get string column index getstring columnindex sqlexception getstring columnindex public string get string string column name throws sql exception return cs get string column name getstring columnname sqlexception getstring columnname public time get time int column index throws sql exception return cs get time column index gettime columnindex sqlexception gettime columnindex public time get time int column index calendar cal throws sql exception return cs get time column index cal gettime columnindex sqlexception gettime columnindex public time get time string column name throws sql exception return cs get time column name gettime columnname sqlexception gettime columnname public time get time string column name calendar cal throws sql exception return cs get time column name cal gettime columnname sqlexception gettime columnname public timestamp get timestamp int column index throws sql exception return cs get timestamp column index gettimestamp columnindex sqlexception gettimestamp columnindex public timestamp get timestamp int column index calendar cal throws sql exception return cs get timestamp column index cal gettimestamp columnindex sqlexception gettimestamp columnindex public timestamp get timestamp string column name throws sql exception return cs get timestamp column name gettimestamp columnname sqlexception gettimestamp columnname public timestamp get timestamp string column name calendar cal throws sql exception return cs get timestamp column name cal gettimestamp columnname sqlexception gettimestamp columnname public int get type throws sql exception throw new unsupported operation exception callable statement does not support this method gettype sqlexception unsupportedoperationexception callablestatement public input stream get unicode stream int column index throws sql exception throw new unsupported operation exception callable statement does not support this method inputstream getunicodestream columnindex sqlexception unsupportedoperationexception callablestatement public input stream get unicode stream string column name throws sql exception throw new unsupported operation exception callable statement does not support this method inputstream getunicodestream columnname sqlexception unsupportedoperationexception callablestatement public url geturl int column index throws sql exception return cs geturl column index columnindex sqlexception columnindex public url geturl string column name throws sql exception return cs geturl column name columnname sqlexception columnname public sql warning get warnings throws sql exception throw new unsupported operation exception callable statement does not support this method sqlwarning getwarnings sqlexception unsupportedoperationexception callablestatement public void insert row throws sql exception throw new unsupported operation exception callable statement does not support this method insertrow sqlexception unsupportedoperationexception callablestatement public boolean is after last throws sql exception throw new unsupported operation exception callable statement does not support this method isafterlast sqlexception unsupportedoperationexception callablestatement public boolean is before first throws sql exception throw new unsupported operation exception callable statement does not support this method isbeforefirst sqlexception unsupportedoperationexception callablestatement public boolean is first throws sql exception throw new unsupported operation exception callable statement does not support this method isfirst sqlexception unsupportedoperationexception callablestatement public boolean is last throws sql exception throw new unsupported operation exception callable statement does not support this method islast sqlexception unsupportedoperationexception callablestatement public boolean last throws sql exception throw new unsupported operation exception callable statement does not support this method sqlexception unsupportedoperationexception callablestatement public void move to current row throws sql exception throw new unsupported operation exception callable statement does not support this method movetocurrentrow sqlexception unsupportedoperationexception callablestatement public void move to insert row throws sql exception throw new unsupported operation exception callable statement does not support this method movetoinsertrow sqlexception unsupportedoperationexception callablestatement public boolean next throws sql exception throw new unsupported operation exception callable statement does not support this method sqlexception unsupportedoperationexception callablestatement public boolean previous throws sql exception throw new unsupported operation exception callable statement does not support this method sqlexception unsupportedoperationexception callablestatement public void refresh row throws sql exception throw new unsupported operation exception callable statement does not support this method refreshrow sqlexception unsupportedoperationexception callablestatement public boolean relative int rows throws sql exception throw new unsupported operation exception callable statement does not support this method sqlexception unsupportedoperationexception callablestatement public boolean row deleted throws sql exception throw new unsupported operation exception callable statement does not support this method rowdeleted sqlexception unsupportedoperationexception callablestatement public boolean row inserted throws sql exception throw new unsupported operation exception callable statement does not support this method rowinserted sqlexception unsupportedoperationexception callablestatement public boolean row updated throws sql exception throw new unsupported operation exception callable statement does not support this method rowupdated sqlexception unsupportedoperationexception callablestatement public void set fetch direction int direction throws sql exception throw new unsupported operation exception callable statement does not support this method setfetchdirection sqlexception unsupportedoperationexception callablestatement public void set fetch size int rows throws sql exception throw new unsupported operation exception callable statement does not support this method setfetchsize sqlexception unsupportedoperationexception callablestatement public void update array int column index array x throws sql exception throw new unsupported operation exception callable statement does not support this method updatearray columnindex sqlexception unsupportedoperationexception callablestatement public void update array string column name array x throws sql exception throw new unsupported operation exception callable statement does not support this method updatearray columnname sqlexception unsupportedoperationexception callablestatement public void update ascii stream int column index input stream x int length throws sql exception throw new unsupported operation exception callable statement does not support this method updateasciistream columnindex inputstream sqlexception unsupportedoperationexception callablestatement public void update ascii stream string column name input stream x int length throws sql exception throw new unsupported operation exception callable statement does not support this method updateasciistream columnname inputstream sqlexception unsupportedoperationexception callablestatement public void update big decimal int column index big decimal x throws sql exception throw new unsupported operation exception callable statement does not support this method updatebigdecimal columnindex bigdecimal sqlexception unsupportedoperationexception callablestatement public void update big decimal string column name big decimal x throws sql exception throw new unsupported operation exception callable statement does not support this method updatebigdecimal columnname bigdecimal sqlexception unsupportedoperationexception callablestatement public void update binary stream int column index input stream x int length throws sql exception throw new unsupported operation exception callable statement does not support this method updatebinarystream columnindex inputstream sqlexception unsupportedoperationexception callablestatement public void update binary stream string column name input stream x int length throws sql exception throw new unsupported operation exception callable statement does not support this method updatebinarystream columnname inputstream sqlexception unsupportedoperationexception callablestatement public void update blob int column index blob x throws sql exception throw new unsupported operation exception callable statement does not support this method updateblob columnindex sqlexception unsupportedoperationexception callablestatement public void update blob string column name blob x throws sql exception throw new unsupported operation exception callable statement does not support this method updateblob columnname sqlexception unsupportedoperationexception callablestatement public void update boolean int column index boolean x throws sql exception throw new unsupported operation exception callable statement does not support this method updateboolean columnindex sqlexception unsupportedoperationexception callablestatement public void update boolean string column name boolean x throws sql exception throw new unsupported operation exception callable statement does not support this method updateboolean columnname sqlexception unsupportedoperationexception callablestatement public void update byte int column index byte x throws sql exception throw new unsupported operation exception callable statement does not support this method updatebyte columnindex sqlexception unsupportedoperationexception callablestatement public void update byte string column name byte x throws sql exception throw new unsupported operation exception callable statement does not support this method updatebyte columnname sqlexception unsupportedoperationexception callablestatement public void update bytes int column index byte x throws sql exception throw new unsupported operation exception callable statement does not support this method updatebytes columnindex sqlexception unsupportedoperationexception callablestatement public void update bytes string column name byte x throws sql exception throw new unsupported operation exception callable statement does not support this method updatebytes columnname sqlexception unsupportedoperationexception callablestatement public void update character stream int column index reader x int length throws sql exception throw new unsupported operation exception callable statement does not support this method updatecharacterstream columnindex sqlexception unsupportedoperationexception callablestatement public void update character stream string column name reader reader int length throws sql exception throw new unsupported operation exception callable statement does not support this method updatecharacterstream columnname sqlexception unsupportedoperationexception callablestatement public void update clob int column index clob x throws sql exception throw new unsupported operation exception callable statement does not support this method updateclob columnindex sqlexception unsupportedoperationexception callablestatement public void update clob string column name clob x throws sql exception throw new unsupported operation exception callable statement does not support this method updateclob columnname sqlexception unsupportedoperationexception callablestatement public void update date int column index date x throws sql exception throw new unsupported operation exception callable statement does not support this method updatedate columnindex sqlexception unsupportedoperationexception callablestatement public void update date string column name date x throws sql exception throw new unsupported operation exception callable statement does not support this method updatedate columnname sqlexception unsupportedoperationexception callablestatement public void update double int column index double x throws sql exception throw new unsupported operation exception callable statement does not support this method updatedouble columnindex sqlexception unsupportedoperationexception callablestatement public void update double string column name double x throws sql exception throw new unsupported operation exception callable statement does not support this method updatedouble columnname sqlexception unsupportedoperationexception callablestatement public void update float int column index float x throws sql exception throw new unsupported operation exception callable statement does not support this method updatefloat columnindex sqlexception unsupportedoperationexception callablestatement public void update float string column name float x throws sql exception throw new unsupported operation exception callable statement does not support this method updatefloat columnname sqlexception unsupportedoperationexception callablestatement public void update int int column index int x throws sql exception throw new unsupported operation exception callable statement does not support this method updateint columnindex sqlexception unsupportedoperationexception callablestatement public void update int string column name int x throws sql exception throw new unsupported operation exception callable statement does not support this method updateint columnname sqlexception unsupportedoperationexception callablestatement public void update long int column index long x throws sql exception throw new unsupported operation exception callable statement does not support this method updatelong columnindex sqlexception unsupportedoperationexception callablestatement public void update long string column name long x throws sql exception throw new unsupported operation exception callable statement does not support this method updatelong columnname sqlexception unsupportedoperationexception callablestatement public void update null int column index throws sql exception throw new unsupported operation exception callable statement does not support this method updatenull columnindex sqlexception unsupportedoperationexception callablestatement public void update null string column name throws sql exception throw new unsupported operation exception callable statement does not support this method updatenull columnname sqlexception unsupportedoperationexception callablestatement public void update object int column index object x throws sql exception throw new unsupported operation exception callable statement does not support this method updateobject columnindex sqlexception unsupportedoperationexception callablestatement public void update object int column index object x int scale throws sql exception throw new unsupported operation exception callable statement does not support this method updateobject columnindex sqlexception unsupportedoperationexception callablestatement public void update object string column name object x throws sql exception throw new unsupported operation exception callable statement does not support this method updateobject columnname sqlexception unsupportedoperationexception callablestatement public void update object string column name object x int scale throws sql exception throw new unsupported operation exception callable statement does not support this method updateobject columnname sqlexception unsupportedoperationexception callablestatement public void update ref int column index ref x throws sql exception throw new unsupported operation exception callable statement does not support this method updateref columnindex sqlexception unsupportedoperationexception callablestatement public void update ref string column name ref x throws sql exception throw new unsupported operation exception callable statement does not support this method updateref columnname sqlexception unsupportedoperationexception callablestatement public void update row throws sql exception throw new unsupported operation exception callable statement does not support this method updaterow sqlexception unsupportedoperationexception callablestatement public void update short int column index short x throws sql exception throw new unsupported operation exception callable statement does not support this method updateshort columnindex sqlexception unsupportedoperationexception callablestatement public void update short string column name short x throws sql exception throw new unsupported operation exception callable statement does not support this method updateshort columnname sqlexception unsupportedoperationexception callablestatement public void update string int column index string x throws sql exception throw new unsupported operation exception callable statement does not support this method updatestring columnindex sqlexception unsupportedoperationexception callablestatement public void update string string column name string x throws sql exception throw new unsupported operation exception callable statement does not support this method updatestring columnname sqlexception unsupportedoperationexception callablestatement public void update time int column index time x throws sql exception throw new unsupported operation exception callable statement does not support this method updatetime columnindex sqlexception unsupportedoperationexception callablestatement public void update time string column name time x throws sql exception throw new unsupported operation exception callable statement does not support this method updatetime columnname sqlexception unsupportedoperationexception callablestatement public void update timestamp int column index timestamp x throws sql exception throw new unsupported operation exception callable statement does not support this method updatetimestamp columnindex sqlexception unsupportedoperationexception callablestatement public void update timestamp string column name timestamp x throws sql exception throw new unsupported operation exception callable statement does not support this method updatetimestamp columnname sqlexception unsupportedoperationexception callablestatement public boolean was null throws sql exception return cs was null wasnull sqlexception wasnull constructor for an enhanced lazy list loader param client the client that is creating the lazy list param statement name the statement to be used to build the list param parameter object the parameter object to be used to build the list param target type the type we are putting data into public enhanced lazy result loader extended sql map client client string statement name object parameter object class target type loader new enhanced lazy result loader impl client statement name parameter object target type statementname parameterobject targettype enhancedlazyresultloader extendedsqlmapclient statementname parameterobject targettype enhancedlazyresultloaderimpl statementname parameterobject targettype loads the result return the results a list or object throws sql exception if there is a problem public object load result throws sql exception return enhanced lazy result loader impl loader load result sqlexception loadresult sqlexception enhancedlazyresultloaderimpl loadresult constructor for an enhanced lazy list loader implementation param client the client that is creating the lazy list param statement name the statement to be used to build the list param parameter object the parameter object to be used to build the list param target type the type we are putting data into public enhanced lazy result loader impl extended sql map client client string statement name object parameter object class target type this client client this statement name statement name this parameter object parameter object this target type target type statementname parameterobject targettype enhancedlazyresultloaderimpl extendedsqlmapclient statementname parameterobject targettype statementname statementname parameterobject parameterobject targettype targettype loads the result return the results a list or object throws sql exception if there is a problem public object load result throws sql exception if dom type marker class is assignable from target type return result loader get result client statement name parameter object target type else if collection class is assignable from target type return enhancer create object class interfaces this else if target type is array class info is known type target type return result loader get result client statement name parameter object target type else return enhancer create target type this sqlexception loadresult sqlexception domtypemarker isassignablefrom targettype resultloader getresult statementname parameterobject targettype isassignablefrom targettype targettype isarray classinfo isknowntype targettype resultloader getresult statementname parameterobject targettype targettype public object invoke object o method method object objects throws throwable if finalize hash code method get name hash code finalize equals method get name return null else load object if result object null try return method invoke result object objects catch throwable t throw class info unwrap throwable t else return null hashcode getname hashcode getname loadobject resultobject resultobject classinfo unwrapthrowable private synchronized void load object if loaded try loaded true result object result loader get result client statement name parameter object target type catch sql exception e throw new runtime exception error lazy loading result cause e e loadobject resultobject resultloader getresult statementname parameterobject targettype sqlexception runtimeexception configures the cache param props optionally can contain properties reference type weak soft strong public void configure properties props string ref type props get property reference type if ref type null ref type props get property reference type if ref type null cache level memory cache level get by reference type ref type reftype getproperty reftype reftype getproperty referencetype reftype cachelevel memorycachelevel getbyreferencetype reftype add an object to the cache param cache model the cache model param key the key of the object to be cached param value the object to be cached public void put object cache model cache model object key object value object reference null if cache level equals memory cache level weak reference new weak reference value else if cache level equals memory cache level soft reference new soft reference value else if cache level equals memory cache level strong reference new strong reference value cache put key reference cachemodel cachemodel putobject cachemodel cachemodel cachelevel memorycachelevel weakreference cachelevel memorycachelevel softreference cachelevel memorycachelevel strongreference get an object out of the cache param cache model the cache model param key the key of the object to be returned return the cached object or null public object get object cache model cache model object key object value null object ref cache get key if ref null if ref instanceof strong reference value strong reference ref get else if ref instanceof soft reference value soft reference ref get else if ref instanceof weak reference value weak reference ref get return value cachemodel getobject cachemodel cachemodel strongreference strongreference softreference softreference weakreference weakreference public object remove object cache model cache model object key object value null object ref cache remove key if ref null if ref instanceof strong reference value strong reference ref get else if ref instanceof soft reference value soft reference ref get else if ref instanceof weak reference value weak reference ref get return value removeobject cachemodel cachemodel strongreference strongreference softreference softreference weakreference weakreference flushes the cache param cache model the cache model public void flush cache model cache model cache clear cachemodel cachemodel cachemodel strong reference constructor for an object param object the object to store public strong reference object object this object object strongreference strongreference getter to get the object stored in the strong reference return the stored object public object get return object strongreference private static final string start index public abstract boolean is condition sql tag context ctx sql tag tag object parameter object start_index iscondition sqltagcontext sqltag parameterobject public int do start fragment sql tag context ctx sql tag tag object parameter object ctx push remove first prepend marker tag if is condition ctx tag parameter object return sql tag handler include body else return sql tag handler skip body dostartfragment sqltagcontext sqltag parameterobject pushremovefirstprependmarker iscondition parameterobject sqltaghandler include_body sqltaghandler skip_body public int do end fragment sql tag context ctx sql tag tag object parameter object string buffer body content iterate context iterate ctx peek iterate context if null iterate iterate is allow next iterate next iterate set allow next false if iterate has next iterate set final true iterate property replace body content ctx peek iterate context return super do end fragment ctx tag parameter object body content doendfragment sqltagcontext sqltag parameterobject stringbuffer bodycontent iteratecontext peekiteratecontext isallownext setallownext hasnext setfinal iteratepropertyreplace bodycontent peekiteratecontext doendfragment parameterobject bodycontent protected long compare sql tag context ctx sql tag tag object parameter object string compare property name tag get compare property attr string compare value tag get compare value attr string prop get resolved property ctx tag object value1 class type if prop null value1 probe get object parameter object prop type probe get property type for getter parameter object prop else value1 parameter object if value1 null type parameter object get class else type object class if compare property name null object value2 probe get object parameter object compare property name return compare values type value1 value2 else if compare value null return compare values type value1 compare value else throw new runtime exception error comparing in conditional fragment uknown compare to values sqltagcontext sqltag parameterobject comparepropertyname getcomparepropertyattr comparevalue getcomparevalueattr getresolvedproperty getobject parameterobject getpropertytypeforgetter parameterobject parameterobject parameterobject getclass comparepropertyname getobject parameterobject comparepropertyname comparevalues comparevalue comparevalues comparevalue runtimeexception protected long compare values class type object value1 object value2 long result not comparable if value1 null value2 null result value1 value2 0 not comparable else if value2 get class type value2 convert value type value2 to string if value2 instanceof string type string class value1 value1 to string if value1 instanceof comparable value2 instanceof comparable value1 value1 to string value2 value2 to string result comparable value1 compare to value2 return result comparevalues not_comparable not_comparable getclass convertvalue tostring tostring tostring tostring compareto protected object convert value class type string value if type string class return value else if type byte class type byte class return byte value of value else if type short class type short class return short value of value else if type character class type char class return new character value char at 0 else if type integer class type int class return integer value of value else if type long class type long class return long value of value else if type float class type float class return float value of value else if type double class type double class return double value of value else if type boolean class type boolean class return boolean value of value else if type date class return simple date formatter format date mask value else if type big integer class return new big integer value else if type big decimal class return new big decimal value else return value convertvalue valueof valueof charat valueof valueof valueof valueof valueof simpledateformatter date_mask biginteger biginteger bigdecimal bigdecimal this method will add the proper index values to an indexed property string if we are inside an iterate tag param ctx param tag protected string get resolved property sql tag context ctx sql tag tag string prop tag get property attr iterate context it ctx ctx peek iterate context if prop null if null it ctx it ctx is allow next it ctx next it ctx set allow next false if it ctx has next it ctx set final true if prop index of start index 1 if it ctx null prop it ctx add index to tag property prop return prop getresolvedproperty sqltagcontext sqltag getpropertyattr iteratecontext itctx peekiteratecontext itctx itctx isallownext itctx itctx setallownext itctx hasnext itctx setfinal indexof start_index itctx itctx addindextotagproperty private user transaction user transaction public data source get data source return data source usertransaction usertransaction datasource getdatasource datasource public void set data source data source ds this data source ds setdatasource datasource datasource public void initialize properties props throws sql exception transaction exception string utx name null try utx name string props get user transaction initial context init ctx new initial context user transaction user transaction init ctx lookup utx name catch naming exception e throw new sql map exception error initializing jta transaction config while looking up user transaction utx name cause e sqlexception transactionexception utxname utxname usertransaction initialcontext initctx initialcontext usertransaction usertransaction initctx utxname namingexception sqlmapexception jtatransactionconfig usertransaction utxname public transaction new transaction int transaction isolation throws sql exception transaction exception return new jta transaction user transaction data source transaction isolation newtransaction transactionisolation sqlexception transactionexception jtatransaction usertransaction datasource transactionisolation private static final general cache administrator cache new general cache administrator public void flush cache model cache model cache flush group cache model get id generalcacheadministrator generalcacheadministrator cachemodel cachemodel flushgroup cachemodel getid public object get object cache model cache model object key string key string key to string try int refresh period int cache model get flush interval seconds return cache get from cache key string refresh period catch needs refresh exception e cache cancel update key string return null getobject cachemodel cachemodel keystring tostring refreshperiod cachemodel getflushintervalseconds getfromcache keystring refreshperiod needsrefreshexception cancelupdate keystring public object remove object cache model cache model object key object result string key string key to string try int refresh period int cache model get flush interval seconds object value cache get from cache key string refresh period if value null cache flush entry key string result value catch needs refresh exception e try cache flush entry key string finally cache cancel update key string result null return result removeobject cachemodel cachemodel keystring tostring refreshperiod cachemodel getflushintervalseconds getfromcache keystring refreshperiod flushentry keystring needsrefreshexception flushentry keystring cancelupdate keystring public void put object cache model cache model object key object object string key string key to string cache put in cache key string object new string cache model get id putobject cachemodel cachemodel keystring tostring putincache keystring cachemodel getid public void configure properties props public class double type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set double i double parameter double value doubletypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setdouble doublevalue public object get result result set rs string column name throws sql exception double d rs get double column name if rs was null return null else return new double d getresult resultset columnname sqlexception getdouble columnname wasnull public object get result result set rs int column index throws sql exception double d rs get double column index if rs was null return null else return new double d getresult resultset columnindex sqlexception getdouble columnindex wasnull public object get result callable statement cs int column index throws sql exception double d cs get double column index if cs was null return null else return new double d getresult callablestatement columnindex sqlexception getdouble columnindex wasnull public object value of string s return double value of s valueof valueof public class is not empty tag handler extends is empty tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object return super is condition ctx tag parameter object isnotemptytaghandler isemptytaghandler iscondition sqltagcontext sqltag parameterobject iscondition parameterobject public jdbc transaction data source ds int isolation level throws transaction exception check parameters data source ds if data source null throw new transaction exception jdbc transaction initialization failed data source was null this isolation level set isolation level isolation level jdbctransaction datasource isolationlevel transactionexception datasource datasource transactionexception jdbctransaction datasource isolationlevel setisolationlevel isolationlevel private void init throws sql exception transaction exception open jdbc transaction connection data source get connection if connection null throw new transaction exception jdbc transaction could not start transaction cause the data source returned a null connection isolation level isolation level apply isolation level connection auto commit if connection get auto commit connection set auto commit false debug if connection log is debug enabled connection connection log proxy new instance connection sqlexception transactionexception datasource getconnection transactionexception jdbctransaction datasource isolationlevel applyisolationlevel autocommit getautocommit setautocommit connectionlog isdebugenabled connectionlogproxy newinstance public void commit throws sql exception transaction exception if connection null connection commit sqlexception transactionexception public void rollback throws sql exception transaction exception if connection null connection rollback sqlexception transactionexception public void close throws sql exception transaction exception if connection null try isolation level restore isolation level connection finally connection close connection null sqlexception transactionexception isolationlevel restoreisolationlevel public connection get connection throws sql exception transaction exception if connection null init return connection getconnection sqlexception transactionexception public batch exception string message batch update exception cause list successful batch results string failing statement id string failing sql statement super message cause this batch update exception cause this successful batch results successful batch results this failing statement id failing statement id this failing sql statement failing sql statement batchexception batchupdateexception successfulbatchresults failingstatementid failingsqlstatement batchupdateexception successfulbatchresults successfulbatchresults failingstatementid failingstatementid failingsqlstatement failingsqlstatement returns the batch update exception that caused the nested batch to fail that exception contains an array of row counts that can be used to determine exactly which statemtn of the batch caused the failure or failures return the root batch update exception public batch update exception get batch update exception return batch update exception batchupdateexception batchupdateexception batchupdateexception getbatchupdateexception batchupdateexception returns a list of batch result objects there will be one entry in the list for each successful sub batch executed before the failing batch return the previously successful batch results may be an empty list if no batch has executed successfully public list get successful batch results return successful batch results batchresult getsuccessfulbatchresults successfulbatchresults returns the sql statement that caused the failure not the parameters return the failing sql string public string get failing sql statement return failing sql statement getfailingsqlstatement failingsqlstatement returns the statement id of the statement that caused the failure return the statement id public string get failing statement id return failing statement id getfailingstatementid failingstatementid private result set log proxy result set rs super this rs rs if log is debug enabled log debug rset id result set resultsetlogproxy resultset isdebugenabled resultset public object invoke object proxy method method object params throws throwable try object o method invoke rs params if get methods contains method get name if params 0 instanceof string set column params 0 o set column params 0 rs get object string params 0 else set column params 0 rs get object integer params 0 int value else if next equals method get name close equals method get name string s get value string if equals s if first first false if log is debug enabled log debug rset id header get column string if log is debug enabled log debug rset id result s clear column info return o catch throwable t throw class info unwrap throwable t get_methods getname setcolumn setcolumn getobject setcolumn getobject intvalue getname getname getvaluestring isdebugenabled getcolumnstring isdebugenabled clearcolumninfo classinfo unwrapthrowable creates a logging version of a result set param rs the result set to proxy return the result set with logging public static result set new instance result set rs invocation handler handler new result set log proxy rs class loader cl result set class get class loader return result set proxy new proxy instance cl new class result set class handler resultset resultset resultset resultset newinstance resultset invocationhandler resultsetlogproxy classloader resultset getclassloader resultset newproxyinstance resultset get the wrapped result set return the result set public result set get rs return rs resultset resultset getrs public void initialize map properties try initial context init ctx null hashtable context get context properties properties if context null init ctx new initial context else init ctx new initial context context if properties contains key data source data source data source init ctx lookup string properties get data source else if properties contains key db jndi context legacy backward compatibility data source data source init ctx lookup string properties get db jndi context else if properties contains key db full jndi context legacy backward compatibility data source data source init ctx lookup string properties get db full jndi context else if properties contains key db initial context properties contains key db lookup legacy backward compatibility context ctx context init ctx lookup string properties get db initial context data source data source ctx lookup string properties get db lookup catch naming exception e throw new sql map exception there was an error configuring jndi data source transaction pool cause e e initialcontext initctx getcontextproperties initctx initialcontext initctx initialcontext containskey datasource datasource datasource initctx datasource containskey dbjndicontext datasource datasource initctx dbjndicontext containskey dbfulljndicontext datasource datasource initctx dbfulljndicontext containskey dbinitialcontext containskey dblookup initctx dbinitialcontext datasource datasource dblookup namingexception sqlmapexception jndidatasourcetransactionpool public data source get data source return data source datasource getdatasource datasource private static hashtable get context properties map all props final string prefix context hashtable context properties null iterator keys all props key set iterator while keys has next string key string keys next string value string all props get key if key starts with prefix if context properties null context properties new properties context properties put key substring prefix length value return context properties getcontextproperties allprops contextproperties allprops keyset hasnext allprops startswith contextproperties contextproperties contextproperties contextproperties private static final object no arguments new object 0 protected complex bean probe no_arguments complexbeanprobe returns an array of the readable properties exposed by a bean param object the bean return the properties public string get readable property names object object return class info get instance object get class get readable property names getreadablepropertynames classinfo getinstance getclass getreadablepropertynames returns an array of the writeable properties exposed by a bean param object the bean return the properties public string get writeable property names object object return class info get instance object get class get writeable property names getwriteablepropertynames classinfo getinstance getclass getwriteablepropertynames returns the class that the setter expects to receive as a parameter when setting a property value param object the bean to check param name the name of the property return the type of the property public class get property type for setter object object string name class type object get class if object instanceof class type get class property type for setter class object name else if object instanceof map map map map object object value map get name if value null type object class else type value get class else if name index of 1 string tokenizer parser new string tokenizer name while parser has more tokens name parser next token type class info get instance type get setter type name else type class info get instance type get setter type name return type getpropertytypeforsetter getclass getclasspropertytypeforsetter getclass indexof stringtokenizer stringtokenizer hasmoretokens nexttoken classinfo getinstance getsettertype classinfo getinstance getsettertype returns the class that the getter will return when reading a property value param object the bean to check param name the name of the property return the type of the property public class get property type for getter object object string name class type object get class if object instanceof class type get class property type for getter class object name else if object instanceof map map map map object object value map get name if value null type object class else type value get class else if name index of 1 string tokenizer parser new string tokenizer name while parser has more tokens name parser next token type class info get instance type get getter type name else type class info get instance type get getter type name return type getpropertytypeforgetter getclass getclasspropertytypeforgetter getclass indexof stringtokenizer stringtokenizer hasmoretokens nexttoken classinfo getinstance getgettertype classinfo getinstance getgettertype returns the class that the getter will return when reading a property value param type the class to check param name the name of the property return the type of the property private class get class property type for getter class type string name if name index of 1 string tokenizer parser new string tokenizer name while parser has more tokens name parser next token type class info get instance type get getter type name else type class info get instance type get getter type name return type getclasspropertytypeforgetter indexof stringtokenizer stringtokenizer hasmoretokens nexttoken classinfo getinstance getgettertype classinfo getinstance getgettertype returns the class that the setter expects to receive as a parameter when setting a property value param type the class to check param name the name of the property return the type of the property private class get class property type for setter class type string name if name index of 1 string tokenizer parser new string tokenizer name while parser has more tokens name parser next token type class info get instance type get setter type name else type class info get instance type get setter type name return type getclasspropertytypeforsetter indexof stringtokenizer stringtokenizer hasmoretokens nexttoken classinfo getinstance getsettertype classinfo getinstance getsettertype gets an object property from a bean param object the bean param name the property name return the property value as an object public object get object object object string name if name index of 1 string tokenizer parser new string tokenizer name object value object while parser has more tokens value get property value parser next token if value null break return value else return get property object name getobject indexof stringtokenizer stringtokenizer hasmoretokens getproperty nexttoken getproperty sets the value of a bean property to an object param object the bean to change param name the name of the property to set param value the new value to set public void set object object object string name object value if name index of 1 string tokenizer parser new string tokenizer name string property parser next token object child object while parser has more tokens class type get property type for setter child property object parent child child get property parent property if child null if value null return don t instantiate child path if value is null else try child result object factory util create object through factory type set object parent property child catch exception e throw new probe exception cannot set value of property name because property is null and cannot be instantiated on instance of type get name cause e to string e property parser next token set property child property value else set property object name value setobject indexof stringtokenizer stringtokenizer nexttoken hasmoretokens getpropertytypeforsetter getproperty resultobjectfactoryutil createobjectthroughfactory setobject probeexception getname tostring nexttoken setproperty setproperty checks to see if a bean has a writable property be a given name param object the bean to check param property name the property to check for return true if the property exists and is writable public boolean has writable property object object string property name boolean has property false if object instanceof map has property true map object contains key property name else if property name index of 1 string tokenizer parser new string tokenizer property name class type object get class while parser has more tokens property name parser next token type class info get instance type get getter type property name has property class info get instance type has writable property property name else has property class info get instance object get class has writable property property name return has property propertyname haswritableproperty propertyname hasproperty hasproperty containskey propertyname propertyname indexof stringtokenizer stringtokenizer propertyname getclass hasmoretokens propertyname nexttoken classinfo getinstance getgettertype propertyname hasproperty classinfo getinstance haswritableproperty propertyname hasproperty classinfo getinstance getclass haswritableproperty propertyname hasproperty checks to see if a bean has a readable property be a given name param object the bean to check param property name the property to check for return true if the property exists and is readable public boolean has readable property object object string property name boolean has property false if object instanceof map has property true map object contains key property name else if property name index of 1 string tokenizer parser new string tokenizer property name class type object get class while parser has more tokens property name parser next token type class info get instance type get getter type property name has property class info get instance type has readable property property name else has property class info get instance object get class has readable property property name return has property propertyname hasreadableproperty propertyname hasproperty hasproperty containskey propertyname propertyname indexof stringtokenizer stringtokenizer propertyname getclass hasmoretokens propertyname nexttoken classinfo getinstance getgettertype propertyname hasproperty classinfo getinstance hasreadableproperty propertyname hasproperty classinfo getinstance getclass hasreadableproperty propertyname hasproperty protected object get property object object string name class info class cache class info get instance object get class try object value null if name index of 1 value get indexed property object name else if object instanceof map value map object get name else method method class cache get getter name if method null throw new no such method exception no get method for property name on instance of object get class get name try value method invoke object no arguments catch throwable t throw class info unwrap throwable t return value catch probe exception e throw e catch throwable t if object null throw new probe exception could not get property name from null reference cause t to string t else throw new probe exception could not get property name from object get class get name cause t to string t getproperty classinfo classcache classinfo getinstance getclass indexof getindexedproperty classcache getgetter nosuchmethodexception getclass getname no_arguments classinfo unwrapthrowable probeexception probeexception tostring probeexception getclass getname tostring protected void set property object object string name object value class info class cache class info get instance object get class try if name index of 1 set indexed property object name value else if object instanceof map map object put name value else method method class cache get setter name if method null throw new no such method exception no set method for property name on instance of object get class get name object params new object 1 params 0 value try method invoke object params catch throwable t throw class info unwrap throwable t catch probe exception e throw e catch throwable t if object null throw new probe exception could not set property name for null reference cause t to string t else throw new probe exception could not set property name for object get class get name cause t to string t setproperty classinfo classcache classinfo getinstance getclass indexof setindexedproperty classcache getsetter nosuchmethodexception getclass getname classinfo unwrapthrowable probeexception probeexception tostring probeexception getclass getname tostring constructor to create via a factory param factory the factory to associate this with public unknown type handler type handler factory factory this factory factory unknowntypehandler typehandlerfactory public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception class search class parameter get class if using java pre5 try search class get base class search class catch exception ex search class null if search class null search class parameter get class type handler handler factory get type handler search class jdbc type handler set parameter ps i parameter jdbc type setparameter preparedstatement jdbctype sqlexception searchclass getclass usingjavapre5 searchclass getbaseclass searchclass searchclass searchclass searchclass getclass typehandler gettypehandler searchclass jdbctype setparameter jdbctype public object get result result set rs string column name throws sql exception object object rs get object column name if rs was null return null else return object getresult resultset columnname sqlexception getobject columnname wasnull public object get result result set rs int column index throws sql exception object object rs get object column index if rs was null return null else return object getresult resultset columnindex sqlexception getobject columnindex wasnull public object get result callable statement cs int column index throws sql exception object object cs get object column index if cs was null return null else return object getresult callablestatement columnindex sqlexception getobject columnindex wasnull public object value of string s return s valueof public boolean equals object object string string if object null string null return object string else type handler handler factory get type handler object get class object casted object handler value of string return object equals casted object typehandler gettypehandler getclass castedobject valueof castedobject get the base class of class param for top level classes this returns null for enums inner and anonymous classes it returns the enclosing class the intent is to use this for enum support in java 5 param class param class to get enclosing class of return enclosing class throws no such method exception when run in pre java 5 private static class get base class class class param throws no such method exception string method name get enclosing class method method null class result null try method class param get class get method method name class null result class method invoke class param object null catch exception ex throw new no such method exception ex get message return result classparam classparam nosuchmethodexception getbaseclass classparam nosuchmethodexception methodname getenclosingclass classparam getclass getmethod methodname classparam nosuchmethodexception getmessage private logger log public log4j impl class clazz log logger get logger clazz log4jimpl getlogger public boolean is debug enabled return log is debug enabled isdebugenabled isdebugenabled public void error string s throwable e log error s e public void error string s log error s public void debug string s log debug s public void warn string s log warn s public class integer type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set int i integer parameter int value integertypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setint intvalue public object get result result set rs string column name throws sql exception int i rs get int column name if rs was null return null else return new integer i getresult resultset columnname sqlexception getint columnname wasnull public object get result result set rs int column index throws sql exception int i rs get int column index if rs was null return null else return new integer i getresult resultset columnindex sqlexception getint columnindex wasnull public object get result callable statement cs int column index throws sql exception int i cs get int column index if cs was null return null else return new integer i getresult callablestatement columnindex sqlexception getint columnindex wasnull public object value of string s return integer value of s valueof valueof constructor to supply a delegate param delegate the delegate public sql map client impl sql map executor delegate delegate this delegate delegate sqlmapclientimpl sqlmapexecutordelegate public object insert string id object param throws sql exception return get local sql map session insert id param sqlexception getlocalsqlmapsession public object insert string id throws sql exception return get local sql map session insert id sqlexception getlocalsqlmapsession public int update string id object param throws sql exception return get local sql map session update id param sqlexception getlocalsqlmapsession public int update string id throws sql exception return get local sql map session update id sqlexception getlocalsqlmapsession public int delete string id object param throws sql exception return get local sql map session delete id param sqlexception getlocalsqlmapsession public int delete string id throws sql exception return get local sql map session delete id sqlexception getlocalsqlmapsession public object query for object string id object param object throws sql exception return get local sql map session query for object id param object queryforobject paramobject sqlexception getlocalsqlmapsession queryforobject paramobject public object query for object string id throws sql exception return get local sql map session query for object id queryforobject sqlexception getlocalsqlmapsession queryforobject public object query for object string id object param object object result object throws sql exception return get local sql map session query for object id param object result object queryforobject paramobject resultobject sqlexception getlocalsqlmapsession queryforobject paramobject resultobject public list query for list string id object param object throws sql exception return get local sql map session query for list id param object queryforlist paramobject sqlexception getlocalsqlmapsession queryforlist paramobject public list query for list string id throws sql exception return get local sql map session query for list id queryforlist sqlexception getlocalsqlmapsession queryforlist public list query for list string id object param object int skip int max throws sql exception return get local sql map session query for list id param object skip max queryforlist paramobject sqlexception getlocalsqlmapsession queryforlist paramobject public list query for list string id int skip int max throws sql exception return get local sql map session query for list id skip max queryforlist sqlexception getlocalsqlmapsession queryforlist deprecated all paginated list features have been deprecated public paginated list query for paginated list string id object param object int page size throws sql exception return get local sql map session query for paginated list id param object page size paginatedlist queryforpaginatedlist paramobject pagesize sqlexception getlocalsqlmapsession queryforpaginatedlist paramobject pagesize deprecated all paginated list features have been deprecated public paginated list query for paginated list string id int page size throws sql exception return get local sql map session query for paginated list id page size paginatedlist queryforpaginatedlist pagesize sqlexception getlocalsqlmapsession queryforpaginatedlist pagesize public map query for map string id object param object string key prop throws sql exception return get local sql map session query for map id param object key prop queryformap paramobject keyprop sqlexception getlocalsqlmapsession queryformap paramobject keyprop public map query for map string id object param object string key prop string value prop throws sql exception return get local sql map session query for map id param object key prop value prop queryformap paramobject keyprop valueprop sqlexception getlocalsqlmapsession queryformap paramobject keyprop valueprop public void query with row handler string id object param object row handler row handler throws sql exception get local sql map session query with row handler id param object row handler querywithrowhandler paramobject rowhandler rowhandler sqlexception getlocalsqlmapsession querywithrowhandler paramobject rowhandler public void query with row handler string id row handler row handler throws sql exception get local sql map session query with row handler id row handler querywithrowhandler rowhandler rowhandler sqlexception getlocalsqlmapsession querywithrowhandler rowhandler public void start transaction throws sql exception get local sql map session start transaction starttransaction sqlexception getlocalsqlmapsession starttransaction public void start transaction int transaction isolation throws sql exception get local sql map session start transaction transaction isolation starttransaction transactionisolation sqlexception getlocalsqlmapsession starttransaction transactionisolation public void commit transaction throws sql exception get local sql map session commit transaction committransaction sqlexception getlocalsqlmapsession committransaction public void end transaction throws sql exception try get local sql map session end transaction finally get local sql map session close endtransaction sqlexception getlocalsqlmapsession endtransaction getlocalsqlmapsession public void start batch throws sql exception get local sql map session start batch startbatch sqlexception getlocalsqlmapsession startbatch public int execute batch throws sql exception return get local sql map session execute batch executebatch sqlexception getlocalsqlmapsession executebatch public list execute batch detailed throws sql exception batch exception return get local sql map session execute batch detailed executebatchdetailed sqlexception batchexception getlocalsqlmapsession executebatchdetailed public void set user connection connection connection throws sql exception try get local sql map session set user connection connection finally if connection null get local sql map session close setuserconnection sqlexception getlocalsqlmapsession setuserconnection getlocalsqlmapsession todo deprecated return current connection throws sql exception deprecated public connection get user connection throws sql exception return get current connection sqlexception getuserconnection sqlexception getcurrentconnection public connection get current connection throws sql exception return get local sql map session get current connection getcurrentconnection sqlexception getlocalsqlmapsession getcurrentconnection public data source get data source return delegate get data source datasource getdatasource getdatasource public mapped statement get mapped statement string id return delegate get mapped statement id mappedstatement getmappedstatement getmappedstatement public boolean is lazy loading enabled return delegate is lazy loading enabled islazyloadingenabled islazyloadingenabled public boolean is enhancement enabled return delegate is enhancement enabled isenhancementenabled isenhancementenabled public sql executor get sql executor return delegate get sql executor sqlexecutor getsqlexecutor getsqlexecutor public sql map executor delegate get delegate return delegate sqlmapexecutordelegate getdelegate public sql map session open session sql map session impl sql map session new sql map session impl this sql map session open return sql map session sqlmapsession opensession sqlmapsessionimpl sqlmapsession sqlmapsessionimpl sqlmapsession sqlmapsession public sql map session open session connection conn try sql map session impl sql map session new sql map session impl this sql map session open sql map session set user connection conn return sql map session catch sql exception e throw new sql map exception error setting user provided connection cause e e sqlmapsession opensession sqlmapsessionimpl sqlmapsession sqlmapsessionimpl sqlmapsession sqlmapsession setuserconnection sqlmapsession sqlexception sqlmapexception todo deprecated deprecated use open session public sql map session get session log warn use of a deprecated api detected sql map client get session is deprecated use sql map client open session instead return open session opensession sqlmapsession getsession sqlmapclient getsession sqlmapclient opensession opensession public void flush data cache delegate flush data cache flushdatacache flushdatacache public void flush data cache string cache id delegate flush data cache cache id flushdatacache cacheid flushdatacache cacheid protected sql map session impl get local sql map session sql map session impl sql map session sql map session impl local sql map session get if sql map session null sql map session is closed sql map session new sql map session impl this local sql map session set sql map session return sql map session sqlmapsessionimpl getlocalsqlmapsession sqlmapsessionimpl sqlmapsession sqlmapsessionimpl localsqlmapsession sqlmapsession sqlmapsession isclosed sqlmapsession sqlmapsessionimpl localsqlmapsession sqlmapsession sqlmapsession public result object factory get result object factory return delegate get result object factory resultobjectfactory getresultobjectfactory getresultobjectfactory private data source data source public void initialize map map dbcp configuration dbcp new dbcp configuration map data source dbcp get data source datasource datasource dbcpconfiguration dbcpconfiguration datasource getdatasource public data source get data source return data source datasource getdatasource datasource private list list new array list public void handle row object value object list add value object arraylist handlerow valueobject valueobject public list get list return list getlist public void set list list list this list list setlist constructor from java sql sql exception see java sql sql exception param msg the message for the exception public nestedsql exception string msg super msg sqlexception sqlexception nestedsqlexception constructor from java sql sql exception see java sql sql exception param reason the reason for the exception param sql state the sql state public nestedsql exception string reason string sql state super reason sql state sqlexception sqlexception sqlstate sqlstate nestedsqlexception sqlstate sqlstate constructor from java sql sql exception see java sql sql exception param reason the reason for the exception param sql state the sql state param vendor code a vendor supplied code to go w the message public nestedsql exception string reason string sql state int vendor code super reason sql state vendor code sqlexception sqlexception sqlstate sqlstate vendorcode nestedsqlexception sqlstate vendorcode sqlstate vendorcode constructor from java sql sql exception with added nested exception param msg the message for the exception param cause the cause of the exception public nestedsql exception string msg throwable cause super msg init cause cause sqlexception nestedsqlexception initcause constructor from java sql sql exception with added nested exception see java sql sql exception param reason the reason for the exception param sql state the sql state param cause the cause of the exception public nestedsql exception string reason string sql state throwable cause super reason sql state init cause cause sqlexception sqlexception sqlstate sqlstate nestedsqlexception sqlstate sqlstate initcause constructor from java sql sql exception with added nested exception param reason the reason for the exception param sql state the sql state param vendor code a vendor supplied code to go w the message param cause the cause of the exception public nestedsql exception string reason string sql state int vendor code throwable cause super reason sql state vendor code init cause cause sqlexception sqlstate sqlstate vendorcode nestedsqlexception sqlstate vendorcode sqlstate vendorcode initcause constructor from java sql sql exception with added nested exception param cause the cause of the exception public nestedsql exception throwable cause super init cause cause sqlexception nestedsqlexception initcause private static final string param delim public sql text parse inline parameter map type handler factory type handler factory string sql statement return parse inline parameter map type handler factory sql statement null param_delim sqltext parseinlineparametermap typehandlerfactory typehandlerfactory sqlstatement parseinlineparametermap typehandlerfactory sqlstatement public sql text parse inline parameter map type handler factory type handler factory string sql statement class parameter class string new sql sql statement list mapping list new array list string tokenizer parser new string tokenizer sql statement parameter token true string buffer new sql buffer new string buffer string token null string last token null while parser has more tokens token parser next token if parameter token equals last token if parameter token equals token new sql buffer append parameter token token null else parameter mapping mapping null if token index of param delim 1 mapping old parse mapping token parameter class type handler factory else mapping new parse mapping token parameter class type handler factory mapping list add mapping new sql buffer append token parser next token if parameter token equals token throw new sql map exception unterminated inline parameter in mapped statement statement get id token null else if parameter token equals token new sql buffer append token last token token new sql new sql buffer to string parameter mapping mapping array parameter mapping mapping list to array new parameter mapping mapping list size sql text sql text new sql text sql text set text new sql sql text set parameter mappings mapping array return sql text sqltext parseinlineparametermap typehandlerfactory typehandlerfactory sqlstatement parameterclass newsql sqlstatement mappinglist arraylist stringtokenizer stringtokenizer sqlstatement parameter_token stringbuffer newsqlbuffer stringbuffer lasttoken hasmoretokens nexttoken parameter_token lasttoken parameter_token newsqlbuffer parameter_token parametermapping indexof param_delim oldparsemapping parameterclass typehandlerfactory newparsemapping parameterclass typehandlerfactory mappinglist newsqlbuffer nexttoken parameter_token sqlmapexception getid parameter_token newsqlbuffer lasttoken newsql newsqlbuffer tostring parametermapping mappingarray parametermapping mappinglist toarray parametermapping mappinglist sqltext sqltext sqltext sqltext settext newsql sqltext setparametermappings mappingarray sqltext private parameter mapping new parse mapping string token class parameter class type handler factory type handler factory basic parameter mapping mapping new basic parameter mapping property name java type string jdbc type varchar mode in null value n a handler string numeric scale 2 string tokenizer param parser new string tokenizer token false mapping set property name param parser next token while param parser has more tokens string field param parser next token if param parser has more tokens string value param parser next token if java type equals field value type handler factory resolve alias value mapping set java type name value else if jdbc type equals field mapping set jdbc type name value else if mode equals field mapping set mode value else if null value equals field mapping set null value value else if handler equals field try value type handler factory resolve alias value object impl resources class for name value new instance if impl instanceof type handler callback mapping set type handler new custom type handler type handler callback impl else if impl instanceof type handler mapping set type handler type handler impl else throw new sql map exception the class value is not a valid implementation of type handler or type handler callback catch exception e throw new sql map exception error loading class specified by handler field in token cause e e else if numeric scale equals field try integer numeric scale integer value of value if numeric scale int value 0 throw new sql map exception value specified for numeric scale must be greater than or equal to zero mapping set numeric scale numeric scale catch number format exception e throw new sql map exception value specified for numeric scale is not a valid integer else throw new sql map exception unrecognized parameter mapping field field in token else throw new sql map exception incorrect inline parameter map format missmatched name value pairs token if mapping get type handler null type handler handler if parameter class null handler type handler factory get unkown type handler else handler resolve type handler type handler factory parameter class mapping get property name mapping get java type name mapping get jdbc type name mapping set type handler handler return mapping parametermapping newparsemapping parameterclass typehandlerfactory typehandlerfactory basicparametermapping basicparametermapping propertyname javatype jdbctype nullvalue numericscale stringtokenizer paramparser stringtokenizer setpropertyname paramparser nexttoken paramparser hasmoretokens paramparser nexttoken paramparser hasmoretokens paramparser nexttoken javatype typehandlerfactory resolvealias setjavatypename jdbctype setjdbctypename setmode nullvalue setnullvalue typehandlerfactory resolvealias classforname newinstance typehandlercallback settypehandler customtypehandler typehandlercallback typehandler settypehandler typehandler sqlmapexception typehandler typehandlercallback sqlmapexception numericscale numericscale valueof numericscale intvalue sqlmapexception numericscale setnumericscale numericscale numberformatexception sqlmapexception numericscale sqlmapexception sqlmapexception gettypehandler typehandler parameterclass typehandlerfactory getunkowntypehandler resolvetypehandler typehandlerfactory parameterclass getpropertyname getjavatypename getjdbctypename settypehandler private parameter mapping old parse mapping string token class parameter class type handler factory type handler factory basic parameter mapping mapping new basic parameter mapping if token index of param delim 1 string tokenizer param parser new string tokenizer token param delim true int n1 param parser count tokens if n1 3 string name param parser next token param parser next token ignore string type param parser next token mapping set property name name mapping set jdbc type name type type handler handler if parameter class null handler type handler factory get unkown type handler else handler resolve type handler type handler factory parameter class name null type mapping set type handler handler return mapping else if n1 5 string name param parser next token param parser next token ignore string type param parser next token param parser next token ignore string null value param parser next token while param parser has more tokens null value null value param parser next token mapping set property name name mapping set jdbc type name type mapping set null value null value type handler handler if parameter class null handler type handler factory get unkown type handler else handler resolve type handler type handler factory parameter class name null type mapping set type handler handler return mapping else throw new sql map exception incorrect inline parameter map format token else mapping set property name token type handler handler if parameter class null handler type handler factory get unkown type handler else handler resolve type handler type handler factory parameter class token null null mapping set type handler handler return mapping parametermapping oldparsemapping parameterclass typehandlerfactory typehandlerfactory basicparametermapping basicparametermapping indexof param_delim stringtokenizer paramparser stringtokenizer param_delim paramparser counttokens paramparser nexttoken paramparser nexttoken paramparser nexttoken setpropertyname setjdbctypename typehandler parameterclass typehandlerfactory getunkowntypehandler resolvetypehandler typehandlerfactory parameterclass settypehandler paramparser nexttoken paramparser nexttoken paramparser nexttoken paramparser nexttoken nullvalue paramparser nexttoken paramparser hasmoretokens nullvalue nullvalue paramparser nexttoken setpropertyname setjdbctypename setnullvalue nullvalue typehandler parameterclass typehandlerfactory getunkowntypehandler resolvetypehandler typehandlerfactory parameterclass settypehandler sqlmapexception setpropertyname typehandler parameterclass typehandlerfactory getunkowntypehandler resolvetypehandler typehandlerfactory parameterclass settypehandler private type handler resolve type handler type handler factory type handler factory class clazz string property name string java type string jdbc type type handler handler null if clazz null unknown handler type handler factory get unkown type handler else if dom type marker class is assignable from clazz dom handler type handler factory get type handler string class jdbc type else if java util map class is assignable from clazz map if java type null handler type handler factory get unkown type handler bug 1012591 type handler factory get type handler java lang object class jdbc type else try java type type handler factory resolve alias java type class java class resources class for name java type handler type handler factory get type handler java class jdbc type catch exception e throw new sql map exception error could not set type handler cause e e else if type handler factory get type handler clazz jdbc type null primitive handler type handler factory get type handler clazz jdbc type else java bean if java type null class type probe get property type for getter clazz property name handler type handler factory get type handler type jdbc type else try java type type handler factory resolve alias java type class java class resources class for name java type handler type handler factory get type handler java class jdbc type catch exception e throw new sql map exception error could not set type handler cause e e return handler typehandler resolvetypehandler typehandlerfactory typehandlerfactory propertyname javatype jdbctype typehandler typehandlerfactory getunkowntypehandler domtypemarker isassignablefrom typehandlerfactory gettypehandler jdbctype isassignablefrom javatype typehandlerfactory getunkowntypehandler typehandlerfactory gettypehandler jdbctype javatype typehandlerfactory resolvealias javatype javaclass classforname javatype typehandlerfactory gettypehandler javaclass jdbctype sqlmapexception typehandler typehandlerfactory gettypehandler jdbctype typehandlerfactory gettypehandler jdbctype javabean javatype getpropertytypeforgetter propertyname typehandlerfactory gettypehandler jdbctype javatype typehandlerfactory resolvealias javatype javaclass classforname javatype typehandlerfactory gettypehandler javaclass jdbctype sqlmapexception typehandler private static final string date format yyyy mm dd hh mm ss public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set timestamp i new java sql timestamp date parameter get time date_format setparameter preparedstatement jdbctype sqlexception settimestamp gettime public object get result result set rs string column name throws sql exception java sql timestamp sql timestamp rs get timestamp column name if rs was null return null else return new java util date sql timestamp get time getresult resultset columnname sqlexception sqltimestamp gettimestamp columnname wasnull sqltimestamp gettime public object get result result set rs int column index throws sql exception java sql timestamp sql timestamp rs get timestamp column index if rs was null return null else return new java util date sql timestamp get time getresult resultset columnindex sqlexception sqltimestamp gettimestamp columnindex wasnull sqltimestamp gettime public object get result callable statement cs int column index throws sql exception java sql timestamp sql timestamp cs get timestamp column index if cs was null return null else return new java util date sql timestamp get time getresult callablestatement columnindex sqlexception sqltimestamp gettimestamp columnindex wasnull sqltimestamp gettime public object value of string s return simple date formatter format date format s valueof simpledateformatter date_format public class list data exchange extends base data exchange implements data exchange protected list data exchange data exchange factory data exchange factory super data exchange factory listdataexchange basedataexchange dataexchange listdataexchange dataexchangefactory dataexchangefactory dataexchangefactory public void initialize map properties public object get data request scope request parameter map parameter map object parameter object parameter mapping mappings parameter map get parameter mappings object data new object mappings length for int i 0 i mappings length i string prop name mappings i get property name parse on the notation and get nested properties string property array prop name split if property array length 0 iterate list of properties to discover values object temp data parameter object for int x 0 x property array length x is property an array reference int array start index property array x index of if array start index 1 is a normal property temp data probe factory get probe get object temp data property array x else int index integer parse int property array x substring array start index 1 property array x length 1 temp data list temp data get index data i temp data else int index integer parse int prop name substring prop name index of 1 prop name length 1 data i list parameter object get index return data getdata requestscope parametermap parametermap parameterobject parametermapping parametermap getparametermappings propname getpropertyname propertyarray propname propertyarray tempdata parameterobject propertyarray arraystartindex propertyarray indexof arraystartindex tempdata probefactory getprobe getobject tempdata propertyarray parseint propertyarray arraystartindex propertyarray tempdata tempdata tempdata parseint propname propname indexof propname parameterobject public object set data request scope request result map result map object result object object values result mapping mappings result map get result mappings list data new array list for int i 0 i mappings length i string prop name mappings i get property name int index integer parse int prop name substring 1 prop name length 1 data set index values i return data setdata requestscope resultmap resultmap resultobject resultmapping resultmap getresultmappings arraylist propname getpropertyname parseint propname propname public object set data request scope request parameter map parameter map object parameter object object values parameter mapping mappings parameter map get parameter mappings list data new array list for int i 0 i mappings length i if mappings i is output allowed string prop name mappings i get property name int index integer parse int prop name substring 1 prop name length 1 data set index values i return data setdata requestscope parametermap parametermap parameterobject parametermapping parametermap getparametermappings arraylist isoutputallowed propname getpropertyname parseint propname propname private string sql private prepared statement log proxy prepared statement stmt string sql this statement stmt this sql sql preparedstatementlogproxy preparedstatement public object invoke object proxy method method object params throws throwable try if execute methods contains method get name if log is debug enabled log debug pstm id executing statement remove breaking whitespace sql log debug pstm id parameters get value string log debug pstm id types get type string clear column info if execute query equals method get name result set rs result set method invoke statement params if rs null return result set log proxy new instance rs else return null else return method invoke statement params else if set methods contains method get name if set null equals method get name set column params 0 null else set column params 0 params 1 return method invoke statement params else if get result set equals method get name result set rs result set method invoke statement params if rs null return result set log proxy new instance rs else return null else if equals equals method get name object ps params 0 if ps instanceof proxy return new boolean proxy ps return new boolean false else if hash code equals method get name return new integer proxy hash code else return method invoke statement params catch throwable t throw class info unwrap throwable t execute_methods getname isdebugenabled removebreakingwhitespace getvaluestring gettypestring clearcolumninfo executequery getname resultset resultset resultsetlogproxy newinstance set_methods getname setnull getname setcolumn setcolumn getresultset getname resultset resultset resultsetlogproxy newinstance getname hashcode getname hashcode classinfo unwrapthrowable creates a logging version of a prepared statement param stmt the statement param sql the sql statement return the proxy public static prepared statement new instance prepared statement stmt string sql invocation handler handler new prepared statement log proxy stmt sql class loader cl prepared statement class get class loader return prepared statement proxy new proxy instance cl new class prepared statement class callable statement class handler preparedstatement preparedstatement newinstance preparedstatement invocationhandler preparedstatementlogproxy classloader preparedstatement getclassloader preparedstatement newproxyinstance preparedstatement callablestatement public user provided transaction connection connection if connection log is debug enabled this connection connection log proxy new instance connection else this connection connection userprovidedtransaction connectionlog isdebugenabled connectionlogproxy newinstance public void commit throws sql exception transaction exception connection commit sqlexception transactionexception public void rollback throws sql exception transaction exception connection rollback sqlexception transactionexception public void close throws sql exception transaction exception connection close sqlexception transactionexception public connection get connection throws sql exception transaction exception return connection getconnection sqlexception transactionexception private boolean post parse required false public string get name return name postparserequired getname public void set name string name this name name setname public sql tag handler get handler return handler sqltaghandler gethandler public void set handler sql tag handler handler this handler handler sethandler sqltaghandler public boolean is prepend available return prepend attr null prepend attr length 0 isprependavailable prependattr prependattr public boolean is close available return close attr null close attr length 0 iscloseavailable closeattr closeattr public boolean is open available return open attr null open attr length 0 isopenavailable openattr openattr public boolean is conjunction available return conjunction attr null conjunction attr length 0 isconjunctionavailable conjunctionattr conjunctionattr public string get prepend attr return prepend attr getprependattr prependattr public void set prepend attr string prepend attr this prepend attr prepend attr setprependattr prependattr prependattr prependattr public string get property attr return property attr getpropertyattr propertyattr public void set property attr string property attr this property attr property attr setpropertyattr propertyattr propertyattr propertyattr public string get compare property attr return compare property attr getcomparepropertyattr comparepropertyattr public void set compare property attr string compare property attr this compare property attr compare property attr setcomparepropertyattr comparepropertyattr comparepropertyattr comparepropertyattr public string get compare value attr return compare value attr getcomparevalueattr comparevalueattr public void set compare value attr string compare value attr this compare value attr compare value attr setcomparevalueattr comparevalueattr comparevalueattr comparevalueattr public string get open attr return open attr getopenattr openattr public void set open attr string open attr this open attr open attr setopenattr openattr openattr openattr public string get close attr return close attr getcloseattr closeattr public void set close attr string close attr this close attr close attr setcloseattr closeattr closeattr closeattr public string get conjunction attr return conjunction attr getconjunctionattr conjunctionattr public void set conjunction attr string conjunction attr this conjunction attr conjunction attr setconjunctionattr conjunctionattr conjunctionattr conjunctionattr public void add child sql child child if child instanceof sql tag sql tag child parent this children add child addchild sqlchild sqltag sqltag public iterator get children return children iterator getchildren public sql tag get parent return parent sqltag getparent public string get remove first prepend return remove first prepend getremovefirstprepend removefirstprepend public void set remove first prepend string remove first prepend this remove first prepend remove first prepend setremovefirstprepend removefirstprepend removefirstprepend removefirstprepend return returns the post parse required public boolean is post parse required return post parse required postparserequired ispostparserequired postparserequired param iterate ancestor the post parse required to set public void set post parse required boolean iterate ancestor this post parse required iterate ancestor iterateancestor postparserequired setpostparserequired iterateancestor postparserequired iterateancestor get an iterator of the tasks return the iterator public iterator get task names return task map key set iterator gettasknames taskmap keyset get the number of times assigned to a task param task name the name of the task return the number of times public long get task count string task name return task stat task map get task name get count taskname gettaskcount taskname taskstat taskmap taskname getcount get the total time added to a task param task name the name of the task return the total time added to the task public long get total task time string task name return task stat task map get task name get total taskname gettotaltasktime taskname taskstat taskmap taskname gettotal get the maximum time added to a task param task name the name of the task return the maximum time added to a task public long get max task time string task name return task stat task map get task name get max taskname getmaxtasktime taskname taskstat taskmap taskname getmax get the minimum time added to a task param task name the name of the task return the minimum time added to a task public long get min task time string task name return task stat task map get task name get min taskname getmintasktime taskname taskstat taskmap taskname getmin get the average time added to a task param task name the name of the task return the average time added to a task public long get avg task time string task name return task stat task map get task name get average taskname getavgtasktime taskname taskstat taskmap taskname getaverage start create a task param task name the name of the task public void start string task name if log is debug enabled log debug starting task name this current task name task name current task time system current time millis taskname taskname isdebugenabled taskname currenttaskname taskname currenttasktime currenttimemillis stop the timer on a task public void stop if log is debug enabled log debug stopping current task name current task time system current time millis current task time append task time current task name current task time isdebugenabled currenttaskname currenttasktime currenttimemillis currenttasktime appendtasktime currenttaskname currenttasktime private synchronized void append task time string task name long task time task stat stat task stat task map get task name if stat null stat new task stat task map put task name stat stat append task time task time appendtasktime taskname tasktime taskstat taskstat taskmap taskname taskstat taskmap taskname appendtasktime tasktime merge another stop watch into this one param watch the stop watch to merge into this one public void merge stopwatch stopwatch watch iterator names watch get task names while names has next string name string names next long task time watch get total task time name append task time name task time stopwatch stopwatch mergestopwatch gettasknames hasnext tasktime gettotaltasktime appendtasktime tasktime reset all of the timers in this stop watch public synchronized void reset task map clear stopwatch taskmap public string to string string buffer buffer new string buffer buffer append task count total max min avg n iterator names get task names while names has next string name string names next long task count get task count name long task time get total task time name long task min get min task time name long task max get max task time name long task avg get avg task time name buffer append name task count task time task max task min task avg n return buffer to string tostring stringbuffer stringbuffer gettasknames hasnext taskcount gettaskcount tasktime gettotaltasktime taskmin getmintasktime taskmax getmaxtasktime taskavg getavgtasktime taskcount tasktime taskmax taskmin taskavg tostring add some time to a task param task time the time to add public void append task time long task time count total task time if max unset task time max max task time if min unset task time min min task time tasktime appendtasktime tasktime tasktime tasktime tasktime tasktime tasktime get the total time for the task return the total time public long get total return total gettotal get the maximum of the times added to the task return the max value public long get max return max getmax get the minimum of the times added to the task return the minimum value public long get min return min getmin get the number of times added to the task return the number of times public long get count return count getcount get the average of the times added to the task return the average public long get average if count 0 return math round double total double count else return 0 getaverage private connection log proxy connection conn super this connection conn if log is debug enabled log debug conn id connection connectionlogproxy isdebugenabled public object invoke object proxy method method object params throws throwable try if prepare statement equals method get name if log is debug enabled log debug conn id preparing statement remove breaking whitespace string params 0 prepared statement stmt prepared statement method invoke connection params stmt prepared statement log proxy new instance stmt string params 0 return stmt else if prepare call equals method get name if log is debug enabled log debug conn id preparing call remove breaking whitespace string params 0 prepared statement stmt prepared statement method invoke connection params stmt prepared statement log proxy new instance stmt string params 0 return stmt else if create statement equals method get name statement stmt statement method invoke connection params stmt statement log proxy new instance stmt return stmt else return method invoke connection params catch throwable t throwable t1 class info unwrap throwable t log error error calling connection method get name t1 throw t1 preparestatement getname isdebugenabled removebreakingwhitespace preparedstatement preparedstatement preparedstatementlogproxy newinstance preparecall getname isdebugenabled removebreakingwhitespace preparedstatement preparedstatement preparedstatementlogproxy newinstance createstatement getname statementlogproxy newinstance classinfo unwrapthrowable getname creates a logging version of a connection param conn the original connection return the connection with logging public static connection new instance connection conn invocation handler handler new connection log proxy conn class loader cl connection class get class loader return connection proxy new proxy instance cl new class connection class handler newinstance invocationhandler connectionlogproxy classloader getclassloader newproxyinstance private log log public jakarta commons logging impl class clazz log log factory get log clazz jakartacommonsloggingimpl logfactory getlog public boolean is debug enabled return log is debug enabled isdebugenabled isdebugenabled public void error string s throwable e log error s e public void error string s log error s public void debug string s log debug s public void warn string s log warn s private static void try implementation string test class name string impl class name if log constructor null try resources class for name test class name class impl class resources class for name impl class name log constructor impl class get constructor new class class class catch throwable t tryimplementation testclassname implclassname logconstructor classforname testclassname implclass classforname implclassname logconstructor implclass getconstructor public static log get log class a class try return log log constructor new instance new object a class catch throwable t throw new runtime exception error creating logger for class a class cause t t getlog aclass logconstructor newinstance aclass runtimeexception aclass this method will switch the logging implementation to log4j if log4j is available on the classpath this is useful in situations where you want to use log4j to log ibatis activity but commons logging is on the classpath note that this method is only effective for log classes obtained after calling this method if you intend to use this method you should call it before calling any other ibatis method public static synchronized void select log4j logging try resources class for name org apache log4j logger class impl class resources class for name com ibatis common logging log4j log4j impl log constructor impl class get constructor new class class class catch throwable t selectlog4jlogging classforname implclass classforname log4jimpl logconstructor implclass getconstructor this method will switch the logging implementation to java native logging if you are running in jre 1 4 or above this is useful in situations where you want to use java native logging to log ibatis activity but commons logging or log4j is on the classpath note that this method is only effective for log classes obtained after calling this method if you intend to use this method you should call it before calling any other ibatis method public static synchronized void select java logging try resources class for name java util logging logger class impl class resources class for name com ibatis common logging jdk14 jdk14 logging impl log constructor impl class get constructor new class class class catch throwable t selectjavalogging classforname implclass classforname jdk14loggingimpl logconstructor implclass getconstructor private static final string date format yyyy mm dd hh mm ss public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set timestamp i java sql timestamp parameter date_format setparameter preparedstatement jdbctype sqlexception settimestamp public object get result result set rs string column name throws sql exception object sql timestamp rs get timestamp column name if rs was null return null else return sql timestamp getresult resultset columnname sqlexception sqltimestamp gettimestamp columnname wasnull sqltimestamp public object get result result set rs int column index throws sql exception object sql timestamp rs get timestamp column index if rs was null return null else return sql timestamp getresult resultset columnindex sqlexception sqltimestamp gettimestamp columnindex wasnull sqltimestamp public object get result callable statement cs int column index throws sql exception object sql timestamp cs get timestamp column index if cs was null return null else return sql timestamp getresult callablestatement columnindex sqlexception sqltimestamp gettimestamp columnindex wasnull sqltimestamp public object value of string s return simple date formatter format date format s valueof simpledateformatter date_format private static final string date format yyyy mm dd public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set date i new java sql date date parameter get time date_format setparameter preparedstatement jdbctype sqlexception setdate gettime public object get result result set rs string column name throws sql exception java sql date sql date rs get date column name if rs was null return null else return new java util date sql date get time getresult resultset columnname sqlexception sqldate getdate columnname wasnull sqldate gettime public object get result result set rs int column index throws sql exception java sql date sql date rs get date column index if rs was null return null else return new java util date sql date get time getresult resultset columnindex sqlexception sqldate getdate columnindex wasnull sqldate gettime public object get result callable statement cs int column index throws sql exception java sql date sql date cs get date column index if cs was null return null else return new java util date sql date get time getresult callablestatement columnindex sqlexception sqldate getdate columnindex wasnull sqldate gettime public object value of string s return simple date formatter format date format s valueof simpledateformatter date_format public class update statement extends general statement public statement type get statement type return statement type update updatestatement generalstatement statementtype getstatementtype statementtype public object execute query for object request scope request transaction trans object parameter object object result object throws sql exception throw new sql exception update statements cannot be executed as a query executequeryforobject requestscope parameterobject resultobject sqlexception sqlexception public list execute query for list request scope request transaction trans object parameter object int skip results int max results throws sql exception throw new sql exception update statements cannot be executed as a query executequeryforlist requestscope parameterobject skipresults maxresults sqlexception sqlexception public void execute query with row handler request scope request transaction trans object parameter object row handler row handler throws sql exception throw new sql exception update statements cannot be executed as a query executequerywithrowhandler requestscope parameterobject rowhandler rowhandler sqlexception sqlexception public class long type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set long i long parameter long value longtypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setlong longvalue public object get result result set rs string column name throws sql exception long l rs get long column name if rs was null return null else return new long l getresult resultset columnname sqlexception getlong columnname wasnull public object get result result set rs int column index throws sql exception long l rs get long column index if rs was null return null else return new long l getresult resultset columnindex sqlexception getlong columnindex wasnull public object get result callable statement cs int column index throws sql exception long l cs get long column index if cs was null return null else return new long l getresult callablestatement columnindex sqlexception getlong columnindex wasnull public object value of string s return long value of s valueof valueof constructor to supply a map of properties param properties the map of configuration properties public dbcp configuration map properties try data source legacy dbcp configuration properties if data source null data source new dbcp configuration properties catch exception e throw new runtime exception error initializing dbcp data source factory cause e e dbcpconfiguration datasource legacydbcpconfiguration datasource datasource newdbcpconfiguration runtimeexception dbcpdatasourcefactory getter for data source return the data source public data source get data source return data source datasource datasource datasource getdatasource datasource private basic data source new dbcp configuration map map basic data source basic data source new basic data source iterator props map key set iterator while props has next string property name string props next if property name starts with add driver props prefix string value string map get property name basic data source add connection property property name substring add driver props prefix length value else if probe has writable property basic data source property name string value string map get property name object converted value convert value basic data source property name value probe set object basic data source property name converted value return basic data source basicdatasource newdbcpconfiguration basicdatasource basicdatasource basicdatasource keyset hasnext propertyname propertyname startswith add_driver_props_prefix propertyname basicdatasource addconnectionproperty propertyname add_driver_props_prefix_length haswritableproperty basicdatasource propertyname propertyname convertedvalue convertvalue basicdatasource propertyname setobject basicdatasource propertyname convertedvalue basicdatasource private object convert value object object string property name string value object converted value value class target type probe get property type for setter object property name if target type integer class target type int class converted value integer value of value else if target type long class target type long class converted value long value of value else if target type boolean class target type boolean class converted value boolean value of value return converted value convertvalue propertyname convertedvalue targettype getpropertytypeforsetter propertyname targettype targettype convertedvalue valueof targettype targettype convertedvalue valueof targettype targettype convertedvalue valueof convertedvalue private basic data source legacy dbcp configuration map map basic data source basic data source null if map contains key jdbc driver basic data source new basic data source string driver string map get jdbc driver string url string map get jdbc connectionurl string username string map get jdbc username string password string map get jdbc password string validation query string map get pool validation query string max active string map get pool maximum active connections string max idle string map get pool maximum idle connections string max wait string map get pool maximum wait basic data source set url url basic data source set driver class name driver basic data source set username username basic data source set password password if not empty validation query basic data source set validation query validation query if not empty max active basic data source set max active integer parse int max active if not empty max idle basic data source set max idle integer parse int max idle if not empty max wait basic data source set max wait integer parse int max wait iterator props map key set iterator while props has next string property name string props next if property name starts with add driver props prefix string value string map get property name basic data source add connection property property name substring add driver props prefix length value return basic data source basicdatasource legacydbcpconfiguration basicdatasource basicdatasource containskey basicdatasource basicdatasource validationquery validationquery maxactive maximumactiveconnections maxidle maximumidleconnections maxwait maximumwait basicdatasource seturl basicdatasource setdriverclassname basicdatasource setusername basicdatasource setpassword notempty validationquery basicdatasource setvalidationquery validationquery notempty maxactive basicdatasource setmaxactive parseint maxactive notempty maxidle basicdatasource setmaxidle parseint maxidle notempty maxwait basicdatasource setmaxwait parseint maxwait keyset hasnext propertyname propertyname startswith add_driver_props_prefix propertyname basicdatasource addconnectionproperty propertyname add_driver_props_prefix_length basicdatasource private boolean not empty string s return s null s length 0 notempty public class boolean type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set boolean i boolean parameter boolean value booleantypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setboolean booleanvalue public object get result result set rs string column name throws sql exception boolean b rs get boolean column name if rs was null return null else return new boolean b getresult resultset columnname sqlexception getboolean columnname wasnull public object get result result set rs int column index throws sql exception boolean b rs get boolean column index if rs was null return null else return new boolean b getresult resultset columnindex sqlexception getboolean columnindex wasnull public object get result callable statement cs int column index throws sql exception boolean b cs get boolean column index if cs was null return null else return new boolean b getresult callablestatement columnindex sqlexception getboolean columnindex wasnull public object value of string s return boolean value of s valueof valueof public class is equal tag handler extends conditional tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object return compare ctx tag parameter object 0 isequaltaghandler conditionaltaghandler iscondition sqltagcontext sqltag parameterobject parameterobject constructor to provide a type handler callback instance param callback the type handler callback instance public custom type handler type handler callback callback this callback callback typehandlercallback typehandlercallback customtypehandler typehandlercallback public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception parameter setter setter new parameter setter impl ps i callback set parameter setter parameter setparameter preparedstatement jdbctype sqlexception parametersetter parametersetterimpl setparameter public object get result result set rs string column name throws sql exception result getter getter new result getter impl rs column name return callback get result getter getresult resultset columnname sqlexception resultgetter resultgetterimpl columnname getresult public object get result result set rs int column index throws sql exception result getter getter new result getter impl rs column index return callback get result getter getresult resultset columnindex sqlexception resultgetter resultgetterimpl columnindex getresult public object get result callable statement cs int column index throws sql exception result getter getter new result getter impl new callable statement result set cs column index return callback get result getter getresult callablestatement columnindex sqlexception resultgetter resultgetterimpl callablestatementresultset columnindex getresult public object value of string s return callback value of s valueof valueof constructor for the factory param type handler factory a type handler factory for the factory public data exchange factory type handler factory type handler factory this type handler factory type handler factory dom data exchange new dom data exchange this list data exchange new list data exchange this map data exchange new complex data exchange this primitive data exchange new primitive data exchange this complex data exchange new complex data exchange this typehandlerfactory dataexchangefactory typehandlerfactory typehandlerfactory typehandlerfactory typehandlerfactory domdataexchange domdataexchange listdataexchange listdataexchange mapdataexchange complexdataexchange primitivedataexchange primitivedataexchange complexdataexchange complexdataexchange getter for the type handler factory return the type handler factory public type handler factory get type handler factory return type handler factory typehandlerfactory gettypehandlerfactory typehandlerfactory get a data exchange object for the passed in class param clazz the class to get a data exchange object for return the data exchange object public data exchange get data exchange for class class clazz data exchange data exchange null if clazz null data exchange complex data exchange else if dom type marker class is assignable from clazz data exchange dom data exchange else if list class is assignable from clazz data exchange list data exchange else if map class is assignable from clazz data exchange map data exchange else if type handler factory get type handler clazz null data exchange primitive data exchange else data exchange new java bean data exchange this return data exchange dataexchange dataexchange dataexchange dataexchange getdataexchangeforclass dataexchange dataexchange dataexchange complexdataexchange domtypemarker isassignablefrom dataexchange domdataexchange isassignablefrom dataexchange listdataexchange isassignablefrom dataexchange mapdataexchange typehandlerfactory gettypehandler dataexchange primitivedataexchange dataexchange javabeandataexchange dataexchange constructor for a lazy list loader param client the client that is creating the lazy list param statement name the statement to be used to build the list param parameter object the parameter object to be used to build the list param target type the type we are putting data into public lazy result loader extended sql map client client string statement name object parameter object class target type this client client this statement name statement name this parameter object parameter object this target type target type statementname parameterobject targettype lazyresultloader extendedsqlmapclient statementname parameterobject targettype statementname statementname parameterobject parameterobject targettype targettype loads the result return the results a list or object throws sql exception if there is a problem public object load result throws sql exception if collection class is assignable from target type invocation handler handler new lazy result loader client statement name parameter object target type class loader cl target type get class loader return proxy new proxy instance cl list interfaces handler else return result loader get result client statement name parameter object target type sqlexception loadresult sqlexception isassignablefrom targettype invocationhandler lazyresultloader statementname parameterobject targettype classloader targettype getclassloader newproxyinstance list_interfaces resultloader getresult statementname parameterobject targettype public object invoke object o method method object objects throws throwable if finalize hash code method get name hash code finalize equals method get name return null else load object if result object null try return method invoke result object objects catch throwable t throw class info unwrap throwable t else return null hashcode getname hashcode getname loadobject resultobject resultobject classinfo unwrapthrowable private synchronized void load object if loaded try loaded true result object result loader get result client statement name parameter object target type catch sql exception e throw new runtime exception error lazy loading result cause e e loadobject resultobject resultloader getresult statementname parameterobject targettype sqlexception runtimeexception public class object type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set object i parameter objecttypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setobject public object get result result set rs string column name throws sql exception object object rs get object column name if rs was null return null else return object getresult resultset columnname sqlexception getobject columnname wasnull public object get result result set rs int column index throws sql exception object object rs get object column index if rs was null return null else return object getresult resultset columnindex sqlexception getobject columnindex wasnull public object get result callable statement cs int column index throws sql exception object object cs get object column index if cs was null return null else return object getresult callablestatement columnindex sqlexception getobject columnindex wasnull public object value of string s return s valueof constructor param client the client that will use the session public sql map session impl extended sql map client client this delegate client get delegate this session this delegate pop session this session set sql map client client this session set sql map executor client this session set sql map tx mgr client this closed false sqlmapsessionimpl extendedsqlmapclient getdelegate popsession setsqlmapclient setsqlmapexecutor setsqlmaptxmgr start the session public void open session set sql map tx mgr this setsqlmaptxmgr getter to tell if the session is still open return the status of the session public boolean is closed return closed isclosed public void close if delegate null session null delegate push session session if session null session null if delegate null delegate null if closed closed true pushsession public object insert string id object param throws sql exception return delegate insert session id param sqlexception public object insert string id throws sql exception return insert id null sqlexception public int update string id object param throws sql exception return delegate update session id param sqlexception public int update string id throws sql exception return update id null sqlexception public int delete string id object param throws sql exception return delegate delete session id param sqlexception public int delete string id throws sql exception return delete id null sqlexception public object query for object string id object param object throws sql exception return delegate query for object session id param object queryforobject paramobject sqlexception queryforobject paramobject public object query for object string id throws sql exception return query for object id null queryforobject sqlexception queryforobject public object query for object string id object param object object result object throws sql exception return delegate query for object session id param object result object queryforobject paramobject resultobject sqlexception queryforobject paramobject resultobject public list query for list string id object param object throws sql exception return delegate query for list session id param object queryforlist paramobject sqlexception queryforlist paramobject public list query for list string id throws sql exception return query for list id null queryforlist sqlexception queryforlist public list query for list string id object param object int skip int max throws sql exception return delegate query for list session id param object skip max queryforlist paramobject sqlexception queryforlist paramobject public list query for list string id int skip int max throws sql exception return query for list id null skip max queryforlist sqlexception queryforlist deprecated all paginated list features have been deprecated public paginated list query for paginated list string id object param object int page size throws sql exception return delegate query for paginated list session id param object page size paginatedlist queryforpaginatedlist paramobject pagesize sqlexception queryforpaginatedlist paramobject pagesize deprecated all paginated list features have been deprecated public paginated list query for paginated list string id int page size throws sql exception return query for paginated list id null page size paginatedlist queryforpaginatedlist pagesize sqlexception queryforpaginatedlist pagesize public map query for map string id object param object string key prop throws sql exception return delegate query for map session id param object key prop queryformap paramobject keyprop sqlexception queryformap paramobject keyprop public map query for map string id object param object string key prop string value prop throws sql exception return delegate query for map session id param object key prop value prop queryformap paramobject keyprop valueprop sqlexception queryformap paramobject keyprop valueprop public void query with row handler string id object param object row handler row handler throws sql exception delegate query with row handler session id param object row handler querywithrowhandler paramobject rowhandler rowhandler sqlexception querywithrowhandler paramobject rowhandler public void query with row handler string id row handler row handler throws sql exception query with row handler id null row handler querywithrowhandler rowhandler rowhandler sqlexception querywithrowhandler rowhandler public void start transaction throws sql exception delegate start transaction session starttransaction sqlexception starttransaction public void start transaction int transaction isolation throws sql exception delegate start transaction session transaction isolation starttransaction transactionisolation sqlexception starttransaction transactionisolation public void commit transaction throws sql exception delegate commit transaction session committransaction sqlexception committransaction public void end transaction throws sql exception delegate end transaction session endtransaction sqlexception endtransaction public void start batch throws sql exception delegate start batch session startbatch sqlexception startbatch public int execute batch throws sql exception return delegate execute batch session executebatch sqlexception executebatch public list execute batch detailed throws sql exception batch exception return delegate execute batch detailed session executebatchdetailed sqlexception batchexception executebatchdetailed public void set user connection connection connection throws sql exception delegate set user provided transaction session connection setuserconnection sqlexception setuserprovidedtransaction todo deprecated return current connection throws sql exception deprecated public connection get user connection throws sql exception return get current connection sqlexception getuserconnection sqlexception getcurrentconnection public connection get current connection throws sql exception try connection conn null transaction trans delegate get transaction session if trans null conn trans get connection return conn catch transaction exception e throw new nestedsql exception error getting connection from transaction cause e e getcurrentconnection sqlexception gettransaction getconnection transactionexception nestedsqlexception public data source get data source return delegate get data source datasource getdatasource getdatasource gets a mapped statement by id param id the id return the mapped statement public mapped statement get mapped statement string id return delegate get mapped statement id mappedstatement getmappedstatement getmappedstatement get the status of lazy loading return the status public boolean is lazy loading enabled return delegate is lazy loading enabled islazyloadingenabled islazyloadingenabled get the status of cg lib enhancements return the status public boolean is enhancement enabled return delegate is enhancement enabled cglib isenhancementenabled isenhancementenabled get the sql executor return the executor public sql executor get sql executor return delegate get sql executor sqlexecutor getsqlexecutor getsqlexecutor get the delegate return the delegate public sql map executor delegate get delegate return delegate sqlmapexecutordelegate getdelegate public class map access plan extends base access plan map access plan class clazz string property names super clazz property names mapaccessplan baseaccessplan mapaccessplan propertynames propertynames public void set properties object object object values map map map object for int i 0 i property names length i map put property names i values i setproperties propertynames propertynames public object get properties object object object values new object property names length map map map object for int i 0 i property names length i values i map get property names i return values getproperties propertynames propertynames propertynames utility class no instances private result object factory util super resultobjectfactoryutil algorithm ul li if factory is null then create object internally li li otherwise try to create object through factory li li if null returned from factory then create object internally li ul this allows the factory to selectively create objects also allows for the common possibility that a factory is not configured param factory the factory to use may be null param statement id the id of the statement that generated the call to this method param clazz the type of object to create return a new instance of the specified class the instance must be castable to the specified class throws instantiation exception if the instance cannot be created if you throw this exception ibatis will throw a runtime exception in response and will end throws illegal access exception if the constructor cannot be accessed if you throw this exception ibatis will throw a runtime exception in response and will end public static object create object through factory class clazz throws instantiation exception illegal access exception factory settings fs get factory settings object obj if fs get result object factory null obj create object internally clazz else obj fs get result object factory create instance fs get statement id clazz if obj null obj create object internally clazz return obj statementid instantiationexception illegalaccessexception createobjectthroughfactory instantiationexception illegalaccessexception factorysettings getfactorysettings getresultobjectfactory createobjectinternally getresultobjectfactory createinstance getstatementid createobjectinternally this method creates object using ibatis normal mechanism we translate list and collection to array list and set to hash set because these interfaces may be requested in nested result maps and we want to supply default implementations param clazz return throws instantiation exception throws illegal access exception private static object create object internally class clazz throws instantiation exception illegal access exception class class to create if clazz list class clazz collection class class to create array list class else if clazz set class class to create hash set class else class to create clazz object obj resources instantiate class to create return obj arraylist hashset resultmaps instantiationexception illegalaccessexception createobjectinternally instantiationexception illegalaccessexception classtocreate classtocreate arraylist classtocreate hashset classtocreate classtocreate public static void set result object factory result object factory result object factory get factory settings set result object factory result object factory setresultobjectfactory resultobjectfactory resultobjectfactory getfactorysettings setresultobjectfactory resultobjectfactory public static void set statement id string statement id get factory settings set statement id statement id setstatementid statementid getfactorysettings setstatementid statementid private static factory settings get factory settings factory settings fs factory settings factory settings get if fs null fs new factory settings factory settings set fs return fs factorysettings getfactorysettings factorysettings factorysettings factorysettings factorysettings factorysettings private string statement id public result object factory get result object factory return result object factory statementid resultobjectfactory getresultobjectfactory resultobjectfactory public void set result object factory result object factory result object factory this result object factory result object factory setresultobjectfactory resultobjectfactory resultobjectfactory resultobjectfactory resultobjectfactory public string get statement id return statement id getstatementid statementid public void set statement id string statement id this statement id statement id setstatementid statementid statementid statementid private map sub maps public discriminator sql map executor delegate delegate result mapping result mapping this delegate delegate this result mapping result mapping submaps sqlmapexecutordelegate resultmapping resultmapping resultmapping resultmapping public void set result mapping result mapping result mapping this result mapping result mapping setresultmapping resultmapping resultmapping resultmapping resultmapping public result mapping get result mapping return result mapping resultmapping getresultmapping resultmapping public void add sub map string discriminator value string result map name if sub maps null sub maps new hash map sub maps put discriminator value result map name addsubmap discriminatorvalue resultmapname submaps submaps hashmap submaps discriminatorvalue resultmapname public result map get sub map string s return result map sub maps get s resultmap getsubmap resultmap submaps public void bind sub maps if sub maps null iterator keys sub maps key set iterator while keys has next object key keys next object id sub maps get key if id instanceof string sub maps put key delegate get result map string id bindsubmaps submaps submaps keyset hasnext submaps submaps getresultmap public boolean is condition sql tag context ctx sql tag tag object parameter object if parameter object null return true else string prop get resolved property ctx tag object value if prop null value probe get object parameter object prop else value parameter object if value instanceof collection return value null collection value size 1 else if value null value get class is array return array get length value 0 else return value null string value of value equals iscondition sqltagcontext sqltag parameterobject parameterobject getresolvedproperty getobject parameterobject parameterobject getclass isarray getlength valueof default constructor public lru cache controller this cache size 100 this cache collections synchronized map new hash map this key list collections synchronized list new linked list lrucachecontroller cachesize synchronizedmap hashmap keylist synchronizedlist linkedlist configures the cache param props optionally can contain properties reference type weak soft strong public void configure properties props string size props get property cache size if size null size props get property size if size null cache size integer parse int size getproperty getproperty cachesize parseint add an object to the cache param cache model the cache model param key the key of the object to be cached param value the object to be cached public void put object cache model cache model object key object value cache put key value key list add key if key list size cache size try object oldest key key list remove 0 cache remove oldest key catch index out of bounds exception e ignore cachemodel cachemodel putobject cachemodel cachemodel keylist keylist cachesize oldestkey keylist oldestkey indexoutofboundsexception get an object out of the cache param cache model the cache model param key the key of the object to be returned return the cached object or null public object get object cache model cache model object key object result cache get key key list remove key if result null key list add key return result cachemodel getobject cachemodel cachemodel keylist keylist public object remove object cache model cache model object key key list remove key return cache remove key removeobject cachemodel cachemodel keylist flushes the cache param cache model the cache model public void flush cache model cache model cache clear key list clear cachemodel cachemodel cachemodel keylist public class is less than tag handler extends conditional tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object long x compare ctx tag parameter object return x 0 x conditional tag handler not comparable islessthantaghandler conditionaltaghandler iscondition sqltagcontext sqltag parameterobject parameterobject conditionaltaghandler not_comparable public class general statement extends base statement public statement type get statement type return statement type unknown generalstatement basestatement statementtype getstatementtype statementtype public int execute update request scope request transaction trans object parameter object throws sql exception error context error context request get error context error context set activity preparing the mapped statement for execution error context set object id this get id error context set resource this get resource request get session set commit required true try parameter object validate parameter parameter object sql sql get sql error context set more info check the parameter map parameter map parameter map sql get parameter map request parameter object error context set more info check the result map result map result map sql get result map request parameter object request set result map result map request set parameter map parameter map int rows 0 error context set more info check the parameter map object parameters parameter map get parameter object values request parameter object error context set more info check the sql statement string sql string sql get sql request parameter object error context set activity executing mapped statement error context set more info check the statement or the result map rows sql execute update request trans get connection sql string parameters error context set more info check the output parameters if parameter object null post process parameter object request parameter object parameters error context reset sql cleanup request notify listeners return rows catch sql exception e error context set cause e throw new nestedsql exception error context to string e getsql state e get error code e catch exception e error context set cause e throw new nestedsql exception error context to string e executeupdate requestscope parameterobject sqlexception errorcontext errorcontext geterrorcontext errorcontext setactivity errorcontext setobjectid getid errorcontext setresource getresource getsession setcommitrequired parameterobject validateparameter parameterobject getsql errorcontext setmoreinfo parametermap parametermap getparametermap parameterobject errorcontext setmoreinfo resultmap resultmap getresultmap parameterobject setresultmap resultmap setparametermap parametermap errorcontext setmoreinfo parametermap getparameterobjectvalues parameterobject errorcontext setmoreinfo sqlstring getsql parameterobject errorcontext setactivity errorcontext setmoreinfo sqlexecuteupdate getconnection sqlstring errorcontext setmoreinfo parameterobject postprocessparameterobject parameterobject errorcontext notifylisteners sqlexception errorcontext setcause nestedsqlexception errorcontext tostring getsqlstate geterrorcode errorcontext setcause nestedsqlexception errorcontext tostring public object execute query for object request scope request transaction trans object parameter object object result object throws sql exception try object object null default row handler row handler new default row handler execute query with callback request trans get connection parameter object result object row handler sql executor no skipped results sql executor no maximum results list list row handler get list if list size 1 throw new sql exception error execute query for object returned too many results else if list size 0 object list get 0 return object catch transaction exception e throw new nestedsql exception error getting connection from transaction cause e e executequeryforobject requestscope parameterobject resultobject sqlexception defaultrowhandler rowhandler defaultrowhandler executequerywithcallback getconnection parameterobject resultobject rowhandler sqlexecutor no_skipped_results sqlexecutor no_maximum_results rowhandler getlist sqlexception executequeryforobject transactionexception nestedsqlexception public list execute query for list request scope request transaction trans object parameter object int skip results int max results throws sql exception try default row handler row handler new default row handler execute query with callback request trans get connection parameter object null row handler skip results max results return row handler get list catch transaction exception e throw new nestedsql exception error getting connection from transaction cause e e executequeryforlist requestscope parameterobject skipresults maxresults sqlexception defaultrowhandler rowhandler defaultrowhandler executequerywithcallback getconnection parameterobject rowhandler skipresults maxresults rowhandler getlist transactionexception nestedsqlexception public void execute query with row handler request scope request transaction trans object parameter object row handler row handler throws sql exception try execute query with callback request trans get connection parameter object null row handler sql executor no skipped results sql executor no maximum results catch transaction exception e throw new nestedsql exception error getting connection from transaction cause e e executequerywithrowhandler requestscope parameterobject rowhandler rowhandler sqlexception executequerywithcallback getconnection parameterobject rowhandler sqlexecutor no_skipped_results sqlexecutor no_maximum_results transactionexception nestedsqlexception protected void execute query with callback request scope request connection conn object parameter object object result object row handler row handler int skip results int max results throws sql exception error context error context request get error context error context set activity preparing the mapped statement for execution error context set object id this get id error context set resource this get resource try parameter object validate parameter parameter object sql sql get sql error context set more info check the parameter map parameter map parameter map sql get parameter map request parameter object error context set more info check the result map result map result map sql get result map request parameter object request set result map result map request set parameter map parameter map error context set more info check the parameter map object parameters parameter map get parameter object values request parameter object error context set more info check the sql statement string sql string sql get sql request parameter object error context set activity executing mapped statement error context set more info check the sql statement or the result map row handler callback callback new row handler callback result map result object row handler sql execute query request conn sql string parameters skip results max results callback error context set more info check the output parameters if parameter object null post process parameter object request parameter object parameters error context reset sql cleanup request notify listeners catch sql exception e error context set cause e throw new nestedsql exception error context to string e getsql state e get error code e catch exception e error context set cause e throw new nestedsql exception error context to string e executequerywithcallback requestscope parameterobject resultobject rowhandler rowhandler skipresults maxresults sqlexception errorcontext errorcontext geterrorcontext errorcontext setactivity errorcontext setobjectid getid errorcontext setresource getresource parameterobject validateparameter parameterobject getsql errorcontext setmoreinfo parametermap parametermap getparametermap parameterobject errorcontext setmoreinfo resultmap resultmap getresultmap parameterobject setresultmap resultmap setparametermap parametermap errorcontext setmoreinfo parametermap getparameterobjectvalues parameterobject errorcontext setmoreinfo sqlstring getsql parameterobject errorcontext setactivity errorcontext setmoreinfo rowhandlercallback rowhandlercallback resultmap resultobject rowhandler sqlexecutequery sqlstring skipresults maxresults errorcontext setmoreinfo parameterobject postprocessparameterobject parameterobject errorcontext notifylisteners sqlexception errorcontext setcause nestedsqlexception errorcontext tostring getsqlstate geterrorcode errorcontext setcause nestedsqlexception errorcontext tostring protected void post process parameter object request scope request object parameter object object parameters postprocessparameterobject requestscope parameterobject protected int sql execute update request scope request connection conn string sql string object parameters throws sql exception if request get session is in batch get sql executor add batch request conn sql string parameters return 0 else return get sql executor execute update request conn sql string parameters sqlexecuteupdate requestscope sqlstring sqlexception getsession isinbatch getsqlexecutor addbatch sqlstring getsqlexecutor executeupdate sqlstring protected void sql execute query request scope request connection conn string sql string object parameters int skip results int max results row handler callback callback throws sql exception get sql executor execute query request conn sql string parameters skip results max results callback sqlexecutequery requestscope sqlstring skipresults maxresults rowhandlercallback sqlexception getsqlexecutor executequery sqlstring skipresults maxresults protected object validate parameter object param throws sql exception object new param param class parameter class get parameter class if new param null parameter class null if dom type marker class is assignable from parameter class if xml type marker class is assignable from parameter class if new param instanceof string new param instanceof document throw new sql exception invalid parameter object type expected string class get name or document class get name but found new param get class get name if new param instanceof document new param string to document string new param else if document class is assignable from new param get class throw new sql exception invalid parameter object type expected document class get name but found new param get class get name else if parameter class is assignable from new param get class throw new sql exception invalid parameter object type expected parameter class get name but found new param get class get name return new param validateparameter sqlexception newparam parameterclass getparameterclass newparam parameterclass domtypemarker isassignablefrom parameterclass xmltypemarker isassignablefrom parameterclass newparam newparam sqlexception getname getname newparam getclass getname newparam newparam stringtodocument newparam isassignablefrom newparam getclass sqlexception getname newparam getclass getname parameterclass isassignablefrom newparam getclass sqlexception parameterclass getname newparam getclass getname newparam private document string to document string s try document builder factory document builder factory document builder factory new instance document builder document builder document builder factory new document builder return document builder parse new reader input stream new string reader s catch exception e throw new runtime exception error occurred cause e e stringtodocument documentbuilderfactory documentbuilderfactory documentbuilderfactory newinstance documentbuilder documentbuilder documentbuilderfactory newdocumentbuilder documentbuilder readerinputstream stringreader runtimeexception default constructor public type handler factory type handler handler handler new boolean type handler register boolean class handler register boolean class handler handler new byte type handler register byte class handler register byte class handler handler new short type handler register short class handler register short class handler handler new integer type handler register integer class handler register int class handler handler new long type handler register long class handler register long class handler handler new float type handler register float class handler register float class handler handler new double type handler register double class handler register double class handler register string class new string type handler register string class clob new custom type handler new clob type handler callback register string class longvarchar new custom type handler new clob type handler callback register big decimal class new big decimal type handler register byte class new byte array type handler register byte class blob new custom type handler new blob type handler callback register byte class longvarbinary new custom type handler new blob type handler callback register object class new object type handler register object class object new object type handler register date class new date type handler register date class date new date only type handler register date class time new time only type handler register java sql date class new sql date type handler register java sql time class new sql time type handler register java sql timestamp class new sql timestamp type handler put type alias string string class get name put type alias byte byte class get name put type alias long long class get name put type alias short short class get name put type alias int integer class get name put type alias integer integer class get name put type alias double double class get name put type alias float float class get name put type alias boolean boolean class get name put type alias date date class get name put type alias decimal big decimal class get name put type alias object object class get name put type alias map map class get name put type alias hashmap hash map class get name put type alias list list class get name put type alias arraylist array list class get name put type alias collection collection class get name put type alias iterator iterator class get name put type alias cursor java sql result set class get name typehandlerfactory typehandler booleantypehandler bytetypehandler shorttypehandler integertypehandler longtypehandler floattypehandler doubletypehandler stringtypehandler customtypehandler clobtypehandlercallback customtypehandler clobtypehandlercallback bigdecimal bigdecimaltypehandler bytearraytypehandler customtypehandler blobtypehandlercallback customtypehandler blobtypehandlercallback objecttypehandler objecttypehandler datetypehandler dateonlytypehandler timeonlytypehandler sqldatetypehandler sqltimetypehandler sqltimestamptypehandler puttypealias getname puttypealias getname puttypealias getname puttypealias getname puttypealias getname puttypealias getname puttypealias getname puttypealias getname puttypealias getname puttypealias getname puttypealias bigdecimal getname puttypealias getname puttypealias getname puttypealias hashmap getname puttypealias getname puttypealias arraylist getname puttypealias getname puttypealias getname puttypealias resultset getname get a type handler for a class param type the class you want a type handler for return the handler public type handler get type handler class type return get type handler type null typehandler typehandler typehandler gettypehandler gettypehandler get a type handler for a class and a jdbc type param type the class param jdbc type the jdbc type return the handler public type handler get type handler class type string jdbc type map jdbc handler map map type handler map get type type handler handler null if jdbc handler map null handler type handler jdbc handler map get jdbc type if handler null handler type handler jdbc handler map get null return handler typehandler jdbctype typehandler gettypehandler jdbctype jdbchandlermap typehandlermap typehandler jdbchandlermap typehandler jdbchandlermap jdbctype typehandler jdbchandlermap when in doubt get the unknown type handler return if i told you it would not be unknown would it public type handler get unkown type handler return unknown type handler typehandler getunkowntypehandler unknowntypehandler tells you if a particular class has a type handler param type the class return true if there is a type handler public boolean has type handler class type return get type handler type null typehandler typehandler hastypehandler gettypehandler register add a type handler for a class param type the class param handler the handler instance public void register class type type handler handler register type null handler typehandler register add a type handler for a class and jdbc type param type the class param jdbc type the jdbc type param handler the handler instance public void register class type string jdbc type type handler handler map map map type handler map get type if map null map new hash map type handler map put type map map put jdbc type handler jdbctype jdbctype typehandler typehandlermap hashmap typehandlermap jdbctype lookup an aliased class and return it s real name param string the alias return the real name public string resolve alias string string string key null if string null key string to lower case string value null if type aliases contains key key value string type aliases get key else value string return value resolvealias tolowercase typealiases containskey typealiases adds a type alias that is case insensitive all of the following string string st ri ng will equate to the same alias param alias the alias param value the real class name public void put type alias string alias string value string key null if alias null key alias to lower case if type aliases contains key key type aliases get key equals value throw new sql map exception error in xml sql map client builder alias name conflict occurred the alias key is already mapped to the value type aliases get alias type aliases put key value string puttypealias tolowercase typealiases containskey typealiases sqlmapexception xmlsqlmapclientbuilder typealiases typealiases private int maximum concurrent transactions public int get maximum concurrent transactions return maximum concurrent transactions maximumconcurrenttransactions getmaximumconcurrenttransactions maximumconcurrenttransactions public void set maximum concurrent transactions int maximum concurrent transactions this maximum concurrent transactions maximum concurrent transactions setmaximumconcurrenttransactions maximumconcurrenttransactions maximumconcurrenttransactions maximumconcurrenttransactions private data source data source public data source get data source return data source datasource datasource datasource getdatasource datasource public void set data source data source ds this data source ds setdatasource datasource datasource public void initialize properties props throws sql exception transaction exception sqlexception transactionexception public transaction new transaction int transaction isolation throws sql exception transaction exception return new jdbc transaction data source transaction isolation newtransaction transactionisolation sqlexception transactionexception jdbctransaction datasource transactionisolation private class info class clazz class name clazz get name add methods clazz readable property names string get methods key set to array new string get methods key set size writeable property names string set methods key set to array new string set methods key set size classinfo classname getname addmethods readablepropertynames getmethods keyset toarray getmethods keyset writeablepropertynames setmethods keyset toarray setmethods keyset private void add methods class cls method methods get all methods for class cls for int i 0 i methods length i string name methods i get name if name starts with set name length 3 if methods i get parameter types length 1 name drop case name if set methods contains key name todo jgb this should probably be a runtime exception at some point log error illegal overloaded setter method for property name in class cls get name this breaks the java beans specification and can cause unpredicatble results set methods put name methods i set types put name methods i get parameter types 0 else if name starts with get name length 3 if methods i get parameter types length 0 name drop case name get methods put name methods i get types put name methods i get return type else if name starts with is name length 2 if methods i get parameter types length 0 name drop case name get methods put name methods i get types put name methods i get return type name null addmethods getallmethodsforclass getname startswith getparametertypes dropcase setmethods containskey runtimeexception getname javabeans setmethods settypes getparametertypes startswith getparametertypes dropcase getmethods gettypes getreturntype startswith getparametertypes dropcase getmethods gettypes getreturntype private method get all methods for class class cls if cls is interface interfaces only have public methods so the simple call is all we need this will also get superinterface methods return cls get methods else need to get all the declared methods in this class and any super class then need to set access appropriatly for private methods return get class methods cls getallmethodsforclass isinterface getmethods getclassmethods this method returns an array containing all methods declared in this class and any superclass we use this method instead of the simpler class get methods because we want to look for private methods as well param cls return private method get class methods class cls hash map unique methods new hash map class current class cls while current class null add unique methods unique methods current class get declared methods we also need to look for interface methods because the class may be abstract class interfaces current class get interfaces for int i 0 i interfaces length i add unique methods unique methods interfaces i get methods current class current class get superclass collection methods unique methods values return method methods to array new method methods size getmethods getclassmethods hashmap uniquemethods hashmap currentclass currentclass adduniquemethods uniquemethods currentclass getdeclaredmethods currentclass getinterfaces adduniquemethods uniquemethods getmethods currentclass currentclass getsuperclass uniquemethods toarray private void add unique methods hash map unique methods method methods for int i 0 i methods length i method current method methods i string signature get signature current method check to see if the method is already known if it is known then an extended class must have overridden a method if unique methods contains key signature if can access private methods try current method set accessible true catch exception e ignored this is only a final precaution nothing we can do unique methods put signature current method adduniquemethods hashmap uniquemethods currentmethod getsignature currentmethod uniquemethods containskey canaccessprivatemethods currentmethod setaccessible uniquemethods currentmethod private string get signature method method string buffer sb new string buffer sb append method get name class parameters method get parameter types for int i 0 i parameters length i if i 0 sb append else sb append sb append parameters i get name return sb to string getsignature stringbuffer stringbuffer getname getparametertypes getname tostring private boolean can access private methods try system get security manager check permission new reflect permission suppress access checks return true catch security exception e return false catch null pointer exception e return true canaccessprivatemethods getsecuritymanager checkpermission reflectpermission suppressaccesschecks securityexception nullpointerexception private static string drop case string name if name starts with is name name substring 2 else if name starts with get name starts with set name name substring 3 else throw new probe exception error parsing property name name didn t start with is get or set if name length 1 name length 1 character is upper case name char at 1 name name substring 0 1 to lower case locale us name substring 1 return name dropcase startswith startswith startswith probeexception isuppercase charat tolowercase gets the name of the class the instance provides information for return the class name public string get class name return class name getclassname classname gets the setter for a property as a method object param property name the property return the method public method get setter string property name method method method set methods get property name if method null throw new probe exception there is no writeable property named property name in class class name return method propertyname getsetter propertyname setmethods propertyname probeexception propertyname classname gets the getter for a property as a method object param property name the property return the method public method get getter string property name method method method get methods get property name if method null throw new probe exception there is no readable property named property name in class class name return method propertyname getgetter propertyname getmethods propertyname probeexception propertyname classname gets the type for a property setter param property name the name of the property return the class of the propery setter public class get setter type string property name class clazz class set types get property name if clazz null throw new probe exception there is no writeable property named property name in class class name return clazz propertyname getsettertype propertyname settypes propertyname probeexception propertyname classname gets the type for a property getter param property name the name of the property return the class of the propery getter public class get getter type string property name class clazz class get types get property name if clazz null throw new probe exception there is no readable property named property name in class class name return clazz propertyname getgettertype propertyname gettypes propertyname probeexception propertyname classname gets an array of the readable properties for an object return the array public string get readable property names return readable property names getreadablepropertynames readablepropertynames gets an array of the writeable properties for an object return the array public string get writeable property names return writeable property names getwriteablepropertynames writeablepropertynames check to see if a class has a writeable property by name param property name the name of the property to check return true if the object has a writeable property by the name public boolean has writable property string property name return set methods key set contains property name propertyname haswritableproperty propertyname setmethods keyset propertyname check to see if a class has a readable property by name param property name the name of the property to check return true if the object has a readable property by the name public boolean has readable property string property name return get methods key set contains property name propertyname hasreadableproperty propertyname getmethods keyset propertyname tells us if the class passed in is a knwon common type param clazz the class to check return true if the class is known public static boolean is known type class clazz if simple type set contains clazz return true else if collection class is assignable from clazz return true else if map class is assignable from clazz return true else if list class is assignable from clazz return true else if set class is assignable from clazz return true else if iterator class is assignable from clazz return true else return false isknowntype simple_type_set isassignablefrom isassignablefrom isassignablefrom isassignablefrom isassignablefrom gets an instance of class info for the specified class param clazz the class for which to lookup the method cache return the method cache for the class public static class info get instance class clazz if cache enabled synchronized clazz class info cache class info class info map get clazz if cache null cache new class info clazz class info map put clazz cache return cache else return new class info clazz classinfo classinfo getinstance cacheenabled classinfo classinfo class_info_map classinfo class_info_map classinfo public static void set cache enabled boolean cache enabled class info cache enabled cache enabled setcacheenabled cacheenabled classinfo cacheenabled cacheenabled examines a throwable object and gets it s root cause param t the exception to examine return the root cause public static throwable unwrap throwable throwable t throwable t2 t while true if t2 instanceof invocation target exception t2 invocation target exception t get target exception else if t instanceof undeclared throwable exception t2 undeclared throwable exception t get undeclared throwable else return t2 unwrapthrowable invocationtargetexception invocationtargetexception gettargetexception undeclaredthrowableexception undeclaredthrowableexception getundeclaredthrowable private data source data source public void initialize map map data source new simple data source map datasource datasource datasource simpledatasource public data source get data source return data source datasource getdatasource datasource public class primitive data exchange extends base data exchange implements data exchange protected primitive data exchange data exchange factory data exchange factory super data exchange factory primitivedataexchange basedataexchange dataexchange primitivedataexchange dataexchangefactory dataexchangefactory dataexchangefactory public void initialize map properties public object get data request scope request parameter map parameter map object parameter object parameter mapping mappings parameter map get parameter mappings object data new object mappings length for int i 0 i mappings length i data i parameter object return data getdata requestscope parametermap parametermap parameterobject parametermapping parametermap getparametermappings parameterobject public object set data request scope request result map result map object result object object values return values 0 setdata requestscope resultmap resultmap resultobject public object set data request scope request parameter map parameter map object parameter object object values return values 0 setdata requestscope parametermap parametermap parameterobject private bulk bean bulk bean enhanced property access plan class clazz string property names super clazz property names bulk bean bulk bean create clazz get getter names property names get setter names property names get types property names bulkbean bulkbean enhancedpropertyaccessplan propertynames propertynames bulkbean bulkbean getgetternames propertynames getsetternames propertynames gettypes propertynames public void set properties object object object values bulk bean set property values object values setproperties bulkbean setpropertyvalues public object get properties object object return bulk bean get property values object getproperties bulkbean getpropertyvalues private jdbc type registry jdbctyperegistry private static void set type string name int value type map put name new integer value settype type_map looks up a type by name and returns it s int value from java sql types param name the type name return the int value from java sql types public static int get type string name if name null return unknown type integer i integer type map get name if i null return i int value else return unknown type gettype unknown_type type_map intvalue unknown_type private static void initialize types set type array types array set type bigint types bigint set type binary types binary set type bit types bit set type blob types blob set type boolean jdbc 30 boolean set type char types char set type clob types clob set type datalink jdbc 30 datalink set type date types date set type decimal types decimal set type distinct types distinct set type double types double set type float types float set type integer types integer set type java object types java object set type longvarbinary types longvarbinary set type longvarchar types longvarchar set type null types null set type numeric types numeric set type other types other set type real types real set type ref types ref set type smallint types smallint set type struct types struct set type time types time set type timestamp types timestamp set type tinyint types tinyint set type varbinary types varbinary set type varchar types varchar set type ch types char set type vc types varchar set type dt types date set type tm types time set type ts types timestamp set type nm types numeric set type ii types integer set type bi types bigint set type si types smallint set type ti types tinyint set type dc types decimal set type db types double set type fl types float set type oraclecursor 10 initializetypes settype settype settype settype settype settype jdbc_30_boolean settype settype settype jdbc_30_datalink settype settype settype settype settype settype settype java_object java_object settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype settype public int do start fragment sql tag context ctx sql tag tag object parameter object iterate context iterate iterate context ctx get attribute tag if iterate null iterate context parent iterate ctx peek iterate context ctx push remove first prepend marker tag object collection string prop tag get property attr if prop null prop equals if null parent iterate parent iterate is allow next parent iterate next parent iterate set allow next false if parent iterate has next parent iterate set final true if parent iterate null prop parent iterate add index to tag property prop collection probe get object parameter object prop else collection parameter object iterate new iterate context collection tag parent iterate iterate set property null prop prop ctx set attribute tag iterate ctx push iterate context iterate else if iterate equals tag get remove first prepend ctx re enable remove first prepend marker if iterate null iterate has next return include body else return skip body dostartfragment sqltagcontext sqltag parameterobject iteratecontext iteratecontext getattribute iteratecontext parentiterate peekiteratecontext pushremovefirstprependmarker getpropertyattr parentiterate parentiterate isallownext parentiterate parentiterate setallownext parentiterate hasnext parentiterate setfinal parentiterate parentiterate addindextotagproperty getobject parameterobject parameterobject iteratecontext parentiterate setproperty setattribute pushiteratecontext getremovefirstprepend reenableremovefirstprependmarker hasnext include_body skip_body public int do end fragment sql tag context ctx sql tag tag object parameter object string buffer body content iterate context iterate iterate context ctx get attribute tag if iterate has next iterate is final if iterate is allow next iterate next if body content to string trim length 0 the sub element produced a result if it is the first one to produce a result then we need to add the open text if it is not the first to produce a result then we need to add the conjunction text if iterate some sub elements have content if tag is conjunction available body content insert 0 tag get conjunction attr else we need to specify that this is the first content producing element so that the do prepend method will add the prepend iterate set prepend enabled true if tag is open available body content insert 0 tag get open attr iterate set some sub elements have content true if iterate is last iterate some sub elements have content if tag is close available body content append tag get close attr iterate set allow next true if iterate is final return super do end fragment ctx tag parameter object body content else return repeat body else return super do end fragment ctx tag parameter object body content doendfragment sqltagcontext sqltag parameterobject stringbuffer bodycontent iteratecontext iteratecontext getattribute hasnext isfinal isallownext bodycontent tostring somesubelementshavecontent isconjunctionavailable bodycontent getconjunctionattr doprepend setprependenabled isopenavailable bodycontent getopenattr setsomesubelementshavecontent islast somesubelementshavecontent iscloseavailable bodycontent getcloseattr setallownext isfinal doendfragment parameterobject bodycontent repeat_body doendfragment parameterobject bodycontent public void do prepend sql tag context ctx sql tag tag object parameter object string buffer body content iterate context iterate iterate context ctx get attribute tag if iterate is prepend enabled super do prepend ctx tag parameter object body content iterate set prepend enabled false only do the prepend one time doprepend sqltagcontext sqltag parameterobject stringbuffer bodycontent iteratecontext iteratecontext getattribute isprependenabled doprepend parameterobject bodycontent setprependenabled public boolean is post parse required return true ispostparserequired public class map data exchange extends base data exchange implements data exchange protected map data exchange data exchange factory data exchange factory super data exchange factory mapdataexchange basedataexchange dataexchange mapdataexchange dataexchangefactory dataexchangefactory dataexchangefactory public void initialize map properties public object get data request scope request parameter map parameter map object parameter object if parameter object instanceof map throw new runtime exception error object passed into map data exchange was not an instance of map object data new object parameter map get parameter mappings length map map map parameter object parameter mapping mappings parameter map get parameter mappings for int i 0 i mappings length i data i map get mappings i get property name return data getdata requestscope parametermap parametermap parameterobject parameterobject runtimeexception mapdataexchange parametermap getparametermappings parameterobject parametermapping parametermap getparametermappings getpropertyname public object set data request scope request result map result map object result object object values if result object null result object instanceof map throw new runtime exception error object passed into map data exchange was not an instance of map map map map result object if map null map new hash map result mapping mappings result map get result mappings for int i 0 i mappings length i map put mappings i get property name values i return map setdata requestscope resultmap resultmap resultobject resultobject resultobject runtimeexception mapdataexchange resultobject hashmap resultmapping resultmap getresultmappings getpropertyname public object set data request scope request parameter map parameter map object parameter object object values if parameter object null parameter object instanceof map throw new runtime exception error object passed into map data exchange was not an instance of map map map map parameter object if map null map new hash map parameter mapping mappings parameter map get parameter mappings for int i 0 i mappings length i if mappings i is output allowed map put mappings i get property name values i return map setdata requestscope parametermap parametermap parameterobject parameterobject parameterobject runtimeexception mapdataexchange parameterobject hashmap parametermapping parametermap getparametermappings isoutputallowed getpropertyname public string get readable property names object object list props new array list element e resolve element object node list nodes e get child nodes for int i 0 i nodes get length i props add nodes item i get node name return string props to array new string props size getreadablepropertynames arraylist resolveelement nodelist getchildnodes getlength getnodename toarray public string get writeable property names object object list props new array list element e resolve element object node list nodes e get child nodes for int i 0 i nodes get length i props add nodes item i get node name return string props to array new string props size getwriteablepropertynames arraylist resolveelement nodelist getchildnodes getlength getnodename toarray public class get property type for setter object object string name element e find nested node by name resolve element object name false todo alias types don t use exceptions like this try return resources class for name e get attribute type catch class not found exception e1 return object class getpropertytypeforsetter findnestednodebyname resolveelement classforname getattribute classnotfoundexception public class get property type for getter object object string name element e find nested node by name resolve element object name false todo alias types don t use exceptions like this try return resources class for name e get attribute type catch class not found exception e1 return object class getpropertytypeforgetter findnestednodebyname resolveelement classforname getattribute classnotfoundexception public boolean has writable property object object string property name return find nested node by name resolve element object property name false null haswritableproperty propertyname findnestednodebyname resolveelement propertyname public boolean has readable property object object string property name return find nested node by name resolve element object property name false null hasreadableproperty propertyname findnestednodebyname resolveelement propertyname public object get object object object string name object value null element element find nested node by name resolve element object name false if element null value get element value element return value getobject findnestednodebyname resolveelement getelementvalue public void set object object object string name object value element element find nested node by name resolve element object name true if element null set element value element value setobject findnestednodebyname resolveelement setelementvalue protected void set property object object string property object value element element find node by name resolve element object property 0 true if element null set element value element value setproperty findnodebyname resolveelement setelementvalue protected object get property object object string property object value null element element find node by name resolve element object property 0 false if element null value get element value element return value getproperty findnodebyname resolveelement getelementvalue private element resolve element object object element element null if object instanceof document element element document object get last child else if object instanceof element element element object else throw new probe exception an unknown object type was passed to dom probe must be a document return element resolveelement getlastchild probeexception domprobe private void set element value element element object value character data data null element prop element if value instanceof collection iterator items collection value iterator while items has next document valdoc document items next node list list valdoc get child nodes for int i 0 i list get length i node new node element get owner document import node list item i true element append child new node else if value instanceof document document valdoc document value node last child valdoc get last child node list list last child get child nodes for int i 0 i list get length i node new node element get owner document import node list item i true element append child new node else if value instanceof element node new node element get owner document import node element value true element append child new node else find text child element node list texts prop get child nodes if texts get length 1 node child texts item 0 if child instanceof character data use existing text data character data child else remove non text add text prop remove child child text text prop get owner document create text node string value of value prop append child text data text else if texts get length 1 remove all add text for int i texts get length 1 i 0 i prop remove child texts item i text text prop get owner document create text node string value of value prop append child text data text else add text text text prop get owner document create text node string value of value prop append child text data text data set data string value of value set type attribute prop set attribute type value null null value get class get name setelementvalue characterdata hasnext nodelist getchildnodes getlength newnode getownerdocument importnode appendchild newnode lastchild getlastchild nodelist lastchild getchildnodes getlength newnode getownerdocument importnode appendchild newnode newnode getownerdocument importnode appendchild newnode nodelist getchildnodes getlength characterdata characterdata removechild getownerdocument createtextnode valueof appendchild getlength getlength removechild getownerdocument createtextnode valueof appendchild getownerdocument createtextnode valueof appendchild setdata valueof setattribute getclass getname private object get element value element element string buffer value null element prop element if prop null find text child elements node list texts prop get child nodes if texts get length 0 value new string buffer for int i 0 i texts get length i node text texts item i if text instanceof character data value append character data text get data convert to proper type value convert value to string if value null return null else return string value of value getelementvalue stringbuffer nodelist getchildnodes getlength stringbuffer getlength characterdata characterdata getdata tostring valueof private element find nested node by name element element string name boolean create element child element string tokenizer parser new string tokenizer name false while parser has more tokens string child name parser next token if child name index of 1 string prop name child name substring 0 child name index of int i integer parse int child name substring child name index of 1 child name index of child find node by name child prop name i create else child find node by name child child name 0 create if child null break return child findnestednodebyname stringtokenizer stringtokenizer hasmoretokens childname nexttoken childname indexof propname childname childname indexof parseint childname childname indexof childname indexof findnodebyname propname findnodebyname childname private element find node by name element element string name int index boolean create element prop null find named property element node list prop nodes element get elements by tag name name if prop nodes get length index prop element prop nodes item index else if create for int i 0 i index 1 i prop element get owner document create element name element append child prop return prop findnodebyname nodelist propnodes getelementsbytagname propnodes getlength propnodes getownerdocument createelement appendchild converts a dom node to a complete xml string param node the node to process param indent how to indent the children of the node return the node as a string public static string node to string node node string indent string writer string writer new string writer print writer print writer new print writer string writer switch node get node type case node document node print writer println xml version 1 0 n recurse on each child node list nodes node get child nodes if nodes null for int i 0 i nodes get length i print writer print node to string nodes item i break case node element node string name node get node name print writer print indent name named node map attributes node get attributes for int i 0 i attributes get length i node current attributes item i print writer print current get node name current get node value print writer print recurse on each child node list children node get child nodes if children null for int i 0 i children get length i print writer print node to string children item i indent indent print writer print name break case node text node print writer print node get node value break print writer flush string result string writer get buffer to string print writer close return result nodetostring stringwriter stringwriter stringwriter printwriter printwriter printwriter stringwriter getnodetype document_node printwriter nodelist getchildnodes getlength printwriter nodetostring element_node getnodename printwriter namednodemap getattributes getlength printwriter getnodename getnodevalue printwriter nodelist getchildnodes getlength printwriter nodetostring printwriter text_node printwriter getnodevalue printwriter stringwriter getbuffer tostring printwriter private boolean after public string get key property return key property getkeyproperty keyproperty public void set key property string key property this key property key property setkeyproperty keyproperty keyproperty keyproperty public boolean is after return after isafter public void set after boolean after this after after setafter public list execute query for list request scope request transaction trans object parameter object int skip results int max results throws sql exception throw new sql exception select statements cannot be executed for a list executequeryforlist requestscope parameterobject skipresults maxresults sqlexception sqlexception public void execute query with row handler request scope request transaction trans object parameter object row handler row handler throws sql exception throw new sql exception select key statements cannot be executed with a row handler executequerywithrowhandler requestscope parameterobject rowhandler rowhandler sqlexception sqlexception private boolean using streams public sql map config parser this null null usingstreams sqlmapconfigparser public sql map config parser xml converter sql map config conv xml converter sql map conv super new variables parser set validation true parser set entity resolver new sql map classpath entity resolver vars sql map config conv sql map config conv vars sql map conv sql map conv vars delegate new sql map executor delegate vars type handler factory vars delegate get type handler factory vars client new sql map client impl vars delegate register default type aliases add sql map config nodelets add global prop nodelets add settings nodelets add type alias nodelets add type handler nodelets add transaction manager nodelets add sql map nodelets add result object factory nodelets sqlmapconfigparser xmlconverter sqlmapconfigconv xmlconverter sqlmapconv setvalidation setentityresolver sqlmapclasspathentityresolver sqlmapconfigconv sqlmapconfigconv sqlmapconv sqlmapconv sqlmapexecutordelegate typehandlerfactory gettypehandlerfactory sqlmapclientimpl registerdefaulttypealiases addsqlmapconfignodelets addglobalpropnodelets addsettingsnodelets addtypealiasnodelets addtypehandlernodelets addtransactionmanagernodelets addsqlmapnodelets addresultobjectfactorynodelets public sql map client parse reader reader properties props vars properties props return parse reader sqlmapclient public sql map client parse reader reader try if vars sql map config conv null reader vars sql map config conv convert xml reader using streams false parser parse reader return vars client catch exception e throw new runtime exception error occurred cause e e sqlmapclient sqlmapconfigconv sqlmapconfigconv convertxml usingstreams runtimeexception public sql map client parse input stream input stream properties props vars properties props return parse input stream sqlmapclient inputstream inputstream inputstream public sql map client parse input stream input stream try if vars sql map config conv null input stream vars sql map config conv convert xml input stream using streams true parser parse input stream return vars client catch exception e throw new runtime exception error occurred cause e e sqlmapclient inputstream inputstream sqlmapconfigconv inputstream sqlmapconfigconv convertxml inputstream usingstreams inputstream runtimeexception private void add sql map config nodelets parser add nodelet sql map config end new nodelet public void process node node throws exception iterator cache names vars client get delegate get cache model names while cache names has next string cache name string cache names next cache model cache model vars client get delegate get cache model cache name iterator statement names cache model get flush trigger statement names while statement names has next string statement name string statement names next mapped statement statement vars client get delegate get mapped statement statement name if statement null statement add execute listener cache model else throw new runtime exception could not find statement named statement name for use as a flush trigger for the cache model named cache name addsqlmapconfignodelets addnodelet sqlmapconfig cachenames getdelegate getcachemodelnames cachenames hasnext cachename cachenames cachemodel cachemodel getdelegate getcachemodel cachename statementnames cachemodel getflushtriggerstatementnames statementnames hasnext statementname statementnames mappedstatement getdelegate getmappedstatement statementname addexecutelistener cachemodel runtimeexception statementname cachename parser add nodelet sql map config end new nodelet public void process node node throws exception iterator cache names vars client get delegate get cache model names while cache names has next string cache name string cache names next cache model cache model vars client get delegate get cache model cache name iterator statement names cache model get flush trigger statement names while statement names has next string statement name string statement names next mapped statement statement vars client get delegate get mapped statement statement name if statement null statement add execute listener cache model else throw new runtime exception could not find statement named statement name for use as a flush trigger for the cache model named cache name addnodelet sqlmapconfig cachenames getdelegate getcachemodelnames cachenames hasnext cachename cachenames cachemodel cachemodel getdelegate getcachemodel cachename statementnames cachemodel getflushtriggerstatementnames statementnames hasnext statementname statementnames mappedstatement getdelegate getmappedstatement statementname addexecutelistener cachemodel runtimeexception statementname cachename private void add global prop nodelets parser add nodelet sql map config properties new nodelet public void process node node throws exception vars error ctx set activity loading global properties properties attributes nodelet utils parse attributes node vars properties string resource attributes get property resource string url attributes get property url try properties props null if resource null vars error ctx set resource resource props resources get resource as properties resource else if url null vars error ctx set resource url props resources get url as properties url else throw new runtime exception the properties element requires either a resource or a url attribute if vars properties null vars properties props else props put all vars properties vars properties props catch exception e throw new runtime exception error loading properties cause e addglobalpropnodelets addnodelet sqlmapconfig errorctx setactivity nodeletutils parseattributes getproperty getproperty errorctx setresource getresourceasproperties errorctx setresource geturlasproperties runtimeexception putall runtimeexception parser add nodelet sql map config properties new nodelet public void process node node throws exception vars error ctx set activity loading global properties properties attributes nodelet utils parse attributes node vars properties string resource attributes get property resource string url attributes get property url try properties props null if resource null vars error ctx set resource resource props resources get resource as properties resource else if url null vars error ctx set resource url props resources get url as properties url else throw new runtime exception the properties element requires either a resource or a url attribute if vars properties null vars properties props else props put all vars properties vars properties props catch exception e throw new runtime exception error loading properties cause e addnodelet sqlmapconfig errorctx setactivity nodeletutils parseattributes getproperty getproperty errorctx setresource getresourceasproperties errorctx setresource geturlasproperties runtimeexception putall runtimeexception private void add settings nodelets parser add nodelet sql map config settings new nodelet public void process node node throws exception vars error ctx set activity loading settings properties properties attributes nodelet utils parse attributes node vars properties string class info cache enabled attr attributes get property class info cache enabled boolean class info cache enabled class info cache enabled attr null true equals class info cache enabled attr class info set cache enabled class info cache enabled string lazy loading enabled attr attributes get property lazy loading enabled boolean lazy loading enabled lazy loading enabled attr null true equals lazy loading enabled attr vars client get delegate set lazy loading enabled lazy loading enabled string statement caching enabled attr attributes get property statement caching enabled boolean statement caching enabled statement caching enabled attr null true equals statement caching enabled attr vars client get delegate set statement cache enabled statement caching enabled string cache models enabled attr attributes get property cache models enabled boolean cache models enabled cache models enabled attr null true equals cache models enabled attr vars client get delegate set cache models enabled cache models enabled string enhancement enabled attr attributes get property enhancement enabled boolean enhancement enabled enhancement enabled attr null true equals enhancement enabled attr try enhancement enabled enhancement enabled resources class for name net sf cglib proxy invocation handler null catch class not found exception e enhancement enabled false vars client get delegate set enhancement enabled enhancement enabled string use statement namespaces attr attributes get property use statement namespaces vars use statement namespaces true equals use statement namespaces attr string max transactions attributes get property max transactions if max transactions null integer parse int max transactions 0 vars client get delegate set max transactions integer parse int max transactions string max requests attributes get property max requests if max requests null integer parse int max requests 0 vars client get delegate set max requests integer parse int max requests string max sessions attributes get property max sessions if max sessions null integer parse int max sessions 0 vars client get delegate set max sessions integer parse int max sessions access plan factory set bytecode enhancement enabled vars client get delegate is enhancement enabled string default statement timeout attributes get property default statement timeout if default statement timeout null try integer default timeout integer value of default statement timeout vars default statement timeout default timeout catch number format exception e throw new sql map exception specified default statement timeout is not a valid integer addsettingsnodelets addnodelet sqlmapconfig errorctx setactivity nodeletutils parseattributes classinfocacheenabledattr getproperty classinfocacheenabled classinfocacheenabled classinfocacheenabledattr classinfocacheenabledattr classinfo setcacheenabled classinfocacheenabled lazyloadingenabledattr getproperty lazyloadingenabled lazyloadingenabled lazyloadingenabledattr lazyloadingenabledattr getdelegate setlazyloadingenabled lazyloadingenabled statementcachingenabledattr getproperty statementcachingenabled statementcachingenabled statementcachingenabledattr statementcachingenabledattr getdelegate setstatementcacheenabled statementcachingenabled cachemodelsenabledattr getproperty cachemodelsenabled cachemodelsenabled cachemodelsenabledattr cachemodelsenabledattr getdelegate setcachemodelsenabled cachemodelsenabled enhancementenabledattr getproperty enhancementenabled enhancementenabled enhancementenabledattr enhancementenabledattr enhancementenabled enhancementenabled classforname invocationhandler classnotfoundexception enhancementenabled getdelegate setenhancementenabled enhancementenabled usestatementnamespacesattr getproperty usestatementnamespaces usestatementnamespaces usestatementnamespacesattr maxtransactions getproperty maxtransactions maxtransactions parseint maxtransactions getdelegate setmaxtransactions parseint maxtransactions maxrequests getproperty maxrequests maxrequests parseint maxrequests getdelegate setmaxrequests parseint maxrequests maxsessions getproperty maxsessions maxsessions parseint maxsessions getdelegate setmaxsessions parseint maxsessions accessplanfactory setbytecodeenhancementenabled getdelegate isenhancementenabled defaultstatementtimeout getproperty defaultstatementtimeout defaultstatementtimeout defaulttimeout valueof defaultstatementtimeout defaultstatementtimeout defaulttimeout numberformatexception sqlmapexception defaultstatementtimeout parser add nodelet sql map config settings new nodelet public void process node node throws exception vars error ctx set activity loading settings properties properties attributes nodelet utils parse attributes node vars properties string class info cache enabled attr attributes get property class info cache enabled boolean class info cache enabled class info cache enabled attr null true equals class info cache enabled attr class info set cache enabled class info cache enabled string lazy loading enabled attr attributes get property lazy loading enabled boolean lazy loading enabled lazy loading enabled attr null true equals lazy loading enabled attr vars client get delegate set lazy loading enabled lazy loading enabled string statement caching enabled attr attributes get property statement caching enabled boolean statement caching enabled statement caching enabled attr null true equals statement caching enabled attr vars client get delegate set statement cache enabled statement caching enabled string cache models enabled attr attributes get property cache models enabled boolean cache models enabled cache models enabled attr null true equals cache models enabled attr vars client get delegate set cache models enabled cache models enabled string enhancement enabled attr attributes get property enhancement enabled boolean enhancement enabled enhancement enabled attr null true equals enhancement enabled attr try enhancement enabled enhancement enabled resources class for name net sf cglib proxy invocation handler null catch class not found exception e enhancement enabled false vars client get delegate set enhancement enabled enhancement enabled string use statement namespaces attr attributes get property use statement namespaces vars use statement namespaces true equals use statement namespaces attr string max transactions attributes get property max transactions if max transactions null integer parse int max transactions 0 vars client get delegate set max transactions integer parse int max transactions string max requests attributes get property max requests if max requests null integer parse int max requests 0 vars client get delegate set max requests integer parse int max requests string max sessions attributes get property max sessions if max sessions null integer parse int max sessions 0 vars client get delegate set max sessions integer parse int max sessions access plan factory set bytecode enhancement enabled vars client get delegate is enhancement enabled string default statement timeout attributes get property default statement timeout if default statement timeout null try integer default timeout integer value of default statement timeout vars default statement timeout default timeout catch number format exception e throw new sql map exception specified default statement timeout is not a valid integer addnodelet sqlmapconfig errorctx setactivity nodeletutils parseattributes classinfocacheenabledattr getproperty classinfocacheenabled classinfocacheenabled classinfocacheenabledattr classinfocacheenabledattr classinfo setcacheenabled classinfocacheenabled lazyloadingenabledattr getproperty lazyloadingenabled lazyloadingenabled lazyloadingenabledattr lazyloadingenabledattr getdelegate setlazyloadingenabled lazyloadingenabled statementcachingenabledattr getproperty statementcachingenabled statementcachingenabled statementcachingenabledattr statementcachingenabledattr getdelegate setstatementcacheenabled statementcachingenabled cachemodelsenabledattr getproperty cachemodelsenabled cachemodelsenabled cachemodelsenabledattr cachemodelsenabledattr getdelegate setcachemodelsenabled cachemodelsenabled enhancementenabledattr getproperty enhancementenabled enhancementenabled enhancementenabledattr enhancementenabledattr enhancementenabled enhancementenabled classforname invocationhandler classnotfoundexception enhancementenabled getdelegate setenhancementenabled enhancementenabled usestatementnamespacesattr getproperty usestatementnamespaces usestatementnamespaces usestatementnamespacesattr maxtransactions getproperty maxtransactions maxtransactions parseint maxtransactions getdelegate setmaxtransactions parseint maxtransactions maxrequests getproperty maxrequests maxrequests parseint maxrequests getdelegate setmaxrequests parseint maxrequests maxsessions getproperty maxsessions maxsessions parseint maxsessions getdelegate setmaxsessions parseint maxsessions accessplanfactory setbytecodeenhancementenabled getdelegate isenhancementenabled defaultstatementtimeout getproperty defaultstatementtimeout defaultstatementtimeout defaulttimeout valueof defaultstatementtimeout defaultstatementtimeout defaulttimeout numberformatexception sqlmapexception defaultstatementtimeout private void add type alias nodelets parser add nodelet sql map config type alias new nodelet public void process node node throws exception properties prop nodelet utils parse attributes node vars properties string alias prop get property alias string type prop get property type vars type handler factory put type alias alias type addtypealiasnodelets addnodelet sqlmapconfig typealias nodeletutils parseattributes getproperty getproperty typehandlerfactory puttypealias parser add nodelet sql map config type alias new nodelet public void process node node throws exception properties prop nodelet utils parse attributes node vars properties string alias prop get property alias string type prop get property type vars type handler factory put type alias alias type addnodelet sqlmapconfig typealias nodeletutils parseattributes getproperty getproperty typehandlerfactory puttypealias private void add type handler nodelets parser add nodelet sql map config type handler new nodelet public void process node node throws exception vars error ctx set activity building a building custom type handler try type handler factory type handler factory vars client get delegate get type handler factory properties prop nodelet utils parse attributes node vars properties string jdbc type prop get property jdbc type string java type prop get property java type string callback prop get property callback callback type handler factory resolve alias callback java type type handler factory resolve alias java type vars error ctx set more info check the callback attribute callback must be a classname type handler type handler object impl resources class for name callback new instance if impl instanceof type handler callback type handler new custom type handler type handler callback impl else if impl instanceof type handler type handler type handler impl else throw new runtime exception the class is not a valid implementation of type handler or type handler callback vars error ctx set more info check the java type attribute java type must be a classname or the jdbc type jdbc type must be a jdbc type name if jdbc type null jdbc type length 0 type handler factory register resources class for name java type jdbc type type handler else type handler factory register resources class for name java type type handler catch exception e throw new sql map exception error registering occurred cause e e vars error ctx set more info null vars error ctx set object id null addtypehandlernodelets addnodelet sqlmapconfig typehandler errorctx setactivity typehandlerfactory typehandlerfactory getdelegate gettypehandlerfactory nodeletutils parseattributes jdbctype getproperty jdbctype javatype getproperty javatype getproperty typehandlerfactory resolvealias javatype typehandlerfactory resolvealias javatype errorctx setmoreinfo typehandler typehandler classforname newinstance typehandlercallback typehandler customtypehandler typehandlercallback typehandler typehandler typehandler runtimeexception typehandler typehandlercallback errorctx setmoreinfo javatype javatype jdbctype jdbctype jdbctype jdbctype typehandlerfactory classforname javatype jdbctype typehandler typehandlerfactory classforname javatype typehandler sqlmapexception errorctx setmoreinfo errorctx setobjectid parser add nodelet sql map config type handler new nodelet public void process node node throws exception vars error ctx set activity building a building custom type handler try type handler factory type handler factory vars client get delegate get type handler factory properties prop nodelet utils parse attributes node vars properties string jdbc type prop get property jdbc type string java type prop get property java type string callback prop get property callback callback type handler factory resolve alias callback java type type handler factory resolve alias java type vars error ctx set more info check the callback attribute callback must be a classname type handler type handler object impl resources class for name callback new instance if impl instanceof type handler callback type handler new custom type handler type handler callback impl else if impl instanceof type handler type handler type handler impl else throw new runtime exception the class is not a valid implementation of type handler or type handler callback vars error ctx set more info check the java type attribute java type must be a classname or the jdbc type jdbc type must be a jdbc type name if jdbc type null jdbc type length 0 type handler factory register resources class for name java type jdbc type type handler else type handler factory register resources class for name java type type handler catch exception e throw new sql map exception error registering occurred cause e e vars error ctx set more info null vars error ctx set object id null addnodelet sqlmapconfig typehandler errorctx setactivity typehandlerfactory typehandlerfactory getdelegate gettypehandlerfactory nodeletutils parseattributes jdbctype getproperty jdbctype javatype getproperty javatype getproperty typehandlerfactory resolvealias javatype typehandlerfactory resolvealias javatype errorctx setmoreinfo typehandler typehandler classforname newinstance typehandlercallback typehandler customtypehandler typehandlercallback typehandler typehandler typehandler runtimeexception typehandler typehandlercallback errorctx setmoreinfo javatype javatype jdbctype jdbctype jdbctype jdbctype typehandlerfactory classforname javatype jdbctype typehandler typehandlerfactory classforname javatype typehandler sqlmapexception errorctx setmoreinfo errorctx setobjectid private void add transaction manager nodelets parser add nodelet sql map config transaction manager end new nodelet public void process node node throws exception vars error ctx set activity configuring the transaction manager properties attributes nodelet utils parse attributes node vars properties string type attributes get property type type vars type handler factory resolve alias type transaction manager tx manager null try vars error ctx set more info check the transaction manager type or class transaction config config transaction config resources instantiate type config set data source vars data source config set maximum concurrent transactions vars client get delegate get max transactions vars error ctx set more info check the transactio nmanager properties or configuration config initialize vars tx props vars error ctx set more info null tx manager new transaction manager config tx manager set force commit true equals attributes get property commit required catch exception e if e instanceof sql map exception throw sql map exception e else throw new sql map exception error initializing transaction manager could not instantiate transaction config cause e e vars client get delegate set tx manager tx manager parser add nodelet sql map config transaction manager property new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties string name attributes get property name string value nodelet utils parse property tokens attributes get property value vars properties vars tx props set property name value parser add nodelet sql map config transaction manager data source new nodelet public void process node node throws exception vars ds props new properties parser add nodelet sql map config transaction manager data source end new nodelet public void process node node throws exception vars error ctx set activity configuring the data source properties attributes nodelet utils parse attributes node vars properties string type attributes get property type type vars type handler factory resolve alias type try vars error ctx set more info check the data source type or class data source factory ds factory data source factory resources instantiate type vars error ctx set more info check the data source properties or configuration ds factory initialize vars ds props vars data source ds factory get data source vars error ctx set more info null catch exception e if e instanceof sql map exception throw sql map exception e else throw new sql map exception error initializing data source could not instantiate data source factory cause e e parser add nodelet sql map config transaction manager data source property new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties string name attributes get property name string value nodelet utils parse property tokens attributes get property value vars properties vars ds props set property name value addtransactionmanagernodelets addnodelet sqlmapconfig transactionmanager errorctx setactivity nodeletutils parseattributes getproperty typehandlerfactory resolvealias transactionmanager txmanager errorctx setmoreinfo transactionconfig transactionconfig setdatasource datasource setmaximumconcurrenttransactions getdelegate getmaxtransactions errorctx setmoreinfo txprops errorctx setmoreinfo txmanager transactionmanager txmanager setforcecommit getproperty commitrequired sqlmapexception sqlmapexception sqlmapexception transactionmanager transactionconfig getdelegate settxmanager txmanager addnodelet sqlmapconfig transactionmanager nodeletutils parseattributes getproperty nodeletutils parsepropertytokens getproperty txprops setproperty addnodelet sqlmapconfig transactionmanager datasource dsprops addnodelet sqlmapconfig transactionmanager datasource errorctx setactivity nodeletutils parseattributes getproperty typehandlerfactory resolvealias errorctx setmoreinfo datasourcefactory dsfactory datasourcefactory errorctx setmoreinfo dsfactory dsprops datasource dsfactory getdatasource errorctx setmoreinfo sqlmapexception sqlmapexception sqlmapexception datasource datasourcefactory addnodelet sqlmapconfig transactionmanager datasource nodeletutils parseattributes getproperty nodeletutils parsepropertytokens getproperty dsprops setproperty parser add nodelet sql map config transaction manager end new nodelet public void process node node throws exception vars error ctx set activity configuring the transaction manager properties attributes nodelet utils parse attributes node vars properties string type attributes get property type type vars type handler factory resolve alias type transaction manager tx manager null try vars error ctx set more info check the transaction manager type or class transaction config config transaction config resources instantiate type config set data source vars data source config set maximum concurrent transactions vars client get delegate get max transactions vars error ctx set more info check the transactio nmanager properties or configuration config initialize vars tx props vars error ctx set more info null tx manager new transaction manager config tx manager set force commit true equals attributes get property commit required catch exception e if e instanceof sql map exception throw sql map exception e else throw new sql map exception error initializing transaction manager could not instantiate transaction config cause e e vars client get delegate set tx manager tx manager addnodelet sqlmapconfig transactionmanager errorctx setactivity nodeletutils parseattributes getproperty typehandlerfactory resolvealias transactionmanager txmanager errorctx setmoreinfo transactionconfig transactionconfig setdatasource datasource setmaximumconcurrenttransactions getdelegate getmaxtransactions errorctx setmoreinfo txprops errorctx setmoreinfo txmanager transactionmanager txmanager setforcecommit getproperty commitrequired sqlmapexception sqlmapexception sqlmapexception transactionmanager transactionconfig getdelegate settxmanager txmanager parser add nodelet sql map config transaction manager property new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties string name attributes get property name string value nodelet utils parse property tokens attributes get property value vars properties vars tx props set property name value addnodelet sqlmapconfig transactionmanager nodeletutils parseattributes getproperty nodeletutils parsepropertytokens getproperty txprops setproperty parser add nodelet sql map config transaction manager data source new nodelet public void process node node throws exception vars ds props new properties addnodelet sqlmapconfig transactionmanager datasource dsprops parser add nodelet sql map config transaction manager data source end new nodelet public void process node node throws exception vars error ctx set activity configuring the data source properties attributes nodelet utils parse attributes node vars properties string type attributes get property type type vars type handler factory resolve alias type try vars error ctx set more info check the data source type or class data source factory ds factory data source factory resources instantiate type vars error ctx set more info check the data source properties or configuration ds factory initialize vars ds props vars data source ds factory get data source vars error ctx set more info null catch exception e if e instanceof sql map exception throw sql map exception e else throw new sql map exception error initializing data source could not instantiate data source factory cause e e addnodelet sqlmapconfig transactionmanager datasource errorctx setactivity nodeletutils parseattributes getproperty typehandlerfactory resolvealias errorctx setmoreinfo datasourcefactory dsfactory datasourcefactory errorctx setmoreinfo dsfactory dsprops datasource dsfactory getdatasource errorctx setmoreinfo sqlmapexception sqlmapexception sqlmapexception datasource datasourcefactory parser add nodelet sql map config transaction manager data source property new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties string name attributes get property name string value nodelet utils parse property tokens attributes get property value vars properties vars ds props set property name value addnodelet sqlmapconfig transactionmanager datasource nodeletutils parseattributes getproperty nodeletutils parsepropertytokens getproperty dsprops setproperty protected void add sql map nodelets parser add nodelet sql map config sql map new nodelet public void process node node throws exception vars error ctx set activity loading the sql map resource properties attributes nodelet utils parse attributes node vars properties string resource attributes get property resource string url attributes get property url if using streams input stream input stream null if resource null vars error ctx set resource resource input stream resources get resource as stream resource else if url null vars error ctx set resource url input stream resources get url as stream url else throw new sql map exception the sql map element requires either a resource or a url attribute if vars sql map conv null input stream vars sql map conv convert xml input stream new sql map parser vars parse input stream else reader reader null if resource null vars error ctx set resource resource reader resources get resource as reader resource else if url null vars error ctx set resource url reader resources get url as reader url else throw new sql map exception the sql map element requires either a resource or a url attribute if vars sql map conv null reader vars sql map conv convert xml reader new sql map parser vars parse reader addsqlmapnodelets addnodelet sqlmapconfig sqlmap errorctx setactivity nodeletutils parseattributes getproperty getproperty usingstreams inputstream inputstream errorctx setresource inputstream getresourceasstream errorctx setresource inputstream geturlasstream sqlmapexception sqlmap sqlmapconv inputstream sqlmapconv convertxml inputstream sqlmapparser inputstream errorctx setresource getresourceasreader errorctx setresource geturlasreader sqlmapexception sqlmap sqlmapconv sqlmapconv convertxml sqlmapparser parser add nodelet sql map config sql map new nodelet public void process node node throws exception vars error ctx set activity loading the sql map resource properties attributes nodelet utils parse attributes node vars properties string resource attributes get property resource string url attributes get property url if using streams input stream input stream null if resource null vars error ctx set resource resource input stream resources get resource as stream resource else if url null vars error ctx set resource url input stream resources get url as stream url else throw new sql map exception the sql map element requires either a resource or a url attribute if vars sql map conv null input stream vars sql map conv convert xml input stream new sql map parser vars parse input stream else reader reader null if resource null vars error ctx set resource resource reader resources get resource as reader resource else if url null vars error ctx set resource url reader resources get url as reader url else throw new sql map exception the sql map element requires either a resource or a url attribute if vars sql map conv null reader vars sql map conv convert xml reader new sql map parser vars parse reader addnodelet sqlmapconfig sqlmap errorctx setactivity nodeletutils parseattributes getproperty getproperty usingstreams inputstream inputstream errorctx setresource inputstream getresourceasstream errorctx setresource inputstream geturlasstream sqlmapexception sqlmap sqlmapconv inputstream sqlmapconv convertxml inputstream sqlmapparser inputstream errorctx setresource getresourceasreader errorctx setresource geturlasreader sqlmapexception sqlmap sqlmapconv sqlmapconv convertxml sqlmapparser private void add result object factory nodelets parser add nodelet sql map config result object factory new nodelet public void process node node throws exception vars error ctx set activity configuring the result object factory properties attributes nodelet utils parse attributes node vars properties string type attributes get property type result object factory rof try rof result object factory resources instantiate type vars delegate set result object factory rof catch exception e throw new sql map exception error instantiating result object factory type e parser add nodelet sql map config result object factory property new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties string name attributes get property name string value nodelet utils parse property tokens attributes get property value vars properties vars delegate get result object factory set property name value addresultobjectfactorynodelets addnodelet sqlmapconfig resultobjectfactory errorctx setactivity nodeletutils parseattributes getproperty resultobjectfactory resultobjectfactory setresultobjectfactory sqlmapexception resultobjectfactory addnodelet sqlmapconfig resultobjectfactory nodeletutils parseattributes getproperty nodeletutils parsepropertytokens getproperty getresultobjectfactory setproperty parser add nodelet sql map config result object factory new nodelet public void process node node throws exception vars error ctx set activity configuring the result object factory properties attributes nodelet utils parse attributes node vars properties string type attributes get property type result object factory rof try rof result object factory resources instantiate type vars delegate set result object factory rof catch exception e throw new sql map exception error instantiating result object factory type e addnodelet sqlmapconfig resultobjectfactory errorctx setactivity nodeletutils parseattributes getproperty resultobjectfactory resultobjectfactory setresultobjectfactory sqlmapexception resultobjectfactory parser add nodelet sql map config result object factory property new nodelet public void process node node throws exception properties attributes nodelet utils parse attributes node vars properties string name attributes get property name string value nodelet utils parse property tokens attributes get property value vars properties vars delegate get result object factory set property name value addnodelet sqlmapconfig resultobjectfactory nodeletutils parseattributes getproperty nodeletutils parsepropertytokens getproperty getresultobjectfactory setproperty private void register default type aliases transaction aliases vars type handler factory put type alias jdbc jdbc transaction config class get name vars type handler factory put type alias jta jta transaction config class get name vars type handler factory put type alias external external transaction config class get name data source aliases vars type handler factory put type alias simple simple data source factory class get name vars type handler factory put type alias dbcp dbcp data source factory class get name vars type handler factory put type alias jndi jndi data source factory class get name cache aliases vars type handler factory put type alias fifo fifo cache controller class get name vars type handler factory put type alias lru lru cache controller class get name vars type handler factory put type alias memory memory cache controller class get name use a string for os cache to avoid unnecessary loading of properties upon init vars type handler factory put type alias oscache com ibatis sqlmap engine cache oscache os cache controller type alias es vars type handler factory put type alias dom dom type marker class get name vars type handler factory put type alias dom collection dom collection type marker class get name vars type handler factory put type alias xml xml type marker class get name vars type handler factory put type alias xml collection xml collection type marker class get name registerdefaulttypealiases typehandlerfactory puttypealias jdbctransactionconfig getname typehandlerfactory puttypealias jtatransactionconfig getname typehandlerfactory puttypealias externaltransactionconfig getname typehandlerfactory puttypealias simpledatasourcefactory getname typehandlerfactory puttypealias dbcpdatasourcefactory getname typehandlerfactory puttypealias jndidatasourcefactory getname typehandlerfactory puttypealias fifocachecontroller getname typehandlerfactory puttypealias lrucachecontroller getname typehandlerfactory puttypealias memorycachecontroller getname oscache typehandlerfactory puttypealias oscachecontroller aliases typehandlerfactory puttypealias domtypemarker getname typehandlerfactory puttypealias domcollection domcollectiontypemarker getname typehandlerfactory puttypealias xmltypemarker getname typehandlerfactory puttypealias xmlcollection xmlcollectiontypemarker getname public paginated data list sql map executor sql map executor string statement name object parameter object int page size throws sql exception this sql map executor sql map executor this statement name statement name this parameter object parameter object this page size page size this index 0 page to 0 paginateddatalist sqlmapexecutor sqlmapexecutor statementname parameterobject pagesize sqlexception sqlmapexecutor sqlmapexecutor statementname statementname parameterobject parameterobject pagesize pagesize pageto private void page forward try prev page list current page list current page list next page list next page list get list index 1 page size catch sql exception e throw new runtime exception unexpected error while repaginating paged list cause e e pageforward prevpagelist currentpagelist currentpagelist nextpagelist nextpagelist getlist pagesize sqlexception runtimeexception private void page back try next page list current page list current page list prev page list if index 0 prev page list get list index 1 page size else prev page list new array list catch sql exception e throw new runtime exception unexpected error while repaginating paged list cause e e pageback nextpagelist currentpagelist currentpagelist prevpagelist prevpagelist getlist pagesize prevpagelist arraylist sqlexception runtimeexception private void safe page to int idx try page to idx catch sql exception e throw new runtime exception unexpected error while repaginating paged list cause e e safepageto pageto sqlexception runtimeexception public void page to int idx throws sql exception index idx list list if idx 1 list get list idx page size 2 else list get list idx 1 page size 3 if list size 1 prev page list new array list 0 current page list new array list 0 next page list new array list 0 else if idx 1 prev page list new array list 0 if list size page size current page list list sub list 0 list size next page list new array list 0 else current page list list sub list 0 page size next page list list sub list page size list size else if list size page size prev page list list sub list 0 list size current page list new array list 0 next page list new array list 0 else if list size page size 2 prev page list list sub list 0 page size current page list list sub list page size list size next page list new array list 0 else prev page list list sub list 0 page size current page list list sub list page size page size 2 next page list list sub list page size 2 list size pageto sqlexception getlist pagesize getlist pagesize prevpagelist arraylist currentpagelist arraylist nextpagelist arraylist prevpagelist arraylist pagesize currentpagelist sublist nextpagelist arraylist currentpagelist sublist pagesize nextpagelist sublist pagesize pagesize prevpagelist sublist currentpagelist arraylist nextpagelist arraylist pagesize prevpagelist sublist pagesize currentpagelist sublist pagesize nextpagelist arraylist prevpagelist sublist pagesize currentpagelist sublist pagesize pagesize nextpagelist sublist pagesize private list get list int idx int local page size throws sql exception return sql map executor query for list statement name parameter object idx page size local page size getlist localpagesize sqlexception sqlmapexecutor queryforlist statementname parameterobject pagesize localpagesize public boolean next page if is next page available index page forward return true else return false nextpage isnextpageavailable pageforward public boolean previous page if is previous page available index page back return true else return false previouspage ispreviouspageavailable pageback public void goto page int page number safe page to page number gotopage pagenumber safepageto pagenumber public int get page size return page size getpagesize pagesize public boolean is first page return index 0 isfirstpage public boolean is middle page return is first page is last page ismiddlepage isfirstpage islastpage public boolean is last page return next page list size 1 islastpage nextpagelist public boolean is next page available return next page list size 0 isnextpageavailable nextpagelist public boolean is previous page available return prev page list size 0 ispreviouspageavailable prevpagelist public int size return current page list size currentpagelist public boolean is empty return current page list is empty isempty currentpagelist isempty public boolean contains object o return current page list contains o currentpagelist public iterator iterator return current page list iterator currentpagelist public object to array return current page list to array toarray currentpagelist toarray public object to array object a return current page list to array a toarray currentpagelist toarray public boolean contains all collection c return current page list contains all c containsall currentpagelist containsall public object get int index return current page list get index currentpagelist public int index of object o return current page list index of o indexof currentpagelist indexof public int last index of object o return current page list last index of o lastindexof currentpagelist lastindexof public list iterator list iterator return current page list list iterator listiterator listiterator currentpagelist listiterator public list iterator list iterator int index return current page list list iterator index listiterator listiterator currentpagelist listiterator public list sub list int from index int to index return current page list sub list from index to index sublist fromindex toindex currentpagelist sublist fromindex toindex public boolean add object o return current page list add o currentpagelist public boolean remove object o return current page list remove o currentpagelist public boolean add all collection c return current page list add all c addall currentpagelist addall public boolean add all int index collection c return current page list add all index c addall currentpagelist addall public boolean remove all collection c return current page list remove all c removeall currentpagelist removeall public boolean retain all collection c return current page list retain all c retainall currentpagelist retainall public void clear current page list clear currentpagelist public object set int index object element return current page list set index element currentpagelist public void add int index object element current page list add index element currentpagelist public object remove int index return current page list remove index currentpagelist public int get page index return index getpageindex private hash map map new hash map 0 public object get attribute object key return map get key hashmap hashmap getattribute public void set attribute object key object value map put key value setattribute public void reset map clear public class is greater than tag handler extends conditional tag handler public boolean is condition sql tag context ctx sql tag tag object parameter object long x compare ctx tag parameter object return x 0 x conditional tag handler not comparable isgreaterthantaghandler conditionaltaghandler iscondition sqltagcontext sqltag parameterobject parameterobject conditionaltaghandler not_comparable simple constructor public sql map exception sqlmapexception constructor to create exception with a message param msg a message to associate with the exception public sql map exception string msg super msg sqlmapexception constructor to create exception to wrap another exception param cause the real cause of the exception public sql map exception throwable cause super cause sqlmapexception constructor to create exception to wrap another exception and pass a message param msg the message param cause the real cause of the exception public sql map exception string msg throwable cause super msg cause sqlmapexception constructor to allow passing in a map of properties for configuration param props the configuration parameters public simple data source map props initialize props simpledatasource private void initialize map props try string prop pool ping query null if props null throw new runtime exception simple data source the properties map passed to the initializer was null if props contains key prop jdbc driver props contains key prop jdbc url props contains key prop jdbc username props contains key prop jdbc password throw new runtime exception simple data source some properties were not set else jdbc driver string props get prop jdbc driver jdbc url string props get prop jdbc url jdbc username string props get prop jdbc username jdbc password string props get prop jdbc password pool maximum active connections props contains key prop pool max active conn integer parse int string props get prop pool max active conn 10 pool maximum idle connections props contains key prop pool max idle conn integer parse int string props get prop pool max idle conn 5 pool maximum checkout time props contains key prop pool max checkout time integer parse int string props get prop pool max checkout time 20000 pool time to wait props contains key prop pool time to wait integer parse int string props get prop pool time to wait 20000 pool ping enabled props contains key prop pool ping enabled boolean value of string props get prop pool ping enabled boolean value prop pool ping query string props get prop pool ping query pool ping query props contains key prop pool ping query prop pool ping query no ping query set pool ping connections older than props contains key prop pool ping conn older than integer parse int string props get prop pool ping conn older than 0 pool ping connections not used for props contains key prop pool ping conn not used for integer parse int string props get prop pool ping conn not used for 0 jdbc default auto commit props contains key prop jdbc default autocommit boolean value of string props get prop jdbc default autocommit boolean value use driver props false iterator prop iter props key set iterator driver props new properties driver props put user jdbc username driver props put password jdbc password while prop iter has next string name string prop iter next string value string props get name if name starts with add driver props prefix driver props put name substring add driver props prefix length value use driver props true expected connection type code assemble connection type code jdbc url jdbc username jdbc password resources instantiate jdbc driver if pool ping enabled props contains key prop pool ping query prop pool ping query trim length 0 throw new runtime exception simple data source property prop pool ping enabled is true but property prop pool ping query is not set correctly catch exception e log error simple data source error while loading properties cause e to string e throw new runtime exception simple data source error while loading properties cause e e prop_pool_ping_query runtimeexception simpledatasource containskey prop_jdbc_driver containskey prop_jdbc_url containskey prop_jdbc_username containskey prop_jdbc_password runtimeexception simpledatasource jdbcdriver prop_jdbc_driver jdbcurl prop_jdbc_url jdbcusername prop_jdbc_username jdbcpassword prop_jdbc_password poolmaximumactiveconnections containskey prop_pool_max_active_conn parseint prop_pool_max_active_conn poolmaximumidleconnections containskey prop_pool_max_idle_conn parseint prop_pool_max_idle_conn poolmaximumcheckouttime containskey prop_pool_max_checkout_time parseint prop_pool_max_checkout_time pooltimetowait containskey prop_pool_time_to_wait parseint prop_pool_time_to_wait poolpingenabled containskey prop_pool_ping_enabled valueof prop_pool_ping_enabled booleanvalue prop_pool_ping_query prop_pool_ping_query poolpingquery containskey prop_pool_ping_query prop_pool_ping_query poolpingconnectionsolderthan containskey prop_pool_ping_conn_older_than parseint prop_pool_ping_conn_older_than poolpingconnectionsnotusedfor containskey prop_pool_ping_conn_not_used_for parseint prop_pool_ping_conn_not_used_for jdbcdefaultautocommit containskey prop_jdbc_default_autocommit valueof prop_jdbc_default_autocommit booleanvalue usedriverprops propiter keyset driverprops driverprops jdbcusername driverprops jdbcpassword propiter hasnext propiter startswith add_driver_props_prefix driverprops add_driver_props_prefix_length usedriverprops expectedconnectiontypecode assembleconnectiontypecode jdbcurl jdbcusername jdbcpassword jdbcdriver poolpingenabled containskey prop_pool_ping_query prop_pool_ping_query runtimeexception simpledatasource prop_pool_ping_enabled prop_pool_ping_query simpledatasource tostring runtimeexception simpledatasource private int assemble connection type code string url string username string password return url username password hash code assembleconnectiontypecode hashcode see javax sql data source get connection public connection get connection throws sql exception return pop connection jdbc username jdbc password get proxy connection datasource getconnection getconnection sqlexception popconnection jdbcusername jdbcpassword getproxyconnection see javax sql data source get connection java lang string java lang string public connection get connection string username string password throws sql exception return pop connection username password get proxy connection datasource getconnection getconnection sqlexception popconnection getproxyconnection see javax sql data source set login timeout int public void set login timeout int login timeout throws sql exception driver manager set login timeout login timeout datasource setlogintimeout setlogintimeout logintimeout sqlexception drivermanager setlogintimeout logintimeout see javax sql data source get login timeout public int get login timeout throws sql exception return driver manager get login timeout datasource getlogintimeout getlogintimeout sqlexception drivermanager getlogintimeout see javax sql data source set log writer java io print writer public void set log writer print writer log writer throws sql exception driver manager set log writer log writer datasource setlogwriter printwriter setlogwriter printwriter logwriter sqlexception drivermanager setlogwriter logwriter see javax sql data source get log writer public print writer get log writer throws sql exception return driver manager get log writer datasource getlogwriter printwriter getlogwriter sqlexception drivermanager getlogwriter if a connection has not been used in this many milliseconds ping the database to make sure the connection is still good return the number of milliseconds of inactivity that will trigger a ping public int get pool ping connections not used for return pool ping connections not used for getpoolpingconnectionsnotusedfor poolpingconnectionsnotusedfor getter for the name of the jdbc driver class used return the name of the class public string get jdbc driver return jdbc driver getjdbcdriver jdbcdriver getter of the jdbc url used return the jdbc url public string get jdbc url return jdbc url getjdbcurl jdbcurl getter for the jdbc user name used return the user name public string get jdbc username return jdbc username getjdbcusername jdbcusername getter for the jdbc password used return the password public string get jdbc password return jdbc password getjdbcpassword jdbcpassword getter for the maximum number of active connections return the maximum number of active connections public int get pool maximum active connections return pool maximum active connections getpoolmaximumactiveconnections poolmaximumactiveconnections getter for the maximum number of idle connections return the maximum number of idle connections public int get pool maximum idle connections return pool maximum idle connections getpoolmaximumidleconnections poolmaximumidleconnections getter for the maximum time a connection can be used before it may be given away again return the maximum time public int get pool maximum checkout time return pool maximum checkout time getpoolmaximumcheckouttime poolmaximumcheckouttime getter for the time to wait before retrying to get a connection return the time to wait public int get pool time to wait return pool time to wait getpooltimetowait pooltimetowait getter for the query to be used to check a connection return the query public string get pool ping query return pool ping query getpoolpingquery poolpingquery getter to tell if we should use the ping query return true if we need to check a connection before using it public boolean is pool ping enabled return pool ping enabled ispoolpingenabled poolpingenabled getter for the age of connections that should be pinged before using return the age public int get pool ping connections older than return pool ping connections older than getpoolpingconnectionsolderthan poolpingconnectionsolderthan private int get expected connection type code return expected connection type code getexpectedconnectiontypecode expectedconnectiontypecode getter for the number of connection requests made return the number of connection requests made public long get request count synchronized pool lock return request count getrequestcount pool_lock requestcount getter for the average time required to get a connection to the database return the average time public long get average request time synchronized pool lock return request count 0 0 accumulated request time request count getaveragerequesttime pool_lock requestcount accumulatedrequesttime requestcount getter for the average time spent waiting for connections that were in use return the average time public long get average wait time synchronized pool lock return had to wait count 0 0 accumulated wait time had to wait count getaveragewaittime pool_lock hadtowaitcount accumulatedwaittime hadtowaitcount getter for the number of requests that had to wait for connections that were in use return the number of requests that had to wait public long get had to wait count synchronized pool lock return had to wait count gethadtowaitcount pool_lock hadtowaitcount getter for the number of invalid connections that were found in the pool return the number of invalid connections public long get bad connection count synchronized pool lock return bad connection count getbadconnectioncount pool_lock badconnectioncount getter for the number of connections that were claimed before they were returned return the number of connections public long get claimed overdue connection count synchronized pool lock return claimed overdue connection count getclaimedoverdueconnectioncount pool_lock claimedoverdueconnectioncount getter for the average age of overdue connections return the average age public long get average overdue checkout time synchronized pool lock return claimed overdue connection count 0 0 accumulated checkout time of overdue connections claimed overdue connection count getaverageoverduecheckouttime pool_lock claimedoverdueconnectioncount accumulatedcheckouttimeofoverdueconnections claimedoverdueconnectioncount getter for the average age of a connection checkout return the average age public long get average checkout time synchronized pool lock return request count 0 0 accumulated checkout time request count getaveragecheckouttime pool_lock requestcount accumulatedcheckouttime requestcount returns the status of the connection pool return the status public string get status string buffer buffer new string buffer buffer append n buffer append n jdbc driver append jdbc driver buffer append n jdbc url append jdbc url buffer append n jdbc username append jdbc username buffer append n jdbc password append jdbc password null null buffer append n pool max active connections append pool maximum active connections buffer append n pool max idle connections append pool maximum idle connections buffer append n pool max checkout time pool maximum checkout time buffer append n pool time to wait pool time to wait buffer append n pool ping enabled pool ping enabled buffer append n pool ping query pool ping query buffer append n pool ping connections older than pool ping connections older than buffer append n pool ping connections not used for pool ping connections not used for buffer append n buffer append n active connections active connections size buffer append n idle connections idle connections size buffer append n request count get request count buffer append n average request time get average request time buffer append n average checkout time get average checkout time buffer append n claimed overdue get claimed overdue connection count buffer append n average overdue checkout time get average overdue checkout time buffer append n had to wait get had to wait count buffer append n average wait time get average wait time buffer append n bad connection count get bad connection count buffer append n return buffer to string getstatus stringbuffer stringbuffer jdbcdriver jdbcdriver jdbcurl jdbcurl jdbcusername jdbcusername jdbcpassword jdbcpassword poolmaxactiveconnections poolmaximumactiveconnections poolmaxidleconnections poolmaximumidleconnections poolmaxcheckouttime poolmaximumcheckouttime pooltimetowait pooltimetowait poolpingenabled poolpingenabled poolpingquery poolpingquery poolpingconnectionsolderthan poolpingconnectionsolderthan poolpingconnectionsnotusedfor poolpingconnectionsnotusedfor activeconnections activeconnections idleconnections idleconnections requestcount getrequestcount averagerequesttime getaveragerequesttime averagecheckouttime getaveragecheckouttime claimedoverdue getclaimedoverdueconnectioncount averageoverduecheckouttime getaverageoverduecheckouttime hadtowait gethadtowaitcount averagewaittime getaveragewaittime badconnectioncount getbadconnectioncount tostring closes all of the connections in the pool public void force close all synchronized pool lock for int i active connections size i 0 i try simple pooled connection conn simple pooled connection active connections remove i 1 conn invalidate connection real conn conn get real connection if real conn get auto commit real conn rollback real conn close catch exception e ignore for int i idle connections size i 0 i try simple pooled connection conn simple pooled connection idle connections remove i 1 conn invalidate connection real conn conn get real connection if real conn get auto commit real conn rollback real conn close catch exception e ignore if log is debug enabled log debug simple data source forcefully closed removed all connections forcecloseall pool_lock activeconnections simplepooledconnection simplepooledconnection activeconnections realconn getrealconnection realconn getautocommit realconn realconn idleconnections simplepooledconnection simplepooledconnection idleconnections realconn getrealconnection realconn getautocommit realconn realconn isdebugenabled simpledatasource private void push connection simple pooled connection conn throws sql exception synchronized pool lock active connections remove conn if conn is valid if idle connections size pool maximum idle connections conn get connection type code get expected connection type code accumulated checkout time conn get checkout time if conn get real connection get auto commit conn get real connection rollback simple pooled connection new conn new simple pooled connection conn get real connection this idle connections add new conn new conn set created timestamp conn get created timestamp new conn set last used timestamp conn get last used timestamp conn invalidate if log is debug enabled log debug returned connection new conn get real hash code to pool pool lock notify all else accumulated checkout time conn get checkout time if conn get real connection get auto commit conn get real connection rollback conn get real connection close if log is debug enabled log debug closed connection conn get real hash code conn invalidate else if log is debug enabled log debug a bad connection conn get real hash code attempted to return to the pool discarding connection bad connection count pushconnection simplepooledconnection sqlexception pool_lock activeconnections isvalid idleconnections poolmaximumidleconnections getconnectiontypecode getexpectedconnectiontypecode accumulatedcheckouttime getcheckouttime getrealconnection getautocommit getrealconnection simplepooledconnection newconn simplepooledconnection getrealconnection idleconnections newconn newconn setcreatedtimestamp getcreatedtimestamp newconn setlastusedtimestamp getlastusedtimestamp isdebugenabled newconn getrealhashcode pool_lock notifyall accumulatedcheckouttime getcheckouttime getrealconnection getautocommit getrealconnection getrealconnection isdebugenabled getrealhashcode isdebugenabled getrealhashcode badconnectioncount private simple pooled connection pop connection string username string password throws sql exception boolean counted wait false simple pooled connection conn null long t system current time millis int local bad connection count 0 while conn null synchronized pool lock if idle connections size 0 pool has available connection conn simple pooled connection idle connections remove 0 if log is debug enabled log debug checked out connection conn get real hash code from pool else pool does not have available connection if active connections size pool maximum active connections can create new connection if use driver props conn new simple pooled connection driver manager get connection jdbc url driver props this else conn new simple pooled connection driver manager get connection jdbc url jdbc username jdbc password this connection real conn conn get real connection if real conn get auto commit jdbc default auto commit real conn set auto commit jdbc default auto commit if log is debug enabled log debug created connection conn get real hash code else cannot create new connection simple pooled connection oldest active connection simple pooled connection active connections get 0 long longest checkout time oldest active connection get checkout time if longest checkout time pool maximum checkout time can claim overdue connection claimed overdue connection count accumulated checkout time of overdue connections longest checkout time accumulated checkout time longest checkout time active connections remove oldest active connection if oldest active connection get real connection get auto commit oldest active connection get real connection rollback conn new simple pooled connection oldest active connection get real connection this oldest active connection invalidate if log is debug enabled log debug claimed overdue connection conn get real hash code else must wait try if counted wait had to wait count counted wait true if log is debug enabled log debug waiting as long as pool time to wait milliseconds for connection long wt system current time millis pool lock wait pool time to wait accumulated wait time system current time millis wt catch interrupted exception e break if conn null if conn is valid if conn get real connection get auto commit conn get real connection rollback conn set connection type code assemble connection type code jdbc url username password conn set checkout timestamp system current time millis conn set last used timestamp system current time millis active connections add conn request count accumulated request time system current time millis t else if log is debug enabled log debug a bad connection conn get real hash code was returned from the pool getting another connection bad connection count local bad connection count conn null if local bad connection count pool maximum idle connections 3 if log is debug enabled log debug simple data source could not get a good connection to the database throw new sql exception simple data source could not get a good connection to the database if conn null if log is debug enabled log debug simple data source unknown severe error condition the connection pool returned a null connection throw new sql exception simple data source unknown severe error condition the connection pool returned a null connection return conn simplepooledconnection popconnection sqlexception countedwait simplepooledconnection currenttimemillis localbadconnectioncount pool_lock idleconnections simplepooledconnection idleconnections isdebugenabled getrealhashcode activeconnections poolmaximumactiveconnections usedriverprops simplepooledconnection drivermanager getconnection jdbcurl driverprops simplepooledconnection drivermanager getconnection jdbcurl jdbcusername jdbcpassword realconn getrealconnection realconn getautocommit jdbcdefaultautocommit realconn setautocommit jdbcdefaultautocommit isdebugenabled getrealhashcode simplepooledconnection oldestactiveconnection simplepooledconnection activeconnections longestcheckouttime oldestactiveconnection getcheckouttime longestcheckouttime poolmaximumcheckouttime claimedoverdueconnectioncount accumulatedcheckouttimeofoverdueconnections longestcheckouttime accumulatedcheckouttime longestcheckouttime activeconnections oldestactiveconnection oldestactiveconnection getrealconnection getautocommit oldestactiveconnection getrealconnection simplepooledconnection oldestactiveconnection getrealconnection oldestactiveconnection isdebugenabled getrealhashcode countedwait hadtowaitcount countedwait isdebugenabled pooltimetowait currenttimemillis pool_lock pooltimetowait accumulatedwaittime currenttimemillis interruptedexception isvalid getrealconnection getautocommit getrealconnection setconnectiontypecode assembleconnectiontypecode jdbcurl setcheckouttimestamp currenttimemillis setlastusedtimestamp currenttimemillis activeconnections requestcount accumulatedrequesttime currenttimemillis isdebugenabled getrealhashcode badconnectioncount localbadconnectioncount localbadconnectioncount poolmaximumidleconnections isdebugenabled simpledatasource sqlexception simpledatasource isdebugenabled simpledatasource sqlexception simpledatasource method to check to see if a connection is still usable param conn the connection to check return true if the connection is still usable private boolean ping connection simple pooled connection conn boolean result true try result conn get real connection is closed catch sql exception e if log is debug enabled log debug connection conn get real hash code is bad e get message result false if result if pool ping enabled if pool ping connections older than 0 conn get age pool ping connections older than pool ping connections not used for 0 conn get time elapsed since last use pool ping connections not used for try if log is debug enabled log debug testing connection conn get real hash code connection real conn conn get real connection statement statement real conn create statement result set rs statement execute query pool ping query rs close statement close if real conn get auto commit real conn rollback result true if log is debug enabled log debug connection conn get real hash code is good catch exception e log warn execution of ping query pool ping query failed e get message try conn get real connection close catch exception e2 ignore result false if log is debug enabled log debug connection conn get real hash code is bad e get message return result pingconnection simplepooledconnection getrealconnection isclosed sqlexception isdebugenabled getrealhashcode getmessage poolpingenabled poolpingconnectionsolderthan getage poolpingconnectionsolderthan poolpingconnectionsnotusedfor gettimeelapsedsincelastuse poolpingconnectionsnotusedfor isdebugenabled getrealhashcode realconn getrealconnection realconn createstatement resultset executequery poolpingquery realconn getautocommit realconn isdebugenabled getrealhashcode poolpingquery getmessage getrealconnection isdebugenabled getrealhashcode getmessage unwraps a pooled connection to get to the real connection param conn the pooled connection to unwrap return the real connection public static connection unwrap connection connection conn if conn instanceof simple pooled connection return simple pooled connection conn get real connection else return conn unwrapconnection simplepooledconnection simplepooledconnection getrealconnection protected void finalize throws throwable force close all forcecloseall constructor for simple pooled connection that uses the connection and simple data source passed in param connection the connection that is to be presented as a pooled connection param data source the data source that the connection is from public simple pooled connection connection connection simple data source data source this hash code connection hash code this real connection connection this data source data source this created timestamp system current time millis this last used timestamp system current time millis this valid true proxy connection connection proxy new proxy instance connection class get class loader ifaces this simplepooledconnection simpledatasource datasource datasource simplepooledconnection simpledatasource datasource hashcode hashcode realconnection datasource datasource createdtimestamp currenttimemillis lastusedtimestamp currenttimemillis proxyconnection newproxyinstance getclassloader invalidates the connection public void invalidate valid false method to see if the connection is usable return true if the connection is usable public boolean is valid return valid real connection null data source ping connection this isvalid realconnection datasource pingconnection getter for the real connection that this wraps return the connection public connection get real connection return real connection getrealconnection realconnection getter for the proxy for the connection return the proxy public connection get proxy connection return proxy connection getproxyconnection proxyconnection gets the hashcode of the real connection or 0 if it is null return the hashcode of the real connection or 0 if it is null public int get real hash code if real connection null return 0 else return real connection hash code getrealhashcode realconnection realconnection hashcode getter for the connection type based on url user password return the connection type public int get connection type code return connection type code getconnectiontypecode connectiontypecode setter for the connection type param connection type code the connection type public void set connection type code int connection type code this connection type code connection type code connectiontypecode setconnectiontypecode connectiontypecode connectiontypecode connectiontypecode getter for the time that the connection was created return the creation timestamp public long get created timestamp return created timestamp getcreatedtimestamp createdtimestamp setter for the time that the connection was created param created timestamp the timestamp public void set created timestamp long created timestamp this created timestamp created timestamp createdtimestamp setcreatedtimestamp createdtimestamp createdtimestamp createdtimestamp getter for the time that the connection was last used return the timestamp public long get last used timestamp return last used timestamp getlastusedtimestamp lastusedtimestamp setter for the time that the connection was last used param last used timestamp the timestamp public void set last used timestamp long last used timestamp this last used timestamp last used timestamp lastusedtimestamp setlastusedtimestamp lastusedtimestamp lastusedtimestamp lastusedtimestamp getter for the time since this connection was last used return the time since the last use public long get time elapsed since last use return system current time millis last used timestamp gettimeelapsedsincelastuse currenttimemillis lastusedtimestamp getter for the age of the connection return the age public long get age return system current time millis created timestamp getage currenttimemillis createdtimestamp getter for the timestamp that this connection was checked out return the timestamp public long get checkout timestamp return checkout timestamp getcheckouttimestamp checkouttimestamp setter for the timestamp that this connection was checked out param timestamp the timestamp public void set checkout timestamp long timestamp this checkout timestamp timestamp setcheckouttimestamp checkouttimestamp getter for the time that this connection has been checked out return the time public long get checkout time return system current time millis checkout timestamp getcheckouttime currenttimemillis checkouttimestamp private connection get valid connection if valid throw new runtime exception error accessing simple pooled connection connection is invalid return real connection getvalidconnection runtimeexception simplepooledconnection realconnection public int hash code return hash code hashcode hashcode allows comparing this connection to another param obj the other connection to test for equality see java lang object equals java lang object public boolean equals object obj if obj instanceof simple pooled connection return real connection hash code simple pooled connection obj real connection hash code else if obj instanceof connection return hash code obj hash code else return false simplepooledconnection realconnection hashcode simplepooledconnection realconnection hashcode hashcode hashcode required for invocation handler implementation param proxy not used param method the method to be executed param args the parameters to be passed to the method see java lang reflect invocation handler invoke java lang object java lang reflect method java lang object public object invoke object proxy method method object args throws throwable string method name method get name if close hash code method name hash code close equals method name data source push connection this return null else try return method invoke get valid connection args catch throwable t throw class info unwrap throwable t invocationhandler invocationhandler methodname getname hashcode methodname hashcode methodname datasource pushconnection getvalidconnection classinfo unwrapthrowable public statement create statement throws sql exception return get valid connection create statement createstatement sqlexception getvalidconnection createstatement public prepared statement prepare statement string sql throws sql exception return get valid connection prepare statement sql preparedstatement preparestatement sqlexception getvalidconnection preparestatement public callable statement prepare call string sql throws sql exception return get valid connection prepare call sql callablestatement preparecall sqlexception getvalidconnection preparecall public string nativesql string sql throws sql exception return get valid connection nativesql sql sqlexception getvalidconnection public void set auto commit boolean auto commit throws sql exception get valid connection set auto commit auto commit setautocommit autocommit sqlexception getvalidconnection setautocommit autocommit public boolean get auto commit throws sql exception return get valid connection get auto commit getautocommit sqlexception getvalidconnection getautocommit public void commit throws sql exception get valid connection commit sqlexception getvalidconnection public void rollback throws sql exception get valid connection rollback sqlexception getvalidconnection public void close throws sql exception data source push connection this sqlexception datasource pushconnection public boolean is closed throws sql exception return get valid connection is closed isclosed sqlexception getvalidconnection isclosed public database meta data get meta data throws sql exception return get valid connection get meta data databasemetadata getmetadata sqlexception getvalidconnection getmetadata public void set read only boolean read only throws sql exception get valid connection set read only read only setreadonly readonly sqlexception getvalidconnection setreadonly readonly public boolean is read only throws sql exception return get valid connection is read only isreadonly sqlexception getvalidconnection isreadonly public void set catalog string catalog throws sql exception get valid connection set catalog catalog setcatalog sqlexception getvalidconnection setcatalog public string get catalog throws sql exception return get valid connection get catalog getcatalog sqlexception getvalidconnection getcatalog public void set transaction isolation int level throws sql exception get valid connection set transaction isolation level settransactionisolation sqlexception getvalidconnection settransactionisolation public int get transaction isolation throws sql exception return get valid connection get transaction isolation gettransactionisolation sqlexception getvalidconnection gettransactionisolation public sql warning get warnings throws sql exception return get valid connection get warnings sqlwarning getwarnings sqlexception getvalidconnection getwarnings public void clear warnings throws sql exception get valid connection clear warnings clearwarnings sqlexception getvalidconnection clearwarnings public statement create statement int result set type int result set concurrency throws sql exception return get valid connection create statement result set type result set concurrency createstatement resultsettype resultsetconcurrency sqlexception getvalidconnection createstatement resultsettype resultsetconcurrency public prepared statement prepare statement string sql int result set type int result set concurrency throws sql exception return get valid connection prepare call sql result set type result set concurrency preparedstatement preparestatement resultsettype resultsetconcurrency sqlexception getvalidconnection preparecall resultsettype resultsetconcurrency public callable statement prepare call string sql int result set type int result set concurrency throws sql exception return get valid connection prepare call sql result set type result set concurrency callablestatement preparecall resultsettype resultsetconcurrency sqlexception getvalidconnection preparecall resultsettype resultsetconcurrency public map get type map throws sql exception return get valid connection get type map gettypemap sqlexception getvalidconnection gettypemap public void set type map map map throws sql exception get valid connection set type map map settypemap sqlexception getvalidconnection settypemap public void set holdability int holdability throws sql exception get valid connection set holdability holdability setholdability sqlexception getvalidconnection setholdability public int get holdability throws sql exception return get valid connection get holdability getholdability sqlexception getvalidconnection getholdability public savepoint set savepoint throws sql exception return get valid connection set savepoint setsavepoint sqlexception getvalidconnection setsavepoint public savepoint set savepoint string name throws sql exception return get valid connection set savepoint name setsavepoint sqlexception getvalidconnection setsavepoint public void rollback savepoint savepoint throws sql exception get valid connection rollback savepoint sqlexception getvalidconnection public void release savepoint savepoint savepoint throws sql exception get valid connection release savepoint savepoint releasesavepoint sqlexception getvalidconnection releasesavepoint public statement create statement int result set type int result set concurrency int result set holdability throws sql exception return get valid connection create statement result set type result set concurrency result set holdability createstatement resultsettype resultsetconcurrency resultsetholdability sqlexception getvalidconnection createstatement resultsettype resultsetconcurrency resultsetholdability public prepared statement prepare statement string sql int result set type int result set concurrency int result set holdability throws sql exception return get valid connection prepare statement sql result set type result set concurrency result set holdability preparedstatement preparestatement resultsettype resultsetconcurrency resultsetholdability sqlexception getvalidconnection preparestatement resultsettype resultsetconcurrency resultsetholdability public callable statement prepare call string sql int result set type int result set concurrency int result set holdability throws sql exception return get valid connection prepare call sql result set type result set concurrency result set holdability callablestatement preparecall resultsettype resultsetconcurrency resultsetholdability sqlexception getvalidconnection preparecall resultsettype resultsetconcurrency resultsetholdability public prepared statement prepare statement string sql int auto generated keys throws sql exception return get valid connection prepare statement sql auto generated keys preparedstatement preparestatement autogeneratedkeys sqlexception getvalidconnection preparestatement autogeneratedkeys public prepared statement prepare statement string sql int column indexes throws sql exception return get valid connection prepare statement sql column indexes preparedstatement preparestatement columnindexes sqlexception getvalidconnection preparestatement columnindexes public prepared statement prepare statement string sql string column names throws sql exception return get valid connection prepare statement sql column names preparedstatement preparestatement columnnames sqlexception getvalidconnection preparestatement columnnames public iterate context object collection sql tag tag iterate context parent this parent parent this tag tag if collection instanceof collection this iterator collection collection iterator else if collection instanceof iterator this iterator iterator collection else if collection get class is array list list array to list collection this iterator list iterator else throw new sql map exception parameter object or property was not a collection array or iterator iteratecontext sqltag iteratecontext getclass isarray arraytolist sqlmapexception parameterobject public boolean has next return iterator null iterator has next hasnext hasnext public object next index return iterator next public void remove iterator remove public int get index return index getindex return deprecated this method should not be used to decide whether or not to add prepend and open text to the generated statement rather use the methods is prepend enabled and some sub elements have content public boolean is first return index 0 isprependenabled somesubelementshavecontent isfirst public boolean is last return iterator null iterator has next islast hasnext private list array to list object array list list null if array instanceof object list arrays as list object array else list new array list for int i 0 n array get length array i n i list add array get array i return list arraytolist aslist arraylist getlength return returns the property public string get property return property getproperty this property specifies whether to increment the iterate in the do end fragment the conditional tag handler has the ability to increment the iterate context so it is neccessary to avoid incrementing in both the conditional tag and the iterate tag param property the property to set public void set property string property this property property doendfragment conditionaltaghandler iteratecontext conditionaltag iteratetag setproperty return returns the allow next public boolean is allow next return allow next allownext isallownext allownext param perform iterate the allow next to set public void set allow next boolean perform iterate this allow next perform iterate performiterate allownext setallownext performiterate allownext performiterate return returns the tag public sql tag get tag return tag sqltag gettag param tag the tag to set public void set tag sql tag tag this tag tag settag sqltag return public boolean is final return is final isfinal isfinal this attribute is used to mark whether an iterate tag is in it s final iteration since the conditional tag handler can increment the iterate the final iterate in the do end fragment of the iterate tag handler needs to know it is in it s final iterate param a final public void set final boolean a final is final a final conditionaltaghandler doendfragment iteratetaghandler afinal setfinal afinal isfinal afinal returns the last property of any bean specified in this iterate context return the last property of any bean specified in this iterate context public string get end property if parent null int parent property index property index of parent get property if parent property index 1 int end property index1 property index of parent property index int end property index2 property index of parent property index return property substring parent property index math max end property index1 end property index2 1 property length else return property else return property iteratecontext iteratecontext getendproperty parentpropertyindex indexof getproperty parentpropertyindex endpropertyindex1 indexof parentpropertyindex endpropertyindex2 indexof parentpropertyindex parentpropertyindex endpropertyindex1 endpropertyindex2 replaces value of a tag property to match it s value with current iteration and all other iterations param tag property the property of a tag handler return a map containing the modified tag property in process string key and the index where the modification occured in process index key protected map process tag property string tag property if parent null map parent result parent process tag property tag property return this add index string parent result get process string integer parent result get process index int value else return this add index tag property 0 tagproperty taghandler process_string process_index processtagproperty tagproperty parentresult processtagproperty tagproperty addindex parentresult process_string parentresult process_index intvalue addindex tagproperty replaces value of a tag property to match it s value with current iteration and all other iterations param tag property the property of a tag handler return the tag property with all replaced with the correct iteration value public string add index to tag property string tag property map map this process tag property tag property return string map get process string tagproperty taghandler addindextotagproperty tagproperty processtagproperty tagproperty process_string adds index value to the first found property matching this iteration starting at index start index param input the input string param start index the index where search for property begins return a map containing the modified tag property in process string key and the index where the modification occured in process index key protected map add index string input int start index string end property get end property int property index input index of end property start index int modification index 0 is the iterate property in the tag property at all if property index 1 make sure the tag property does not already have a number if input char at property index end property length add iteration number to property input input substring 0 property index end property length this get index input substring property index end property length modification index property index end property length map ret new hash map ret put process index new integer modification index ret put process string input return ret startindex startindex process_string process_index addindex startindex endproperty getendproperty propertyindex indexof endproperty startindex modificationindex propertyindex charat propertyindex endproperty propertyindex endproperty getindex propertyindex endproperty modificationindex propertyindex endproperty hashmap process_index modificationindex process_string public iterate context get parent return parent iteratecontext getparent public void set parent iterate context parent this parent parent setparent iteratecontext public boolean some sub elements have content return some sub elements have content somesubelementshavecontent somesubelementshavecontent public void set some sub elements have content boolean some sub elements have content this some sub elements have content some sub elements have content setsomesubelementshavecontent somesubelementshavecontent somesubelementshavecontent somesubelementshavecontent public boolean is prepend enabled return is prepend enabled isprependenabled isprependenabled public void set prepend enabled boolean is prepend enabled this is prepend enabled is prepend enabled setprependenabled isprependenabled isprependenabled isprependenabled private sql map executor delegate delegate public dynamic sql sql map executor delegate delegate this delegate delegate sqlmapexecutordelegate dynamicsql sqlmapexecutordelegate public string get sql request scope request object parameter object string sql request get dynamic sql if sql null process request parameter object sql request get dynamic sql return sql getsql requestscope parameterobject getdynamicsql parameterobject getdynamicsql public parameter map get parameter map request scope request object parameter object parameter map map request get dynamic parameter map if map null process request parameter object map request get dynamic parameter map return map parametermap getparametermap requestscope parameterobject parametermap getdynamicparametermap parameterobject getdynamicparametermap public result map get result map request scope request object parameter object return request get result map resultmap getresultmap requestscope parameterobject getresultmap public void cleanup request scope request request set dynamic sql null request set dynamic parameter map null requestscope setdynamicsql setdynamicparametermap private void process request scope request object parameter object sql tag context ctx new sql tag context list local children children process body children request ctx parameter object local children iterator basic parameter map map new basic parameter map delegate map set id request get statement get id inline parameter map map set parameter class general statement request get statement get parameter class map set parameter mapping list ctx get parameter mappings string dyn sql ctx get body text processes substitutions after dynamic sql if simple dynamic sql is simple dynamic sql dyn sql dyn sql new simple dynamic sql delegate dyn sql get sql request parameter object request set dynamic sql dyn sql request set dynamic parameter map map requestscope parameterobject sqltagcontext sqltagcontext localchildren processbodychildren parameterobject localchildren basicparametermap basicparametermap setid getstatement getid inlineparametermap setparameterclass generalstatement getstatement getparameterclass setparametermappinglist getparametermappings dynsql getbodytext dynamicsql simpledynamicsql issimpledynamicsql dynsql dynsql simpledynamicsql dynsql getsql parameterobject setdynamicsql dynsql setdynamicparametermap private void process body children request scope request sql tag context ctx object parameter object iterator local children print writer out ctx get writer process body children request ctx parameter object local children out processbodychildren requestscope sqltagcontext parameterobject localchildren printwriter getwriter processbodychildren parameterobject localchildren private void process body children request scope request sql tag context ctx object parameter object iterator local children print writer out while local children has next sql child child sql child local children next if child instanceof sql text sql text sql text sql text child string sql statement sql text get text if sql text is white space out print sql statement else if sql text is post parse required body out out print sql statement parameter mapping mappings sql text get parameter mappings if mappings null for int i 0 n mappings length i n i ctx add parameter mapping mappings i else iterate context it ctx ctx peek iterate context if null it ctx it ctx is allow next it ctx next it ctx set allow next false if it ctx has next it ctx set final true if it ctx null string buffer sql statement buffer new string buffer sql statement iterate property replace sql statement buffer it ctx sql statement sql statement buffer to string sql text param parser parse inline parameter map delegate get type handler factory sql statement parameter mapping mappings sql text get parameter mappings out print sql text get text if mappings null for int i 0 n mappings length i n i ctx add parameter mapping mappings i else if child instanceof sql tag sql tag tag sql tag child sql tag handler handler tag get handler int response sql tag handler include body do string writer sw new string writer print writer pw new print writer sw response handler do start fragment ctx tag parameter object if response sql tag handler skip body process body children request ctx parameter object tag get children pw pw flush pw close string buffer body sw get buffer response handler do end fragment ctx tag parameter object body handler do prepend ctx tag parameter object body if response sql tag handler skip body if body length 0 out print body to string while response sql tag handler repeat body ctx pop remove first prepend marker tag if ctx peek iterate context null ctx peek iterate context get tag tag ctx set attribute ctx peek iterate context get tag null ctx pop iterate context processbodychildren requestscope sqltagcontext parameterobject localchildren printwriter localchildren hasnext sqlchild sqlchild localchildren sqltext sqltext sqltext sqltext sqlstatement sqltext gettext sqltext iswhitespace sqlstatement sqltext ispostparserequired sqlstatement parametermapping sqltext getparametermappings addparametermapping iteratecontext itctx peekiteratecontext itctx itctx isallownext itctx itctx setallownext itctx hasnext itctx setfinal itctx stringbuffer sqlstatementbuffer stringbuffer sqlstatement iteratepropertyreplace sqlstatementbuffer itctx sqlstatement sqlstatementbuffer tostring sqltext param_parser parseinlineparametermap gettypehandlerfactory sqlstatement parametermapping sqltext getparametermappings sqltext gettext addparametermapping sqltag sqltag sqltag sqltaghandler gethandler sqltaghandler include_body stringwriter stringwriter printwriter printwriter dostartfragment parameterobject sqltaghandler skip_body processbodychildren parameterobject getchildren stringbuffer getbuffer doendfragment parameterobject doprepend parameterobject sqltaghandler skip_body tostring sqltaghandler repeat_body popremovefirstprependmarker peekiteratecontext peekiteratecontext gettag setattribute peekiteratecontext gettag popiteratecontext param body content param iterate protected void iterate property replace string buffer body content iterate context iterate if iterate null string mappings new string for int i 0 i mappings length i int start index 0 int end index 1 while start index 1 start index body content length start index body content index of mappings i end index 1 end index body content index of mappings i start index 1 if start index 1 end index 1 body content replace start index 1 end index iterate add index to tag property body content substring start index 1 end index bodycontent iteratepropertyreplace stringbuffer bodycontent iteratecontext startindex endindex startindex startindex bodycontent startindex bodycontent indexof endindex endindex bodycontent indexof startindex startindex endindex bodycontent startindex endindex addindextotagproperty bodycontent startindex endindex protected static void replace string buffer buffer string find string replace int pos buffer to string index of find int len find length while pos 1 buffer replace pos pos len replace pos buffer to string index of find stringbuffer tostring indexof tostring indexof public void add child sql child child children add child addchild sqlchild constructor to pass in the sql map executor delegate param delegate the delegate public auto result map sql map executor delegate delegate boolean allow remapping super delegate this allow remapping allow remapping sqlmapexecutordelegate autoresultmap sqlmapexecutordelegate allowremapping allowremapping allowremapping public synchronized object get results request scope request result set rs throws sql exception if allow remapping get result mappings null initialize rs return super get results request rs getresults requestscope resultset sqlexception allowremapping getresultmappings getresults private void initialize result set rs if get result class null throw new sql map exception the automatic result map named this get id had a null result class not allowed else if map class is assignable from get result class initialize map results rs else if get delegate get type handler factory get type handler get result class null initialize primitive results rs else if dom type marker class is assignable from get result class initialize xml results rs else initialize bean results rs resultset getresultclass sqlmapexception resultmap getid isassignablefrom getresultclass initializemapresults getdelegate gettypehandlerfactory gettypehandler getresultclass initializeprimitiveresults domtypemarker isassignablefrom getresultclass initializexmlresults initializebeanresults private void initialize bean results result set rs try class info class info class info get instance get result class string property names class info get writeable property names map property map new hash map for int i 0 i property names length i property map put property names i to upper case java util locale english property names i list result mapping list new array list result set meta data rsmd rs get meta data for int i 0 n rsmd get column count i n i string column name rsmd get column label i 1 string upper column name column name to upper case java util locale english string matched prop string property map get upper column name class type null if matched prop null probe p probe factory get probe this get result class try type p get property type for setter this get result class column name catch exception e todo add logging to this class else type class info get setter type matched prop if type null matched prop null basic result mapping result mapping new basic result mapping result mapping set property name matched prop null matched prop column name result mapping set column name column name result mapping set column index i 1 result mapping set type handler get delegate get type handler factory get type handler type map sql to jdbc type result mapping list add result mapping set result mapping list result mapping list catch sql exception e throw new runtime exception error automapping columns cause e initializebeanresults resultset classinfo classinfo classinfo getinstance getresultclass propertynames classinfo getwriteablepropertynames propertymap hashmap propertynames propertymap propertynames touppercase propertynames resultmappinglist arraylist resultsetmetadata getmetadata getcolumncount columnname getcolumnlabel uppercolumnname columnname touppercase matchedprop propertymap uppercolumnname matchedprop probefactory getprobe getresultclass getpropertytypeforsetter getresultclass columnname classinfo getsettertype matchedprop matchedprop basicresultmapping resultmapping basicresultmapping resultmapping setpropertyname matchedprop matchedprop columnname resultmapping setcolumnname columnname resultmapping setcolumnindex resultmapping settypehandler getdelegate gettypehandlerfactory gettypehandler resultmappinglist resultmapping setresultmappinglist resultmappinglist sqlexception runtimeexception private void initialize xml results result set rs try list result mapping list new array list result set meta data rsmd rs get meta data for int i 0 n rsmd get column count i n i string column name rsmd get column label i 1 basic result mapping result mapping new basic result mapping result mapping set property name column name result mapping set column name column name result mapping set column index i 1 result mapping set type handler get delegate get type handler factory get type handler string class result mapping list add result mapping set result mapping list result mapping list catch sql exception e throw new runtime exception error automapping columns cause e initializexmlresults resultset resultmappinglist arraylist resultsetmetadata getmetadata getcolumncount columnname getcolumnlabel basicresultmapping resultmapping basicresultmapping resultmapping setpropertyname columnname resultmapping setcolumnname columnname resultmapping setcolumnindex resultmapping settypehandler getdelegate gettypehandlerfactory gettypehandler resultmappinglist resultmapping setresultmappinglist resultmappinglist sqlexception runtimeexception private void initialize map results result set rs try list result mapping list new array list result set meta data rsmd rs get meta data for int i 0 n rsmd get column count i n i string column name rsmd get column label i 1 basic result mapping result mapping new basic result mapping result mapping set property name column name result mapping set column name column name result mapping set column index i 1 result mapping set type handler get delegate get type handler factory get type handler object class result mapping list add result mapping set result mapping list result mapping list catch sql exception e throw new runtime exception error automapping columns cause e initializemapresults resultset resultmappinglist arraylist resultsetmetadata getmetadata getcolumncount columnname getcolumnlabel basicresultmapping resultmapping basicresultmapping resultmapping setpropertyname columnname resultmapping setcolumnname columnname resultmapping setcolumnindex resultmapping settypehandler getdelegate gettypehandlerfactory gettypehandler resultmappinglist resultmapping setresultmappinglist resultmappinglist sqlexception runtimeexception private void initialize primitive results result set rs try result set meta data rsmd rs get meta data string column name rsmd get column label 1 basic result mapping result mapping new basic result mapping result mapping set property name column name result mapping set column name column name result mapping set column index 1 result mapping set type handler get delegate get type handler factory get type handler get result class list result mapping list new array list result mapping list add result mapping set result mapping list result mapping list catch sql exception e throw new runtime exception error automapping columns cause e initializeprimitiveresults resultset resultsetmetadata getmetadata columnname getcolumnlabel basicresultmapping resultmapping basicresultmapping resultmapping setpropertyname columnname resultmapping setcolumnname columnname resultmapping setcolumnindex resultmapping settypehandler getdelegate gettypehandlerfactory gettypehandler getresultclass resultmappinglist arraylist resultmappinglist resultmapping setresultmappinglist resultmappinglist sqlexception runtimeexception execute an update param request the request scope param conn the database connection param sql the sql statement to execute param parameters the parameters for the sql statement return the number of records changed throws sql exception if the update fails public int execute update request scope request connection conn string sql object parameters throws sql exception error context error context request get error context error context set activity executing update error context set object id sql prepared statement ps null setup result object factory request int rows 0 try error context set more info check the sql statement preparation failed ps prepare statement request get session conn sql set statement timeout request get statement ps error context set more info check the parameters set parameters failed request get parameter map set parameters request ps parameters error context set more info check the statement update failed ps execute rows ps get update count finally close statement request get session ps return rows sqlexception executeupdate requestscope sqlexception errorcontext errorcontext geterrorcontext errorcontext setactivity errorcontext setobjectid preparedstatement setupresultobjectfactory errorcontext setmoreinfo preparestatement getsession setstatementtimeout getstatement errorcontext setmoreinfo getparametermap setparameters errorcontext setmoreinfo getupdatecount closestatement getsession adds a statement to a batch param request the request scope param conn the database connection param sql the sql statement param parameters the parameters for the statement throws sql exception if the statement fails public void add batch request scope request connection conn string sql object parameters throws sql exception batch batch batch request get session get batch if batch null batch new batch request get session set batch batch batch add batch request conn sql parameters sqlexception addbatch requestscope sqlexception getsession getbatch getsession setbatch addbatch execute a batch of statements param session the session scope return the number of rows impacted by the batch throws sql exception if a statement fails public int execute batch session scope session throws sql exception int rows 0 batch batch batch session get batch if batch null try rows batch execute batch finally batch cleanup batch session return rows sqlexception executebatch sessionscope sqlexception getbatch executebatch cleanupbatch execute a batch of statements param session the session scope return a list of batch result objects may be null if no batch has been initiated there will be one batch result object in the list for each sub batch executed throws sql exception if a database access error occurs or the drive does not support batch statements throws batch exception if the driver throws batch update exception public list execute batch detailed session scope session throws sql exception batch exception list answer null batch batch batch session get batch if batch null try answer batch execute batch detailed finally batch cleanup batch session return answer batchresult batchresult sqlexception batchexception batchupdateexception executebatchdetailed sessionscope sqlexception batchexception getbatch executebatchdetailed cleanupbatch long form of the method to execute a query param request the request scope param conn the database connection param sql the sql statement to execute param parameters the parameters for the statement param skip results the number of results to skip param max results the maximum number of results to return param callback the row handler for the query throws sql exception if the query fails public void execute query request scope request connection conn string sql object parameters int skip results int max results row handler callback callback throws sql exception error context error context request get error context error context set activity executing query error context set object id sql prepared statement ps null result set rs null setup result object factory request try error context set more info check the sql statement preparation failed integer rs type request get statement get result set type if rs type null ps prepare statement request get session conn sql rs type else ps prepare statement request get session conn sql set statement timeout request get statement ps integer fetch size request get statement get fetch size if fetch size null ps set fetch size fetch size int value error context set more info check the parameters set parameters failed request get parameter map set parameters request ps parameters error context set more info check the statement query failed ps execute error context set more info check the results failed to retrieve results begin result set handling rs handle multiple results ps request skip results max results callback end result set handling finally try close result set rs finally close statement request get session ps skipresults maxresults sqlexception executequery requestscope skipresults maxresults rowhandlercallback sqlexception errorcontext errorcontext geterrorcontext errorcontext setactivity errorcontext setobjectid preparedstatement resultset setupresultobjectfactory errorcontext setmoreinfo rstype getstatement getresultsettype rstype preparestatement getsession rstype preparestatement getsession setstatementtimeout getstatement fetchsize getstatement getfetchsize fetchsize setfetchsize fetchsize intvalue errorcontext setmoreinfo getparametermap setparameters errorcontext setmoreinfo errorcontext setmoreinfo resultset handlemultipleresults skipresults maxresults resultset closeresultset closestatement getsession execute a stored procedure that updates data param request the request scope param conn the database connection param sql the sql to call the procedure param parameters the parameters for the procedure return the rows impacted by the procedure throws sql exception if the procedure fails public int execute update procedure request scope request connection conn string sql object parameters throws sql exception error context error context request get error context error context set activity executing update procedure error context set object id sql callable statement cs null setup result object factory request int rows 0 try error context set more info check the sql statement preparation failed cs prepare call request get session conn sql set statement timeout request get statement cs parameter map parameter map request get parameter map parameter mapping mappings parameter map get parameter mappings error context set more info check the output parameters register output parameters failed register output parameters cs mappings error context set more info check the parameters set parameters failed parameter map set parameters request cs parameters error context set more info check the statement update procedure failed cs execute rows cs get update count error context set more info check the output parameters retrieval of output parameters failed retrieve output parameters request cs mappings parameters null finally close statement request get session cs return rows sqlexception executeupdateprocedure requestscope sqlexception errorcontext errorcontext geterrorcontext errorcontext setactivity errorcontext setobjectid callablestatement setupresultobjectfactory errorcontext setmoreinfo preparecall getsession setstatementtimeout getstatement parametermap parametermap getparametermap parametermapping parametermap getparametermappings errorcontext setmoreinfo registeroutputparameters errorcontext setmoreinfo parametermap setparameters errorcontext setmoreinfo getupdatecount errorcontext setmoreinfo retrieveoutputparameters closestatement getsession execute a stored procedure param request the request scope param conn the database connection param sql the sql to call the procedure param parameters the parameters for the procedure param skip results the number of results to skip param max results the maximum number of results to return param callback a row handler for processing the results throws sql exception if the procedure fails public void execute query procedure request scope request connection conn string sql object parameters int skip results int max results row handler callback callback throws sql exception error context error context request get error context error context set activity executing query procedure error context set object id sql callable statement cs null result set rs null setup result object factory request try error context set more info check the sql statement preparation failed integer rs type request get statement get result set type if rs type null cs prepare call request get session conn sql rs type else cs prepare call request get session conn sql set statement timeout request get statement cs integer fetch size request get statement get fetch size if fetch size null cs set fetch size fetch size int value parameter map parameter map request get parameter map parameter mapping mappings parameter map get parameter mappings error context set more info check the output parameters register output parameters failed register output parameters cs mappings error context set more info check the parameters set parameters failed parameter map set parameters request cs parameters error context set more info check the statement update procedure failed cs execute error context set more info check the results failed to retrieve results begin result set handling rs handle multiple results cs request skip results max results callback end result set handling error context set more info check the output parameters retrieval of output parameters failed retrieve output parameters request cs mappings parameters callback finally try close result set rs finally close statement request get session cs skipresults maxresults sqlexception executequeryprocedure requestscope skipresults maxresults rowhandlercallback sqlexception errorcontext errorcontext geterrorcontext errorcontext setactivity errorcontext setobjectid callablestatement resultset setupresultobjectfactory errorcontext setmoreinfo rstype getstatement getresultsettype rstype preparecall getsession rstype preparecall getsession setstatementtimeout getstatement fetchsize getstatement getfetchsize fetchsize setfetchsize fetchsize intvalue parametermap parametermap getparametermap parametermapping parametermap getparametermappings errorcontext setmoreinfo registeroutputparameters errorcontext setmoreinfo parametermap setparameters errorcontext setmoreinfo errorcontext setmoreinfo resultset handlemultipleresults skipresults maxresults resultset errorcontext setmoreinfo retrieveoutputparameters closeresultset closestatement getsession private result set handle multiple results prepared statement ps request scope request int skip results int max results row handler callback callback throws sql exception result set rs rs get first result set ps if rs null handle results request rs skip results max results callback multiple result set handling if callback get row handler instanceof default row handler mapped statement statement request get statement default row handler default row handler default row handler callback get row handler if statement has multiple result maps list multiple results new array list multiple results add default row handler get list result map result maps statement get additional result maps int i 0 while move to next results safely ps if i result maps length break result map rm result maps i request set result map rm rs ps get result set default row handler rh new default row handler handle results request rs skip results max results new row handler callback rm null rh multiple results add rh get list i default row handler set list multiple results request set result map statement get result map else while move to next results safely ps end additional result set handling return rs resultset handlemultipleresults preparedstatement requestscope skipresults maxresults rowhandlercallback sqlexception resultset getfirstresultset handleresults skipresults maxresults resultset getrowhandler defaultrowhandler mappedstatement getstatement defaultrowhandler defaultrowhandler defaultrowhandler getrowhandler hasmultipleresultmaps multipleresults arraylist multipleresults defaultrowhandler getlist resultmap resultmaps getadditionalresultmaps movetonextresultssafely resultmaps resultmap resultmaps setresultmap getresultset defaultrowhandler defaultrowhandler handleresults skipresults maxresults rowhandlercallback multipleresults getlist defaultrowhandler setlist multipleresults setresultmap getresultmap movetonextresultssafely resultset private result set get first result set statement stmt throws sql exception result set rs null boolean has more results true while has more results rs stmt get result set if rs null break has more results move to next results if present stmt return rs resultset getfirstresultset sqlexception resultset hasmoreresults hasmoreresults getresultset hasmoreresults movetonextresultsifpresent private boolean move to next results if present statement stmt throws sql exception boolean more results this is the messed up jdbc approach for determining if there are more results more results move to next results safely stmt false stmt get update count 1 return more results movetonextresultsifpresent sqlexception moreresults moreresults movetonextresultssafely getupdatecount moreresults private boolean move to next results safely statement stmt throws sql exception if stmt get connection get meta data supports multiple result sets return false return stmt get more results movetonextresultssafely sqlexception getconnection getmetadata supportsmultipleresultsets getmoreresults private void handle results request scope request result set rs int skip results int max results row handler callback callback throws sql exception try request set result set rs result map result map request get result map if result map null skip results if rs get type result set type forward only if skip results 0 rs absolute skip results else for int i 0 i skip results i if rs next return get results int results fetched 0 while max results sql executor no maximum results results fetched max results rs next object column values result map resolve sub map request rs get results request rs callback handle result object request column values rs results fetched finally request set result set null handleresults requestscope resultset skipresults maxresults rowhandlercallback sqlexception setresultset resultmap resultmap getresultmap resultmap gettype resultset type_forward_only skipresults skipresults skipresults resultsfetched maxresults sqlexecutor no_maximum_results resultsfetched maxresults columnvalues resultmap resolvesubmap getresults handleresultobject columnvalues resultsfetched setresultset private void retrieve output parameters request scope request callable statement cs parameter mapping mappings object parameters row handler callback callback throws sql exception for int i 0 i mappings length i basic parameter mapping mapping basic parameter mapping mappings i if mapping is output allowed if java sql result set equals ignore case mapping get java type name result set rs result set cs get object i 1 result map result map if mapping get result map name null result map request get result map handle output parameter results request result map rs callback else extended sql map client client extended sql map client request get session get sql map client result map client get delegate get result map mapping get result map name default row handler row handler new default row handler row handler callback handler callback new row handler callback result map null row handler handle output parameter results request result map rs handler callback parameters i row handler get list rs close else parameters i mapping get type handler get result cs i 1 retrieveoutputparameters requestscope callablestatement parametermapping rowhandlercallback sqlexception basicparametermapping basicparametermapping isoutputallowed resultset equalsignorecase getjavatypename resultset resultset getobject resultmap resultmap getresultmapname resultmap getresultmap handleoutputparameterresults resultmap extendedsqlmapclient extendedsqlmapclient getsession getsqlmapclient resultmap getdelegate getresultmap getresultmapname defaultrowhandler rowhandler defaultrowhandler rowhandlercallback handlercallback rowhandlercallback resultmap rowhandler handleoutputparameterresults resultmap handlercallback rowhandler getlist gettypehandler getresult private void register output parameters callable statement cs parameter mapping mappings throws sql exception for int i 0 i mappings length i basic parameter mapping mapping basic parameter mapping mappings i if mapping is output allowed if null mapping get type name mapping get type name equals added cs register out parameter i 1 mapping get jdbc type mapping get type name else if mapping get numeric scale null mapping get jdbc type types numeric mapping get jdbc type types decimal cs register out parameter i 1 mapping get jdbc type mapping get numeric scale int value else cs register out parameter i 1 mapping get jdbc type registeroutputparameters callablestatement parametermapping sqlexception basicparametermapping basicparametermapping isoutputallowed gettypename gettypename registeroutparameter getjdbctype gettypename getnumericscale getjdbctype getjdbctype registeroutparameter getjdbctype getnumericscale intvalue registeroutparameter getjdbctype private void handle output parameter results request scope request result map result map result set rs row handler callback callback throws sql exception result map orig request get result map try request set result set rs if result map null request set result map result map get results while rs next object column values result map resolve sub map request rs get results request rs callback handle result object request column values rs finally request set result set null request set result map orig handleoutputparameterresults requestscope resultmap resultmap resultset rowhandlercallback sqlexception resultmap getresultmap setresultset resultmap setresultmap resultmap columnvalues resultmap resolvesubmap getresults handleresultobject columnvalues setresultset setresultmap clean up any batches on the session param session the session to clean up public void cleanup session scope session batch batch batch session get batch if batch null batch cleanup batch session session set batch null sessionscope getbatch cleanupbatch setbatch private prepared statement prepare statement session scope session connection conn string sql integer rs type throws sql exception sql map executor delegate delegate extended sql map client session get sql map executor get delegate if session has prepared statement for sql return session get prepared statement sql else prepared statement ps conn prepare statement sql rs type int value result set concur read only session put prepared statement delegate sql ps return ps preparedstatement preparestatement sessionscope rstype sqlexception sqlmapexecutordelegate extendedsqlmapclient getsqlmapexecutor getdelegate haspreparedstatementfor getpreparedstatement preparedstatement preparestatement rstype intvalue resultset concur_read_only putpreparedstatement private callable statement prepare call session scope session connection conn string sql integer rs type throws sql exception sql map executor delegate delegate extended sql map client session get sql map executor get delegate if session has prepared statement for sql return callable statement session get prepared statement sql else callable statement cs conn prepare call sql rs type int value result set concur read only session put prepared statement delegate sql cs return cs callablestatement preparecall sessionscope rstype sqlexception sqlmapexecutordelegate extendedsqlmapclient getsqlmapexecutor getdelegate haspreparedstatementfor callablestatement getpreparedstatement callablestatement preparecall rstype intvalue resultset concur_read_only putpreparedstatement private static prepared statement prepare statement session scope session connection conn string sql throws sql exception sql map executor delegate delegate extended sql map client session get sql map executor get delegate if session has prepared statement for sql return session get prepared statement sql else prepared statement ps conn prepare statement sql session put prepared statement delegate sql ps return ps preparedstatement preparestatement sessionscope sqlexception sqlmapexecutordelegate extendedsqlmapclient getsqlmapexecutor getdelegate haspreparedstatementfor getpreparedstatement preparedstatement preparestatement putpreparedstatement private callable statement prepare call session scope session connection conn string sql throws sql exception sql map executor delegate delegate extended sql map client session get sql map executor get delegate if session has prepared statement for sql return callable statement session get prepared statement sql else callable statement cs conn prepare call sql session put prepared statement delegate sql cs return cs callablestatement preparecall sessionscope sqlexception sqlmapexecutordelegate extendedsqlmapclient getsqlmapexecutor getdelegate haspreparedstatementfor callablestatement getpreparedstatement callablestatement preparecall putpreparedstatement private static void close statement session scope session prepared statement ps if ps null if session has prepared statement ps try ps close catch sql exception e ignore closestatement sessionscope preparedstatement haspreparedstatement sqlexception param rs private static void close result set result set rs if rs null try rs close catch sql exception e ignore closeresultset resultset sqlexception private static void set statement timeout mapped statement mapped statement statement statement throws sql exception if mapped statement get timeout null statement set query timeout mapped statement get timeout int value setstatementtimeout mappedstatement mappedstatement sqlexception mappedstatement gettimeout setquerytimeout mappedstatement gettimeout intvalue create a new batch public batch this size 0 getter for the batch size return the batch size public int get size return size getsize add a prepared statement to the batch param request the request scope param conn the database connection param sql the sql to add param parameters the parameters for the sql throws sql exception if the prepare for the sql fails public void add batch request scope request connection conn string sql object parameters throws sql exception prepared statement ps null if current sql null sql hash code current sql hash code sql length current sql length int last statement list size 1 ps prepared statement statement list get last else ps prepare statement request get session conn sql set statement timeout request get statement ps current sql sql statement list add ps batch result list add new batch result request get statement get id sql request get parameter map set parameters request ps parameters ps add batch size sqlexception addbatch requestscope sqlexception preparedstatement currentsql hashcode currentsql hashcode currentsql statementlist preparedstatement statementlist preparestatement getsession setstatementtimeout getstatement currentsql statementlist batchresultlist batchresult getstatement getid getparametermap setparameters addbatch todo jeff butler maybe this method should be deprecated in some release and then removed in some even later release execute batch detailed gives much more complete information p execute the current session s batch return the number of rows updated throws sql exception if the batch fails public int execute batch throws sql exception int total row count 0 for int i 0 n statement list size i n i prepared statement ps prepared statement statement list get i int row counts ps execute batch for int j 0 j row counts length j if row counts j statement success no info do nothing else if row counts j statement execute failed throw new sql exception the batched statement at index j failed to execute else total row count row counts j return total row count executebatchdetailed sqlexception executebatch sqlexception totalrowcount statementlist preparedstatement preparedstatement statementlist rowcounts executebatch rowcounts rowcounts success_no_info rowcounts execute_failed sqlexception totalrowcount rowcounts totalrowcount batch execution method that returns all the information the driver has to offer return a list of batch result objects throws batch exception an sql exception sub class if any nested batch fails throws sql exception if a database access error occurs or the drive does not support batch statements throws batch exception if the driver throws batch update exception public list execute batch detailed throws sql exception batch exception list answer new array list for int i 0 n statement list size i n i batch result br batch result batch result list get i prepared statement ps prepared statement statement list get i try br set update counts ps execute batch catch batch update exception e string buffer message new string buffer message append sub batch number message append i 1 message append failed if i 0 message append message append i message append prior sub batch s completed successfully but will be rolled back throw new batch exception message to string e answer br get statement id br get sql answer add br return answer batchresult batchexception sqlexception sqlexception batchexception batchupdateexception executebatchdetailed sqlexception batchexception arraylist statementlist batchresult batchresult batchresultlist preparedstatement preparedstatement statementlist setupdatecounts executebatch batchupdateexception stringbuffer stringbuffer batchexception tostring getstatementid getsql close all the statements in the batch and clear all the statements param session public void cleanup batch session scope session for int i 0 n statement list size i n i prepared statement ps prepared statement statement list get i close statement session ps current sql null statement list clear batch result list clear size 0 cleanupbatch sessionscope statementlist preparedstatement preparedstatement statementlist closestatement currentsql statementlist batchresultlist private void setup result object factory request scope request extended sql map client client extended sql map client request get session get sql map client result object factory util set result object factory client get result object factory result object factory util set statement id request get statement get id setupresultobjectfactory requestscope extendedsqlmapclient extendedsqlmapclient getsession getsqlmapclient resultobjectfactoryutil setresultobjectfactory getresultobjectfactory resultobjectfactoryutil setstatementid getstatement getid private sql map executor delegate delegate public simple dynamic sql sql map executor delegate delegate string sql statement this delegate delegate this sql statement sql statement sqlmapexecutordelegate simpledynamicsql sqlmapexecutordelegate sqlstatement sqlstatement sqlstatement public string get sql request scope request object parameter object return process dynamic elements sql statement parameter object getsql requestscope parameterobject processdynamicelements sqlstatement parameterobject public parameter map get parameter map request scope request object parameter object return request get parameter map parametermap getparametermap requestscope parameterobject getparametermap public result map get result map request scope request object parameter object return request get result map resultmap getresultmap requestscope parameterobject getresultmap public void cleanup request scope request requestscope public static boolean is simple dynamic sql string sql return sql null sql index of element token 1 issimpledynamicsql indexof element_token private string process dynamic elements string sql object parameter object string tokenizer parser new string tokenizer sql element token true string buffer new sql new string buffer string token null string last token null while parser has more tokens token parser next token if element token equals last token if element token equals token new sql append element token token null else object value null if parameter object null if delegate get type handler factory has type handler parameter object get class value parameter object else value probe get object parameter object token if value null new sql append string value of value token parser next token if element token equals token throw new sql map exception unterminated dynamic element in sql sql token null else if element token equals token new sql append token last token token return new sql to string processdynamicelements parameterobject stringtokenizer stringtokenizer element_token stringbuffer newsql stringbuffer lasttoken hasmoretokens nexttoken element_token lasttoken element_token newsql element_token parameterobject gettypehandlerfactory hastypehandler parameterobject getclass parameterobject getobject parameterobject newsql valueof nexttoken element_token sqlmapexception element_token newsql lasttoken newsql tostring private sql tag handler factory sqltaghandlerfactory public static sql tag handler get sql tag handler string name return sql tag handler handler map get name sqltaghandler getsqltaghandler sqltaghandler handler_map public class result loader private result loader resultloader resultloader loads a result lazily param client the client creating the object param statement name the name of the statement to be used param parameter object the parameters for the statement param target type the target type of the result return the loaded result throws sql exception public static object load result extended sql map client client string statement name object parameter object class target type throws sql exception object value null if client is lazy loading enabled if client is enhancement enabled enhanced lazy result loader lazy new enhanced lazy result loader client statement name parameter object target type value lazy load result else lazy result loader lazy new lazy result loader client statement name parameter object target type value lazy load result else value get result client statement name parameter object target type return value statementname parameterobject targettype sqlexception loadresult extendedsqlmapclient statementname parameterobject targettype sqlexception islazyloadingenabled isenhancementenabled enhancedlazyresultloader enhancedlazyresultloader statementname parameterobject targettype loadresult lazyresultloader lazyresultloader statementname parameterobject targettype loadresult getresult statementname parameterobject targettype protected static object get result extended sql map client client string statement name object parameter object class target type throws sql exception object value null if dom collection type marker class is assignable from target type value client query for list statement name parameter object else if set class is assignable from target type value new hash set client query for list statement name parameter object else if collection class is assignable from target type value client query for list statement name parameter object else if target type is array list list client query for list statement name parameter object value list to array list target type get component type else value client query for object statement name parameter object return value getresult extendedsqlmapclient statementname parameterobject targettype sqlexception domcollectiontypemarker isassignablefrom targettype queryforlist statementname parameterobject isassignablefrom targettype hashset queryforlist statementname parameterobject isassignablefrom targettype queryforlist statementname parameterobject targettype isarray queryforlist statementname parameterobject listtoarray targettype getcomponenttype queryforobject statementname parameterobject private static object list to array list list class type object array java lang reflect array new instance type list size array list to array object array return object array listtoarray newinstance toarray private string resource public string get id return id getid public integer get result set type return result set type getresultsettype resultsettype public void set result set type integer result set type this result set type result set type setresultsettype resultsettype resultsettype resultsettype public integer get fetch size return fetch size getfetchsize fetchsize public void set fetch size integer fetch size this fetch size fetch size setfetchsize fetchsize fetchsize fetchsize public void set id string id this id id setid public sql get sql return sql getsql public void set sql sql sql this sql sql setsql public result map get result map return result map resultmap getresultmap resultmap public void set result map result map result map this result map result map setresultmap resultmap resultmap resultmap resultmap public parameter map get parameter map return parameter map parametermap getparametermap parametermap public void set parameter map parameter map parameter map this parameter map parameter map setparametermap parametermap parametermap parametermap parametermap public class get parameter class return parameter class getparameterclass parameterclass public void set parameter class class parameter class this parameter class parameter class setparameterclass parameterclass parameterclass parameterclass public string get resource return resource getresource public void set resource string resource this resource resource setresource public cache key get cache key request scope request object parameter object sql sql request get sql parameter map pmap sql get parameter map request parameter object cache key cache key pmap get cache key request parameter object cache key update id cache key update base cache key cache key update sql get sql request parameter object fixes bug 953001 return cache key cachekey getcachekey requestscope parameterobject getsql parametermap getparametermap parameterobject cachekey cachekey getcachekey parameterobject cachekey cachekey basecachekey cachekey getsql parameterobject cachekey public void set base cache key int base this base cache key base setbasecachekey basecachekey public void add execute listener execute listener listener execute listeners add listener addexecutelistener executelistener executelisteners public void notify listeners for int i 0 n execute listeners size i n i execute listener execute listeners get i on execute statement this notifylisteners executelisteners executelistener executelisteners onexecutestatement public sql executor get sql executor return sql map client get sql executor sqlexecutor getsqlexecutor sqlmapclient getsqlexecutor public sql map client get sql map client return sql map client sqlmapclient getsqlmapclient sqlmapclient public void set sql map client sql map client sql map client this sql map client extended sql map client sql map client setsqlmapclient sqlmapclient sqlmapclient sqlmapclient extendedsqlmapclient sqlmapclient public void init request request scope request request set statement this request set parameter map parameter map request set result map result map request set sql sql initrequest requestscope setstatement setparametermap parametermap setresultmap resultmap setsql public integer get timeout return timeout gettimeout public void set timeout integer timeout this timeout timeout settimeout public void add result map result map result map list result map list arrays as list additional result maps result map list new array list result map list result map list add result map additional result maps result map result map list to array new result map result map list size addresultmap resultmap resultmap resultmaplist aslist additionalresultmaps resultmaplist arraylist resultmaplist resultmaplist resultmap additionalresultmaps resultmap resultmaplist toarray resultmap resultmaplist public boolean has multiple result maps return additional result maps length 0 hasmultipleresultmaps additionalresultmaps public result map get additional result maps return additional result maps resultmap getadditionalresultmaps additionalresultmaps private string sql statement public static sql string sql statement this sql statement sql statement replace r replace n sqlstatement staticsql sqlstatement sqlstatement sqlstatement public string get sql request scope request object parameter object return sql statement getsql requestscope parameterobject sqlstatement public parameter map get parameter map request scope request object parameter object return request get parameter map parametermap getparametermap requestscope parameterobject getparametermap public result map get result map request scope request object parameter object return request get result map resultmap getresultmap requestscope parameterobject getresultmap public void cleanup request scope request requestscope public class nodelet exception extends exception public nodelet exception super nodeletexception nodeletexception public nodelet exception string msg super msg nodeletexception public nodelet exception throwable cause super cause nodeletexception public nodelet exception string msg throwable cause super msg cause nodeletexception private int original isolation level unset isolation level public void set isolation level int isolation level this isolation level isolation level originalisolationlevel unset_isolation_level setisolationlevel isolationlevel isolationlevel isolationlevel public void apply isolation level connection conn throws sql exception if isolation level unset isolation level original isolation level conn get transaction isolation if isolation level original isolation level conn set transaction isolation isolation level applyisolationlevel sqlexception isolationlevel unset_isolation_level originalisolationlevel gettransactionisolation isolationlevel originalisolationlevel settransactionisolation isolationlevel public void restore isolation level connection conn throws sql exception if isolation level original isolation level conn set transaction isolation original isolation level restoreisolationlevel sqlexception isolationlevel originalisolationlevel settransactionisolation originalisolationlevel private static final string date format yyyy mm dd public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set date i java sql date parameter date_format setparameter preparedstatement jdbctype sqlexception setdate public object get result result set rs string column name throws sql exception object sql date rs get date column name if rs was null return null else return sql date getresult resultset columnname sqlexception sqldate getdate columnname wasnull sqldate public object get result result set rs int column index throws sql exception object sql date rs get date column index if rs was null return null else return sql date getresult resultset columnindex sqlexception sqldate getdate columnindex wasnull sqldate public object get result callable statement cs int column index throws sql exception object sql date cs get date column index if cs was null return null else return sql date getresult callablestatement columnindex sqlexception sqldate getdate columnindex wasnull sqldate public object value of string s return simple date formatter format date format s valueof simpledateformatter date_format private static final probe probe probe factory get probe complex access plan class clazz string property names super clazz property names probefactory getprobe complexaccessplan propertynames propertynames public void set properties object object object values for int i 0 i property names length i probe set object object property names i values i setproperties propertynames setobject propertynames public object get properties object object object values new object property names length for int i 0 i property names length i values i probe get object object property names i return values getproperties propertynames propertynames getobject propertynames creates a new instance of cache level private memory cache level string type this reference type type cachelevel memorycachelevel referencetype getter for the reference type return the type of reference type used public string get reference type return this reference type getreferencetype referencetype gets a memory cache level by name param ref type the name of the reference type return the memory cache level that the name indicates public static memory cache level get by reference type string ref type memory cache level cache level memory cache level cache level map get ref type if cache level null throw new sql map exception error getting cache level reference type for name ref type return cache level memorycachelevel reftype memorycachelevel memorycachelevel getbyreferencetype reftype memorycachelevel cachelevel memorycachelevel cachelevelmap reftype cachelevel sqlmapexception cachelevel reftype cachelevel default constructor public cache key hashcode default hashcode multiplier default multiplyer count 0 cachekey default_hashcode default_multiplyer constructor that supplies an initial hashcode param initial non zero odd number the hashcode to use public cache key int initial non zero odd number hashcode initial non zero odd number multiplier default multiplyer count 0 initialnonzerooddnumber cachekey initialnonzerooddnumber initialnonzerooddnumber default_multiplyer costructor that supplies an initial hashcode and multiplier param initial non zero odd number the hashcode to use param multiplier non zero odd number the multiplier to use public cache key int initial non zero odd number int multiplier non zero odd number hashcode initial non zero odd number multiplier multiplier non zero odd number count 0 initialnonzerooddnumber multipliernonzerooddnumber cachekey initialnonzerooddnumber multipliernonzerooddnumber initialnonzerooddnumber multipliernonzerooddnumber updates this object with new information based on an int value param x the int value return the cache key public cache key update int x update new integer x return this cachekey updates this object with new information based on an object param object the object return the cachekey public cache key update object object int base hash code object hash code count checksum base hash code base hash code count hashcode multiplier hashcode base hash code param list add object return this cachekey basehashcode hashcode basehashcode basehashcode basehashcode paramlist public boolean equals object object if this object return true if object instanceof cache key return false final cache key cache key cache key object if hashcode cache key hashcode return false if checksum cache key checksum return false if count cache key count return false for int i 0 i param list size i object this param param list get i object that param cache key param list get i if this param null if that param null return false else if this param equals that param return false return true cachekey cachekey cachekey cachekey cachekey cachekey cachekey paramlist thisparam paramlist thatparam cachekey paramlist thisparam thatparam thisparam thatparam public int hash code return hashcode hashcode public string to string string buffer return value new string buffer append hashcode append append checksum for int i 0 i param list size i return value append append param list get i return return value to string tostring stringbuffer returnvalue stringbuffer paramlist returnvalue paramlist returnvalue tostring public class select statement extends general statement public statement type get statement type return statement type select selectstatement generalstatement statementtype getstatementtype statementtype public int execute update request scope request transaction trans object parameter object throws sql exception throw new sql exception select statements cannot be executed as an update executeupdate requestscope parameterobject sqlexception sqlexception private access plan out param plan protected java bean data exchange data exchange factory data exchange factory super data exchange factory accessplan outparamplan javabeandataexchange dataexchangefactory dataexchangefactory dataexchangefactory initializes the data exchange instance param properties public void initialize map properties object map properties get map if map instanceof parameter map parameter map parameter map parameter map map if parameter map null parameter mapping parameter mappings parameter map get parameter mappings string parameter prop names new string parameter mappings length for int i 0 i parameter prop names length i parameter prop names i parameter mappings i get property name parameter plan access plan factory get access plan parameter map get parameter class parameter prop names output params list out param list new array list for int i 0 i parameter prop names length i if parameter mappings i is output allowed out param list add parameter mappings i get property name string out params string out param list to array new string out param list size out param plan access plan factory get access plan parameter map get parameter class out params else if map instanceof result map result map result map result map map if result map null result mapping result mappings result map get result mappings string result prop names new string result mappings length for int i 0 i result prop names length i result prop names i result mappings i get property name result plan access plan factory get access plan result map get result class result prop names parametermap parametermap parametermap parametermap parametermap parametermapping parametermappings parametermap getparametermappings parameterpropnames parametermappings parameterpropnames parameterpropnames parametermappings getpropertyname parameterplan accessplanfactory getaccessplan parametermap getparameterclass parameterpropnames outparamlist arraylist parameterpropnames parametermappings isoutputallowed outparamlist parametermappings getpropertyname outparams outparamlist toarray outparamlist outparamplan accessplanfactory getaccessplan parametermap getparameterclass outparams resultmap resultmap resultmap resultmap resultmap resultmapping resultmappings resultmap getresultmappings resultpropnames resultmappings resultpropnames resultpropnames resultmappings getpropertyname resultplan accessplanfactory getaccessplan resultmap getresultclass resultpropnames public object get data request scope request parameter map parameter map object parameter object if parameter plan null return parameter plan get properties parameter object else return no data getdata requestscope parametermap parametermap parameterobject parameterplan parameterplan getproperties parameterobject no_data public object set data request scope request result map result map object result object object values if result plan null object object result object error context error context request get error context if object null error context set more info the error occured while instantiating the result object try object result object factory util create object through factory result map get result class catch exception e throw new runtime exception java beans data exchange could not instantiate result class cause e e error context set more info the error happened while setting a property on the result object result plan set properties object values return object else return null setdata requestscope resultmap resultmap resultobject resultplan resultobject errorcontext errorcontext geterrorcontext errorcontext setmoreinfo resultobjectfactoryutil createobjectthroughfactory resultmap getresultclass runtimeexception javabeansdataexchange errorcontext setmoreinfo resultplan setproperties bug ibatis 12 public object set data request scope request parameter map parameter map object parameter object object values if out param plan null object object parameter object if object null try object result object factory util create object through factory parameter map get parameter class catch exception e throw new runtime exception java beans data exchange could not instantiate parameter class cause e e values get output param values parameter map get parameter mappings values out param plan set properties object values return object else return null setdata requestscope parametermap parametermap parameterobject outparamplan parameterobject resultobjectfactoryutil createobjectthroughfactory parametermap getparameterclass runtimeexception javabeansdataexchange getoutputparamvalues parametermap getparametermappings outparamplan setproperties private object get output param values parameter mapping mappings object values list out param values new array list for int i 0 i mappings length i if mappings i is output allowed out param values add values i return out param values to array getoutputparamvalues parametermapping outparamvalues arraylist isoutputallowed outparamvalues outparamvalues toarray public class float type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set float i float parameter float value floattypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setfloat floatvalue public object get result result set rs string column name throws sql exception float f rs get float column name if rs was null return null else return new float f getresult resultset columnname sqlexception getfloat columnname wasnull public object get result result set rs int column index throws sql exception float f rs get float column index if rs was null return null else return new float f getresult resultset columnindex sqlexception getfloat columnindex wasnull public object get result callable statement cs int column index throws sql exception float f cs get float column index if cs was null return null else return new float f getresult callablestatement columnindex sqlexception getfloat columnindex wasnull public object value of string s return float value of s valueof valueof registers a nodelet for the specified x path current x paths supported are ul li text path root element child element text li attribute path root element child element the attribute li element path root element child element the element li all elements named the element ul public void add nodelet string xpath nodelet nodelet let map put xpath nodelet xpath xpaths rootelement childelement rootelement childelement theattribute rootelement childelement theelement theelement addnodelet letmap begins parsing from the provided reader public void parse reader reader throws nodelet exception try document doc create document reader parse doc get last child catch exception e throw new nodelet exception error parsing xml cause e e nodeletexception createdocument getlastchild nodeletexception public void parse input stream input stream throws nodelet exception try document doc create document input stream parse doc get last child catch exception e throw new nodelet exception error parsing xml cause e e inputstream inputstream nodeletexception createdocument inputstream getlastchild nodeletexception begins parsing from the provided node public void parse node node path path new path process nodelet node process node path processnodelet a recursive method that walkes the dom tree registers x paths and calls nodelets registered under those x paths private void process node node path path if node instanceof element element string element name node get node name path add element name process nodelet node path to string process nodelet node new string buffer append element name to string attribute named node map attributes node get attributes int n attributes get length for int i 0 i n i node att attributes item i string attr name att get node name path add attr name process nodelet att path to string process nodelet node new string buffer append attr name to string path remove children node list children node get child nodes for int i 0 i children get length i process children item i path path add end process nodelet node path to string path remove path remove else if node instanceof text text path add text process nodelet node path to string process nodelet node text path remove xpaths xpaths elementname getnodename elementname processnodelet tostring processnodelet stringbuffer elementname tostring namednodemap getattributes getlength attrname getnodename attrname processnodelet tostring processnodelet stringbuffer attrname tostring nodelist getchildnodes getlength processnodelet tostring processnodelet tostring processnodelet private void process nodelet node node string path string nodelet nodelet nodelet let map get path string if nodelet null try nodelet process node catch exception e throw new runtime exception error parsing x path path string cause e e processnodelet pathstring letmap pathstring runtimeexception xpath pathstring creates a jaxp document from a reader private document create document reader reader throws parser configuration exception factory configuration error sax exception io exception document builder factory factory document builder factory new instance factory set validating validation factory set namespace aware false factory set ignoring comments true factory set ignoring element content whitespace false factory set coalescing false factory set expand entity references true document builder builder factory new document builder builder set entity resolver entity resolver builder set error handler new error handler public void error sax parse exception exception throws sax exception throw exception public void fatal error sax parse exception exception throws sax exception throw exception public void warning sax parse exception exception throws sax exception return builder parse new input source reader createdocument parserconfigurationexception factoryconfigurationerror saxexception ioexception documentbuilderfactory documentbuilderfactory newinstance setvalidating setnamespaceaware setignoringcomments setignoringelementcontentwhitespace setcoalescing setexpandentityreferences documentbuilder newdocumentbuilder setentityresolver entityresolver seterrorhandler errorhandler saxparseexception saxexception fatalerror saxparseexception saxexception saxparseexception saxexception inputsource builder set entity resolver entity resolver builder set error handler new error handler public void error sax parse exception exception throws sax exception throw exception setentityresolver entityresolver seterrorhandler errorhandler saxparseexception saxexception public void fatal error sax parse exception exception throws sax exception throw exception fatalerror saxparseexception saxexception public void warning sax parse exception exception throws sax exception saxparseexception saxexception creates a jaxp document from an inout stream private document create document input stream input stream throws parser configuration exception factory configuration error sax exception io exception document builder factory factory document builder factory new instance factory set validating validation factory set namespace aware false factory set ignoring comments true factory set ignoring element content whitespace false factory set coalescing false factory set expand entity references true document builder builder factory new document builder builder set entity resolver entity resolver builder set error handler new error handler public void error sax parse exception exception throws sax exception throw exception public void fatal error sax parse exception exception throws sax exception throw exception public void warning sax parse exception exception throws sax exception return builder parse new input source input stream inoutstream createdocument inputstream inputstream parserconfigurationexception factoryconfigurationerror saxexception ioexception documentbuilderfactory documentbuilderfactory newinstance setvalidating setnamespaceaware setignoringcomments setignoringelementcontentwhitespace setcoalescing setexpandentityreferences documentbuilder newdocumentbuilder setentityresolver entityresolver seterrorhandler errorhandler saxparseexception saxexception fatalerror saxparseexception saxexception saxparseexception saxexception inputsource inputstream builder set entity resolver entity resolver builder set error handler new error handler public void error sax parse exception exception throws sax exception throw exception setentityresolver entityresolver seterrorhandler errorhandler saxparseexception saxexception public void fatal error sax parse exception exception throws sax exception throw exception fatalerror saxparseexception saxexception public void warning sax parse exception exception throws sax exception saxparseexception saxexception public void set validation boolean validation this validation validation setvalidation public void set entity resolver entity resolver resolver this entity resolver resolver setentityresolver entityresolver entityresolver private list node list new array list public path nodelist arraylist public path string path string tokenizer parser new string tokenizer path false while parser has more tokens node list add parser next token stringtokenizer stringtokenizer hasmoretokens nodelist nexttoken public void add string node node list add node nodelist public void remove node list remove node list size 1 nodelist nodelist public string to string string buffer buffer new string buffer for int i 0 i node list size i buffer append node list get i if i node list size 1 buffer append return buffer to string tostring stringbuffer stringbuffer nodelist nodelist nodelist tostring public class byte array type handler extends base type handler implements type handler public void set parameter prepared statement ps int i object parameter string jdbc type throws sql exception ps set bytes i byte parameter bytearraytypehandler basetypehandler typehandler setparameter preparedstatement jdbctype sqlexception setbytes public object get result result set rs string column name throws sql exception object bytes rs get bytes column name if rs was null return null else return bytes getresult resultset columnname sqlexception getbytes columnname wasnull public object get result result set rs int column index throws sql exception object bytes rs get bytes column index if rs was null return null else return bytes getresult resultset columnindex sqlexception getbytes columnindex wasnull public object get result callable statement cs int column index throws sql exception object bytes cs get bytes column index if cs was null return null else return bytes getresult callablestatement columnindex sqlexception getbytes columnindex wasnull public object value of string s return s get bytes valueof getbytes param page size public paginated array list int page size this page size page size this index 0 this list new array list repaginate pagesize paginatedarraylist pagesize pagesize pagesize arraylist constructor to set the initial size and the page size param initial capacity the initial size param page size the page size public paginated array list int initial capacity int page size this page size page size this index 0 this list new array list initial capacity repaginate initialcapacity pagesize paginatedarraylist initialcapacity pagesize pagesize pagesize arraylist initialcapacity constructor to create an instance using an existing collection param c the collection to build the instance with param page size the page size public paginated array list collection c int page size this page size page size this index 0 this list new array list c repaginate pagesize paginatedarraylist pagesize pagesize pagesize arraylist private void repaginate if list is empty page empty list else int start index page size int end start page size 1 if end list size end list size 1 if start list size index 0 repaginate else if start 0 index list size page size if list size page size 0 index repaginate else page list sub list start end 1 isempty empty_list pagesize pagesize pagesize pagesize sublist list accessors uses page public int size return page size public boolean is empty return page is empty isempty isempty public boolean contains object o return page contains o public iterator iterator return page iterator public object to array return page to array toarray toarray public object to array object a return page to array a toarray toarray public boolean contains all collection c return page contains all c containsall containsall public object get int index return page get index public int index of object o return page index of o indexof indexof public int last index of object o return page last index of o lastindexof lastindexof public list iterator list iterator return page list iterator listiterator listiterator listiterator public list iterator list iterator int index return page list iterator index listiterator listiterator listiterator public list sub list int from index int to index return page sub list from index to index sublist fromindex toindex sublist fromindex toindex public boolean add object o boolean b list add o repaginate return b public boolean remove object o boolean b list remove o repaginate return b public boolean add all collection c boolean b list add all c repaginate return b addall addall public boolean add all int index collection c boolean b list add all index c repaginate return b addall addall public boolean remove all collection c boolean b list remove all c repaginate return b removeall removeall public boolean retain all collection c boolean b list retain all c repaginate return b retainall retainall public void clear list clear repaginate public object set int index object element object o list set index element repaginate return o public void add int index object element list add index element repaginate public object remove int index object o list remove index repaginate return o paginated list methods public int get page size return page size getpagesize pagesize public boolean is first page return index 0 isfirstpage public boolean is middle page return is first page is last page ismiddlepage isfirstpage islastpage public boolean is last page return list size index 1 page size 1 islastpage pagesize public boolean is next page available return is last page isnextpageavailable islastpage public boolean is previous page available return is first page ispreviouspageavailable isfirstpage public boolean next page if is next page available index repaginate return true else return false nextpage isnextpageavailable public boolean previous page if is previous page available index repaginate return true else return false previouspage ispreviouspageavailable public void goto page int page number index page number repaginate gotopage pagenumber pagenumber public int get page index return index getpageindex base access plan class clazz string property names this clazz clazz this property names property names info class info get instance clazz baseaccessplan propertynames propertynames propertynames classinfo getinstance protected class get types string property names class types new class property names length for int i 0 i property names length i types i info get getter type property names i return types gettypes propertynames propertynames propertynames getgettertype propertynames protected method get getters string property names method methods new method property names length for int i 0 i property names length i methods i info get getter property names i return methods getgetters propertynames propertynames propertynames getgetter propertynames protected method get setters string property names method methods new method property names length for int i 0 i property names length i methods i info get setter property names i return methods getsetters propertynames propertynames propertynames getsetter propertynames protected string get getter names string property names string names new string property names length for int i 0 i property names length i names i info get getter property names i get name return names getgetternames propertynames propertynames propertynames getgetter propertynames getname protected string get setter names string property names string names new string property names length for int i 0 i property names length i names i info get setter property names i get name return names getsetternames propertynames propertynames propertynames getsetter propertynames getname default constructor public session scope prepared statements new hash map reset sessionscope preparedstatements hashmap get the sql map client for the session return the sql map client public sql map client get sql map client return sql map client sqlmapclient sqlmapclient sqlmapclient getsqlmapclient sqlmapclient set the sql map client for the session param sql map client the sql map client public void set sql map client sql map client sql map client this sql map client sql map client sqlmapclient sqlmapclient sqlmapclient setsqlmapclient sqlmapclient sqlmapclient sqlmapclient sqlmapclient get the sql executor for the session return the sql executor public sql map executor get sql map executor return sql map executor sqlmapexecutor getsqlmapexecutor sqlmapexecutor get the sql executor for the session param sql map executor the sql executor public void set sql map executor sql map executor sql map executor this sql map executor sql map executor sqlmapexecutor setsqlmapexecutor sqlmapexecutor sqlmapexecutor sqlmapexecutor sqlmapexecutor get the transaction manager return the transaction manager public sql map transaction manager get sql map tx mgr return sql map tx mgr sqlmaptransactionmanager getsqlmaptxmgr sqlmaptxmgr set the transaction manager param sql map tx mgr the transaction manager public void set sql map tx mgr sql map transaction manager sql map tx mgr this sql map tx mgr sql map tx mgr sqlmaptxmgr setsqlmaptxmgr sqlmaptransactionmanager sqlmaptxmgr sqlmaptxmgr sqlmaptxmgr tells us if we are in batch mode or not return true if we are working with a batch public boolean is in batch return in batch isinbatch inbatch turn batch mode on or off param in batch the switch public void set in batch boolean in batch this in batch in batch inbatch setinbatch inbatch inbatch inbatch getter for the session transaction return the transaction public transaction get transaction return transaction gettransaction setter for the session transaction param transaction the transaction public void set transaction transaction transaction this transaction transaction settransaction getter for the transaction state of the session return the state public transaction state get transaction state return transaction state transactionstate gettransactionstate transactionstate setter for the transaction state of the session param transaction state the new transaction state public void set transaction state transaction state transaction state this transaction state transaction state transactionstate settransactionstate transactionstate transactionstate transactionstate transactionstate getter for the batch of the session return the batch public object get batch return batch getbatch stter for the batch of the session param batch the new batch public void set batch object batch this batch batch setbatch get the request stack depth return the stack depth public int get request stack depth return request stack depth getrequeststackdepth requeststackdepth increment the stack depth by one public void increment request stack depth request stack depth incrementrequeststackdepth requeststackdepth decrement the stack depth by one public void decrement request stack depth request stack depth decrementrequeststackdepth requeststackdepth getter to tell if a commit is required for the session return true if a commit is required public boolean is commit required return commit required iscommitrequired commitrequired setter to tell the session that a commit is required for the session param commit required the flag public void set commit required boolean commit required this commit required commit required commitrequired setcommitrequired commitrequired commitrequired commitrequired public boolean has prepared statement for string sql return prepared statements contains key sql haspreparedstatementfor preparedstatements containskey public boolean has prepared statement prepared statement ps return prepared statements contains value ps haspreparedstatement preparedstatement preparedstatements containsvalue public prepared statement get prepared statement string sql throws sql exception if has prepared statement for sql throw new sql map exception could not get prepared statement this is likely a bug prepared statement ps prepared statement prepared statements get sql return ps preparedstatement getpreparedstatement sqlexception haspreparedstatementfor sqlmapexception preparedstatement preparedstatement preparedstatements public void put prepared statement sql map executor delegate delegate string sql prepared statement ps if delegate is statement cache enabled if is in batch if has prepared statement for sql throw new sql map exception duplicate prepared statement found this is likely a bug prepared statements put sql ps putpreparedstatement sqlmapexecutordelegate preparedstatement isstatementcacheenabled isinbatch haspreparedstatementfor sqlmapexception preparedstatements public void close prepared statements iterator keys prepared statements key set iterator while keys has next prepared statement ps prepared statement prepared statements get keys next try ps close catch exception e ignore we don t care if this fails at this point prepared statements clear closepreparedstatements preparedstatements keyset hasnext preparedstatement preparedstatement preparedstatements preparedstatements public void reset super reset this batch null sql map executor null sql map tx mgr null in batch false transaction null transaction state null batch null request stack depth 0 id get next id close prepared statements prepared statements clear sqlmapexecutor sqlmaptxmgr inbatch transactionstate requeststackdepth getnextid closepreparedstatements preparedstatements public boolean equals object parameter object if this parameter object return true if parameter object instanceof session scope return false final session scope session scope session scope parameter object if id session scope id return false return true parameterobject parameterobject parameterobject sessionscope sessionscope sessionscope sessionscope parameterobject sessionscope public int hash code return int id id 32 hashcode method to get a unique id return the new id public synchronized static long get next id return next id getnextid nextid saves the current transaction state public void save transaction state saved transaction state transaction state savetransactionstate savedtransactionstate transactionstate restores the previously saved transaction state public void recall transaction state transaction state saved transaction state recalltransactionstate transactionstate savedtransactionstate public boolean is condition sql tag context ctx sql tag tag object parameter object if parameter object null return false else if parameter object instanceof map return map parameter object contains key tag get property attr else string property get resolved property ctx tag if this is a compound property then we need to get the next to the last value from the parameter object and then see if there is a readable property for the last value this logic was added for ibatis 281 and ibatis 293 int last index property last index of if last index 1 string first part property substring 0 last index string last part property substring last index 1 parameter object probe get object parameter object first part property last part if parameter object instanceof map we do this because the probe always returns true for properties in maps and that s not the behavior we want here return map parameter object contains key property else return probe has readable property parameter object property iscondition sqltagcontext sqltag parameterobject parameterobject parameterobject parameterobject containskey getpropertyattr getresolvedproperty lastindex lastindexof lastindex firstpart lastindex lastpart lastindex parameterobject getobject parameterobject firstpart lastpart parameterobject parameterobject containskey hasreadableproperty parameterobject private throttle tx throttle public transaction manager transaction config transaction config this transaction config transaction config this tx throttle new throttle transaction config get maximum concurrent transactions txthrottle transactionmanager transactionconfig transactionconfig transactionconfig transactionconfig txthrottle transactionconfig getmaximumconcurrenttransactions public void begin session scope session throws sql exception transaction exception begin session isolation level unset isolation level sessionscope sqlexception transactionexception isolationlevel unset_isolation_level public void begin session scope session int transaction isolation throws sql exception transaction exception transaction trans session get transaction transaction state state session get transaction state if state transaction state state started throw new transaction exception transaction manager could not start a new transaction a transaction is already started else if state transaction state state user provided throw new transaction exception transaction manager could not start a new transaction a user provided connection is currently being used by this session the calling set user connection null will clear the user provided transaction tx throttle increment try trans transaction config new transaction transaction isolation session set commit required false catch sql exception e tx throttle decrement throw e catch transaction exception e tx throttle decrement throw e session set transaction trans session set transaction state transaction state state started sessionscope transactionisolation sqlexception transactionexception gettransaction transactionstate gettransactionstate transactionstate state_started transactionexception transactionmanager transactionstate state_user_provided transactionexception transactionmanager setuserconnection txthrottle transactionconfig newtransaction transactionisolation setcommitrequired sqlexception txthrottle transactionexception txthrottle settransaction settransactionstate transactionstate state_started public void commit session scope session throws sql exception transaction exception transaction trans session get transaction transaction state state session get transaction state if state transaction state state user provided throw new transaction exception transaction manager could not commit a user provided connection is currently being used by this session you must call the commit method of the connection directly the calling set user connection null will clear the user provided transaction else if state transaction state state started state transaction state state committed throw new transaction exception transaction manager could not commit no transaction is started if session is commit required force commit trans commit session set commit required false session set transaction state transaction state state committed sessionscope sqlexception transactionexception gettransaction transactionstate gettransactionstate transactionstate state_user_provided transactionexception transactionmanager setuserconnection transactionstate state_started transactionstate state_committed transactionexception transactionmanager iscommitrequired forcecommit setcommitrequired settransactionstate transactionstate state_committed public void end session scope session throws sql exception transaction exception transaction trans session get transaction transaction state state session get transaction state if state transaction state state user provided throw new transaction exception transaction manager could not end this transaction a user provided connection is currently being used by this session you must call the rollback method of the connection directly the calling set user connection null will clear the user provided transaction try if trans null try if state transaction state state committed if session is commit required force commit trans rollback session set commit required false finally session close prepared statements trans close finally if state transaction state state ended tx throttle decrement session set transaction null session set transaction state transaction state state ended sessionscope sqlexception transactionexception gettransaction transactionstate gettransactionstate transactionstate state_user_provided transactionexception transactionmanager setuserconnection transactionstate state_committed iscommitrequired forcecommit setcommitrequired closepreparedstatements transactionstate state_ended txthrottle settransaction settransactionstate transactionstate state_ended public data source get data source return transaction config get data source datasource getdatasource transactionconfig getdatasource public void set data source data source ds transaction config set data source ds setdatasource datasource transactionconfig setdatasource public boolean is force commit return force commit isforcecommit forcecommit public void set force commit boolean force commit this force commit force commit setforcecommit forcecommit forcecommit forcecommit create a throttled pool for a class param type the type of objects being managed param size the size of the pool public throttled pool class type int size try this throttle new throttle size this type type this pool collections synchronized list new array list size for int i 0 i size i this pool add type new instance catch exception e throw new runtime exception error instantiating class cause e e throttledpool throttledpool synchronizedlist arraylist newinstance runtimeexception pop an object from the pool return the object public object pop throttle increment return pool remove 0 push an object onto the pool param o the object to put into the pool public void push object o if o null o get class type pool add o throttle decrement getclass private select key statement select key statement public statement type get statement type return statement type insert selectkeystatement selectkeystatement statementtype getstatementtype statementtype public object execute query for object request scope request transaction trans object parameter object object result object throws sql exception throw new sql exception insert statements cannot be executed as a query executequeryforobject requestscope parameterobject resultobject sqlexception sqlexception public list execute query for list request scope request transaction trans object parameter object int skip results int max results throws sql exception throw new sql exception insert statements cannot be executed as a query executequeryforlist requestscope parameterobject skipresults maxresults sqlexception sqlexception public void execute query with row handler request scope request transaction trans object parameter object row handler row handler throws sql exception throw new sql exception update statements cannot be executed as a query executequerywithrowhandler requestscope parameterobject rowhandler rowhandler sqlexception sqlexception public select key statement get select key statement return select key statement selectkeystatement getselectkeystatement selectkeystatement public void set select key statement select key statement select key statement this select key statement select key statement setselectkeystatement selectkeystatement selectkeystatement selectkeystatement selectkeystatement private statement statement private statement log proxy statement stmt super this statement stmt statementlogproxy public object invoke object proxy method method object params throws throwable try if execute methods contains method get name if log is debug enabled log debug stmt id statement remove breaking whitespace string params 0 if execute query equals method get name result set rs result set method invoke statement params if rs null return result set log proxy new instance rs else return null else return method invoke statement params else if get result set equals method get name result set rs result set method invoke statement params if rs null return result set log proxy new instance rs else return null else if equals equals method get name object ps params 0 if ps instanceof proxy return new boolean proxy ps return new boolean false else if hash code equals method get name return new integer proxy hash code else return method invoke statement params catch throwable t throw class info unwrap throwable t execute_methods getname isdebugenabled removebreakingwhitespace executequery getname resultset resultset resultsetlogproxy newinstance getresultset getname resultset resultset resultsetlogproxy newinstance getname hashcode getname hashcode classinfo unwrapthrowable creates a logging version of a statement param stmt the statement return the proxy public static statement new instance statement stmt invocation handler handler new statement log proxy stmt class loader cl statement class get class loader return statement proxy new proxy instance cl new class statement class handler newinstance invocationhandler statementlogproxy classloader getclassloader newproxyinstance public class delete statement extends general statement public statement type get statement type return statement type delete deletestatement generalstatement statementtype getstatementtype statementtype public object execute query for object request scope request transaction trans object parameter object object result object throws sql exception throw new sql exception delete statements cannot be executed as a query executequeryforobject requestscope parameterobject resultobject sqlexception sqlexception public list execute query for list request scope request transaction trans object parameter object int skip results int max results throws sql exception throw new sql exception delete statements cannot be executed as a query executequeryforlist requestscope parameterobject skipresults maxresults sqlexception sqlexception public void execute query with row handler request scope request transaction trans object parameter object row handler row handler throws sql exception throw new sql exception delete statements cannot be executed as a query executequerywithrowhandler requestscope parameterobject rowhandler rowhandler sqlexception sqlexception constructor to pass a sql map executor delegate in param delegate the sql map executor delegate public basic result map sql map executor delegate delegate this delegate delegate sqlmapexecutordelegate sqlmapexecutordelegate basicresultmap sqlmapexecutordelegate getter for the sql map executor delegate return the delegate public sql map executor delegate get delegate return delegate sqlmapexecutordelegate sqlmapexecutordelegate getdelegate public string get id return id getid setter for the id param id the new id public void set id string id this id id setid public class get result class return result class getresultclass resultclass public object get unique key string key prefix object values if group by props null string buffer key buffer if key prefix null key buffer new string buffer key prefix else key buffer new string buffer for int i 0 i get result mappings length i string property name get result mappings i get property name if group by props contains property name key buffer append values i key buffer append if key buffer length 1 return null else seperator value not likely to appear in a database key buffer append key separator return key buffer to string else return null getuniquekey keyprefix groupbyprops stringbuffer keybuffer keyprefix keybuffer stringbuffer keyprefix keybuffer stringbuffer getresultmappings propertyname getresultmappings getpropertyname groupbyprops propertyname keybuffer keybuffer keybuffer keybuffer key_separator keybuffer tostring public object get unique key object values return get unique key null values getuniquekey getuniquekey setter for the result class what the results will be mapped into param result class the result class public void set result class class result class this result class result class resultclass setresultclass resultclass resultclass resultclass getter for the data exchange object to be used return the data exchange object public data exchange get data exchange return data exchange dataexchange dataexchange dataexchange getdataexchange dataexchange setter for the data exchange object to be used param data exchange the new data exchange object public void set data exchange data exchange data exchange this data exchange data exchange dataexchange dataexchange dataexchange setdataexchange dataexchange dataexchange dataexchange dataexchange getter used by dom data exchange for the xml name of the results return the name public string get xml name return xml name domdataexchange getxmlname xmlname setter used by the sql map builder for the xml name of the results param xml name the name public void set xml name string xml name this xml name xml name sqlmapbuilder xmlname setxmlname xmlname xmlname xmlname getter for the resource used to report errors return the resource public string get resource return resource getresource setter for the resource used by the sql map builder param resource the resource name public void set resource string resource this resource resource sqlmapbuilder setresource public void add group by property string name if group by props null group by props new hash set group by props add name addgroupbyproperty groupbyprops groupbyprops hashset groupbyprops public boolean has group by return group by props null group by props size 0 hasgroupby groupbyprops groupbyprops public iterator group by props return group by props iterator groupbyprops groupbyprops public void add nested result mappings result mapping mapping if nested result mappings null nested result mappings new array list nested result mappings add mapping addnestedresultmappings resultmapping nestedresultmappings nestedresultmappings arraylist nestedresultmappings public list get nested result mappings return nested result mappings getnestedresultmappings nestedresultmappings public result mapping get result mappings if allow remapping return result mapping remappable result mappings get else return result mappings resultmapping getresultmappings allowremapping resultmapping remappableresultmappings resultmappings public void set discriminator discriminator discriminator if this discriminator null throw new sql map exception a discriminator may only be set once per result map this discriminator discriminator setdiscriminator sqlmapexception public discriminator get discriminator return discriminator getdiscriminator public result map resolve sub map request scope request result set rs throws sql exception result map sub map this if discriminator null basic result mapping mapping basic result mapping discriminator get result mapping object value get primitive result mapping value rs mapping if value null value do null mapping value mapping sub map discriminator get sub map string value of value if sub map null sub map this else if sub map this sub map sub map resolve sub map request rs return sub map resultmap resolvesubmap requestscope resultset sqlexception resultmap submap basicresultmapping basicresultmapping getresultmapping getprimitiveresultmappingvalue donullmapping submap getsubmap valueof submap submap submap submap submap resolvesubmap submap setter for a list of the individual result mapping objects param result mapping list the list public void set result mapping list list result mapping list if allow remapping this remappable result mappings set basic result mapping result mapping list to array new basic result mapping result mapping list size else this result mappings basic result mapping result mapping list to array new basic result mapping result mapping list size map props new hash map props put map this data exchange get delegate get data exchange factory get data exchange for class result class data exchange initialize props resultmapping resultmappinglist setresultmappinglist resultmappinglist allowremapping remappableresultmappings basicresultmapping resultmappinglist toarray basicresultmapping resultmappinglist resultmappings basicresultmapping resultmappinglist toarray basicresultmapping resultmappinglist hashmap dataexchange getdelegate getdataexchangefactory getdataexchangeforclass resultclass dataexchange getter for the number of result mapping objects return the count public int get result count return this get result mappings length resultmapping getresultcount getresultmappings read a row from a resultset and map results to an array param request scope of the request param rs result set to read from return row read as an array of column values throws java sql sql exception public object get results request scope request result set rs throws sql exception error context error context request get error context error context set activity applying a result map error context set object id this get id error context set resource this get resource error context set more info check the result map boolean found data false object column values new object get result mappings length for int i 0 i get result mappings length i basic result mapping mapping basic result mapping get result mappings i error context set more info mapping get error string if mapping get statement name null if result class null throw new sql map exception the result class was null when trying to get results for result map named get id else if map class is assignable from result class class java type mapping get java type if java type null java type object class column values i get nested select mapping value request rs mapping java type else if dom type marker class is assignable from result class class java type mapping get java type if java type null java type dom type marker class column values i get nested select mapping value request rs mapping java type else probe p probe factory get probe result class class type p get property type for setter result class mapping get property name column values i get nested select mapping value request rs mapping type found data found data column values i null else if mapping get nested result map name null column values i get primitive result mapping value rs mapping if column values i null column values i do null mapping column values i mapping else found data true request set row data found found data return column values resultset sqlexception getresults requestscope resultset sqlexception errorcontext errorcontext geterrorcontext errorcontext setactivity errorcontext setobjectid getid errorcontext setresource getresource errorcontext setmoreinfo founddata columnvalues getresultmappings getresultmappings basicresultmapping basicresultmapping getresultmappings errorcontext setmoreinfo geterrorstring getstatementname resultclass sqlmapexception resultmap getid isassignablefrom resultclass javatype getjavatype javatype javatype columnvalues getnestedselectmappingvalue javatype domtypemarker isassignablefrom resultclass javatype getjavatype javatype javatype domtypemarker columnvalues getnestedselectmappingvalue javatype probefactory getprobe resultclass getpropertytypeforsetter resultclass getpropertyname columnvalues getnestedselectmappingvalue founddata founddata columnvalues getnestedresultmapname columnvalues getprimitiveresultmappingvalue columnvalues columnvalues donullmapping columnvalues founddata setrowdatafound founddata columnvalues public object set result object values request scope request object result object object values string ukey string get unique key request get current nested key values map unique keys request get unique keys this request set current nested key ukey if unique keys null unique keys contains key ukey unique key is already known so get the existing result object and process additional results result object unique keys get ukey apply nested result map request result object values result object no value else if ukey null unique keys null unique keys contains key ukey unique key is not known so create a new result object and then process additional results result object data exchange set data request this result object values lazy init key set only if we re grouped by something i e ukey null if ukey null if unique keys null unique keys new hash map request set unique keys this unique keys unique keys put ukey result object apply nested result map request result object values else otherwise we don t care about these results result object no value return result object setresultobjectvalues requestscope resultobject getuniquekey getcurrentnestedkey uniquekeys getuniquekeys setcurrentnestedkey uniquekeys uniquekeys containskey resultobject uniquekeys applynestedresultmap resultobject resultobject no_value uniquekeys uniquekeys containskey resultobject dataexchange setdata resultobject uniquekeys uniquekeys hashmap setuniquekeys uniquekeys uniquekeys resultobject applynestedresultmap resultobject resultobject no_value resultobject private void apply nested result map request scope request object result object object values if result object null result object no value if nested result mappings null for int i 0 n nested result mappings size i n i basic result mapping result mapping basic result mapping nested result mappings get i set nested result mapping value result mapping request result object values applynestedresultmap requestscope resultobject resultobject resultobject no_value nestedresultmappings nestedresultmappings basicresultmapping resultmapping basicresultmapping nestedresultmappings setnestedresultmappingvalue resultmapping resultobject some changes in this method for ibatis 225 ul li we no longer require the nested property to be a collection this will allow reuses of result maps on 1 1 relationships li li if the nested property is not a collection then it will be created replaced by the values generated from the current row li ul param mapping param request param result object param values protected void set nested result mapping value basic result mapping mapping request scope request object result object object values try string result map name mapping get nested result map name result map result map get delegate get result map result map name get the discriminated submap if it exists result map result map resolve sub map request request get result set class type mapping get java type string property name mapping get property name object obj probe get object result object property name if obj null if type null type probe get property type for setter result object property name try create the object if is it a collection if not a collection then we will just set the property to the object created in processing the nested result map if collection class is assignable from type obj result object factory util create object through factory type probe set object result object property name obj catch exception e throw new sql map exception error instantiating collection property for mapping mapping get property name cause e e values result map get results request request get result set if request is row data found object o result map set result object values request null values if o no value if obj null obj instanceof collection collection obj add o else probe set object result object property name o catch sql exception e throw new sql map exception error getting nested result map values for mapping get property name cause e e resultmaps resultobject setnestedresultmappingvalue basicresultmapping requestscope resultobject resultmapname getnestedresultmapname resultmap resultmap getdelegate getresultmap resultmapname resultmap resultmap resolvesubmap getresultset getjavatype propertyname getpropertyname getobject resultobject propertyname getpropertytypeforsetter resultobject propertyname isassignablefrom resultobjectfactoryutil createobjectthroughfactory setobject resultobject propertyname sqlmapexception getpropertyname resultmap getresults getresultset isrowdatafound resultmap setresultobjectvalues no_value setobject resultobject propertyname sqlexception sqlmapexception getpropertyname protected object get nested select mapping value request scope request result set rs basic result mapping mapping class target type throws sql exception try type handler factory type handler factory get delegate get type handler factory string statement name mapping get statement name extended sql map client client extended sql map client request get session get sql map client mapped statement mapped statement client get mapped statement statement name class parameter type mapped statement get parameter class object parameter object null if parameter type null parameter object prepare bean parameter object request rs mapping parameter type else if type handler factory has type handler parameter type parameter object prepare primitive parameter object rs mapping parameter type else if dom type marker class is assignable from parameter type parameter object prepare dom parameter object rs mapping else parameter object prepare bean parameter object request rs mapping parameter type object result null if parameter object null sql sql mapped statement get sql result map result map sql get result map request parameter object class result class result map get result class if result class null dom type marker class is assignable from target type if dom collection type marker class is assignable from result class target type dom collection type marker class else if dom type marker class is assignable from result class target type dom type marker class result result loader load result client statement name parameter object target type string null value mapping get null value if result null null value null type handler type handler type handler factory get type handler target type if type handler null result type handler value of null value return result catch instantiation exception e throw new nestedsql exception error setting nested bean property cause e e catch illegal access exception e throw new nestedsql exception error setting nested bean property cause e e getnestedselectmappingvalue requestscope resultset basicresultmapping targettype sqlexception typehandlerfactory typehandlerfactory getdelegate gettypehandlerfactory statementname getstatementname extendedsqlmapclient extendedsqlmapclient getsession getsqlmapclient mappedstatement mappedstatement getmappedstatement statementname parametertype mappedstatement getparameterclass parameterobject parametertype parameterobject preparebeanparameterobject parametertype typehandlerfactory hastypehandler parametertype parameterobject prepareprimitiveparameterobject parametertype domtypemarker isassignablefrom parametertype parameterobject preparedomparameterobject parameterobject preparebeanparameterobject parametertype parameterobject mappedstatement getsql resultmap resultmap getresultmap parameterobject resultclass resultmap getresultclass resultclass domtypemarker isassignablefrom targettype domcollectiontypemarker isassignablefrom resultclass targettype domcollectiontypemarker domtypemarker isassignablefrom resultclass targettype domtypemarker resultloader loadresult statementname parameterobject targettype nullvalue getnullvalue nullvalue typehandler typehandler typehandlerfactory gettypehandler targettype typehandler typehandler valueof nullvalue instantiationexception nestedsqlexception illegalaccessexception nestedsqlexception private object prepare primitive parameter object result set rs basic result mapping mapping class parameter type throws sql exception object parameter object type handler factory type handler factory get delegate get type handler factory type handler th type handler factory get type handler parameter type parameter object th get result rs mapping get column name return parameter object prepareprimitiveparameterobject resultset basicresultmapping parametertype sqlexception parameterobject typehandlerfactory typehandlerfactory getdelegate gettypehandlerfactory typehandler typehandlerfactory gettypehandler parametertype parameterobject getresult getcolumnname parameterobject private document new document string root try document doc document builder factory new instance new document builder new document doc append child doc create element root return doc catch parser configuration exception e throw new runtime exception error creating xml document cause e newdocument documentbuilderfactory newinstance newdocumentbuilder newdocument appendchild createelement parserconfigurationexception runtimeexception private object prepare dom parameter object result set rs basic result mapping mapping throws sql exception type handler factory type handler factory get delegate get type handler factory document doc new document parameter probe probe probe factory get probe doc string complex name mapping get column name type handler string type handler type handler factory get type handler string class if complex name index of 1 old 1 x style multiple params string tokenizer parser new string tokenizer complex name false while parser has more tokens string prop name parser next token string col name parser next token object prop value string type handler get result rs col name probe set object doc prop name prop value to string else single param object prop value string type handler get result rs complex name probe set object doc value prop value to string return doc preparedomparameterobject resultset basicresultmapping sqlexception typehandlerfactory typehandlerfactory getdelegate gettypehandlerfactory newdocument probefactory getprobe complexname getcolumnname typehandler stringtypehandler typehandlerfactory gettypehandler complexname indexof stringtokenizer stringtokenizer complexname hasmoretokens propname nexttoken colname nexttoken propvalue stringtypehandler getresult colname setobject propname propvalue tostring propvalue stringtypehandler getresult complexname setobject propvalue tostring private object prepare bean parameter object request scope request result set rs basic result mapping mapping class parameter type throws instantiation exception illegal access exception sql exception type handler factory type handler factory get delegate get type handler factory object parameter object if parameter type null parameter object new hash map else parameter object result object factory util create object through factory parameter type string complex name mapping get column name if complex name index of 1 complex name index of 1 string tokenizer parser new string tokenizer complex name false while parser has more tokens string prop name parser next token string col name parser next token class prop type probe get property type for setter parameter object prop name type handler prop type handler type handler factory get type handler prop type object prop value prop type handler get result rs col name probe set object parameter object prop name prop value else single param type handler prop type handler type handler factory get type handler parameter type if prop type handler null prop type handler type handler factory get unkown type handler parameter object prop type handler get result rs complex name return parameter object preparebeanparameterobject requestscope resultset basicresultmapping parametertype instantiationexception illegalaccessexception sqlexception typehandlerfactory typehandlerfactory getdelegate gettypehandlerfactory parameterobject parametertype parameterobject hashmap parameterobject resultobjectfactoryutil createobjectthroughfactory parametertype complexname getcolumnname complexname indexof complexname indexof stringtokenizer stringtokenizer complexname hasmoretokens propname nexttoken colname nexttoken proptype getpropertytypeforsetter parameterobject propname typehandler proptypehandler typehandlerfactory gettypehandler proptype propvalue proptypehandler getresult colname setobject parameterobject propname propvalue typehandler proptypehandler typehandlerfactory gettypehandler parametertype proptypehandler proptypehandler typehandlerfactory getunkowntypehandler parameterobject proptypehandler getresult complexname parameterobject protected object get primitive result mapping value result set rs basic result mapping mapping throws sql exception object value null type handler type handler mapping get type handler if type handler null string column name mapping get column name int column index mapping get column index if column name null value type handler get result rs column index else value type handler get result rs column name else throw new sql map exception no type handler could be found to map the property mapping get property name to the column mapping get column name one or both of the types or the combination of types is not supported return value getprimitiveresultmappingvalue resultset basicresultmapping sqlexception typehandler typehandler gettypehandler typehandler columnname getcolumnname columnindex getcolumnindex columnname typehandler getresult columnindex typehandler getresult columnname sqlmapexception getpropertyname getcolumnname protected object do null mapping object value basic result mapping mapping throws sql map exception if value null type handler type handler mapping get type handler if type handler null string null value mapping get null value if null value null value type handler value of null value return value else throw new sql map exception no type handler could be found to map the property mapping get property name to the column mapping get column name one or both of the types or the combination of types is not supported else return value donullmapping basicresultmapping sqlmapexception typehandler typehandler gettypehandler typehandler nullvalue getnullvalue nullvalue typehandler valueof nullvalue sqlmapexception getpropertyname getcolumnname constructor for the factory param data exchange factory the factory public complex data exchange data exchange factory data exchange factory super data exchange factory dataexchangefactory complexdataexchange dataexchangefactory dataexchangefactory dataexchangefactory public void initialize map properties public object get data request scope request parameter map parameter map object parameter object type handler factory type handler factory get data exchange factory get type handler factory if parameter object null return new object 1 else if type handler factory has type handler parameter object get class parameter mapping mappings parameter map get parameter mappings object data new object mappings length for int i 0 i mappings length i data i parameter object return data else object data new object parameter map get parameter mappings length parameter mapping mappings parameter map get parameter mappings for int i 0 i mappings length i data i probe get object parameter object mappings i get property name return data getdata requestscope parametermap parametermap parameterobject typehandlerfactory typehandlerfactory getdataexchangefactory gettypehandlerfactory parameterobject typehandlerfactory hastypehandler parameterobject getclass parametermapping parametermap getparametermappings parameterobject parametermap getparametermappings parametermapping parametermap getparametermappings getobject parameterobject getpropertyname public object set data request scope request result map result map object result object object values type handler factory type handler factory get data exchange factory get type handler factory if type handler factory has type handler result map get result class return values 0 else object object result object if object null try object result object factory util create object through factory result map get result class catch exception e throw new runtime exception java beans data exchange could not instantiate result class cause e e result mapping mappings result map get result mappings for int i 0 i mappings length i probe set object object mappings i get property name values i return object setdata requestscope resultmap resultmap resultobject typehandlerfactory typehandlerfactory getdataexchangefactory gettypehandlerfactory typehandlerfactory hastypehandler resultmap getresultclass resultobject resultobjectfactoryutil createobjectthroughfactory resultmap getresultclass runtimeexception javabeansdataexchange resultmapping resultmap getresultmappings setobject getpropertyname public object set data request scope request parameter map parameter map object parameter object object values type handler factory type handler factory get data exchange factory get type handler factory if type handler factory has type handler parameter map get parameter class return values 0 else object object parameter object if object null try object result object factory util create object through factory parameter map get parameter class catch exception e throw new runtime exception java beans data exchange could not instantiate result class cause e e parameter mapping mappings parameter map get parameter mappings for int i 0 i mappings length i if mappings i is output allowed probe set object object mappings i get property name values i return object setdata requestscope parametermap parametermap parameterobject typehandlerfactory typehandlerfactory getdataexchangefactory gettypehandlerfactory typehandlerfactory hastypehandler parametermap getparameterclass parameterobject resultobjectfactoryutil createobjectthroughfactory parametermap getparameterclass runtimeexception javabeansdataexchange parametermapping parametermap getparametermappings isoutputallowed setobject getpropertyname private static final base probe dom probe new dom probe protected generic probe baseprobe dom_probe domprobe genericprobe gets an object from a map or bean param object the object to probe param name the name of the property or map entry return the value of the property or map entry see com ibatis common beans base probe get object java lang object java lang string public object get object object object string name if object instanceof org w3c dom document return dom probe get object object name else if object instanceof list return bean probe get indexed property object name else if object instanceof object return bean probe get indexed property object name else if object instanceof char return bean probe get indexed property object name else if object instanceof boolean return bean probe get indexed property object name else if object instanceof byte return bean probe get indexed property object name else if object instanceof double return bean probe get indexed property object name else if object instanceof float return bean probe get indexed property object name else if object instanceof int return bean probe get indexed property object name else if object instanceof long return bean probe get indexed property object name else if object instanceof short return bean probe get indexed property object name else return bean probe get object object name baseprobe getobject getobject dom_probe getobject bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getindexedproperty bean_probe getobject sets an object in a map or bean param object the object to probe param name the name of the property or map entry param value the new value of the property or map entry see com ibatis common beans base probe set object java lang object java lang string java lang object public void set object object object string name object value if object instanceof org w3c dom document dom probe set object object name value else bean probe set object object name value baseprobe setobject setobject dom_probe setobject bean_probe setobject gets an array of the readable properties in a map or java bean param object the object to get properties for return the array of properties or map entries see com ibatis common beans base probe get readable property names java lang object public string get readable property names object object if object instanceof org w3c dom document return dom probe get readable property names object else return bean probe get readable property names object javabean baseprobe getreadablepropertynames getreadablepropertynames dom_probe getreadablepropertynames bean_probe getreadablepropertynames gets an array of the writeable properties in a map or java bean param object the object to get properties for return the array of properties or map entries see com ibatis common beans base probe get writeable property names java lang object public string get writeable property names object object if object instanceof org w3c dom document return dom probe get writeable property names object else return bean probe get writeable property names object javabean baseprobe getwriteablepropertynames getwriteablepropertynames dom_probe getwriteablepropertynames bean_probe getwriteablepropertynames returns the class that the setter expects to receive as a parameter when setting a property value param object the class to check param name the name of the property return the type of the property see com ibatis common beans probe get property type for setter java lang object java lang string public class get property type for setter object object string name if object instanceof class return get class property type for setter class object name else if object instanceof org w3c dom document return dom probe get property type for setter object name else return bean probe get property type for setter object name getpropertytypeforsetter getpropertytypeforsetter getclasspropertytypeforsetter dom_probe getpropertytypeforsetter bean_probe getpropertytypeforsetter returns the class that the getter will return when reading a property value param object the bean to check param name the name of the property return the type of the property see com ibatis common beans probe get property type for getter java lang object java lang string public class get property type for getter object object string name if object instanceof class return get class property type for getter class object name else if object instanceof org w3c dom document return dom probe get property type for getter object name else if name index of 1 return bean probe get indexed type object name else return bean probe get property type for getter object name getpropertytypeforgetter getpropertytypeforgetter getclasspropertytypeforgetter dom_probe getpropertytypeforgetter indexof bean_probe getindexedtype bean_probe getpropertytypeforgetter checks to see if an object has a writable property by a given name param object the bean to check param property name the property to check for return true if the property exists and is writable see com ibatis common beans probe has writable property java lang object java lang string public boolean has writable property object object string property name if object instanceof org w3c dom document return dom probe has writable property object property name else return bean probe has writable property object property name propertyname haswritableproperty haswritableproperty propertyname dom_probe haswritableproperty propertyname bean_probe haswritableproperty propertyname checks to see if a bean has a readable property by a given name param object the bean to check param property name the property to check for return true if the property exists and is readable see com ibatis common beans probe has readable property java lang object java lang string public boolean has readable property object object string property name if object instanceof org w3c dom document return dom probe has readable property object property name else return bean probe has readable property object property name propertyname hasreadableproperty hasreadableproperty propertyname dom_probe hasreadableproperty propertyname bean_probe hasreadableproperty propertyname protected void set property object object string property object value if object instanceof org w3c dom document dom probe set property object property value else bean probe set property object property value setproperty dom_probe setproperty bean_probe setproperty protected object get property object object string property if object instanceof org w3c dom document return dom probe get property object property else return bean probe get property object property getproperty dom_probe getproperty bean_probe getproperty private class get class property type for getter class type string name if name index of 1 string tokenizer parser new string tokenizer name while parser has more tokens name parser next token if map class is assignable from type type object class break type class info get instance type get getter type name else type class info get instance type get getter type name return type getclasspropertytypeforgetter indexof stringtokenizer stringtokenizer hasmoretokens nexttoken isassignablefrom classinfo getinstance getgettertype classinfo getinstance getgettertype returns the class that the setter expects to receive as a parameter when setting a property value param type the class to check param name the name of the property return the type of the property private class get class property type for setter class type string name if name index of 1 string tokenizer parser new string tokenizer name while parser has more tokens name parser next token if map class is assignable from type type object class break type class info get instance type get setter type name else type class info get instance type get setter type name return type getclasspropertytypeforsetter indexof stringtokenizer stringtokenizer hasmoretokens nexttoken isassignablefrom classinfo getinstance getsettertype classinfo getinstance getsettertype default constructor public fifo cache controller this cache size 100 this cache collections synchronized map new hash map this key list collections synchronized list new linked list fifocachecontroller cachesize synchronizedmap hashmap keylist synchronizedlist linkedlist configures the cache param props optionally can contain properties reference type weak soft strong public void configure properties props string size props get property cache size if size null size props get property size if size null cache size integer parse int size getproperty getproperty cachesize parseint add an object to the cache param cache model the cache model param key the key of the object to be cached param value the object to be cached public void put object cache model cache model object key object value cache put key value key list add key if key list size cache size try object oldest key key list remove 0 cache remove oldest key catch index out of bounds exception e ignore cachemodel cachemodel putobject cachemodel cachemodel keylist keylist cachesize oldestkey keylist oldestkey indexoutofboundsexception get an object out of the cache param cache model the cache model param key the key of the object to be returned return the cached object or null public object get object cache model cache model object key return cache get key cachemodel getobject cachemodel cachemodel public object remove object cache model cache model object key key list remove key return cache remove key removeobject cachemodel cachemodel keylist flushes the cache param cache model the cache model public void flush cache model cache model cache clear key list clear cachemodel cachemodel cachemodel keylist default constructor public request scope error context new error context reset requestscope errorcontext errorcontext return returns the current nested key public string get current nested key return current nested key currentnestedkey getcurrentnestedkey currentnestedkey param current nested key the current nested key to set public void set current nested key string current nested key this current nested key current nested key currentnestedkey currentnestedkey setcurrentnestedkey currentnestedkey currentnestedkey currentnestedkey get the request s error context return the request s error context public error context get error context return error context errorcontext geterrorcontext errorcontext get the session of the request return the session public session scope get session return session sessionscope getsession set the session for the request param session the new session public void set session session scope session this session session setsession sessionscope get the statement for the request return the statement public mapped statement get statement return statement mappedstatement getstatement set the statement for the request param statement the statement public void set statement mapped statement statement this statement statement setstatement mappedstatement get the parameter map for the request return the parameter map public parameter map get parameter map return parameter map parametermap getparametermap parametermap set the parameter map for the request param parameter map the new parameter map public void set parameter map parameter map parameter map this parameter map parameter map parametermap setparametermap parametermap parametermap parametermap parametermap get the result map for the request return the result map public result map get result map return result map resultmap getresultmap resultmap set the result map for the request param result map the result map public void set result map result map result map this result map result map resultmap setresultmap resultmap resultmap resultmap resultmap get the sql for the request return the sql public sql get sql return sql getsql set the sql for the request param sql the sql public void set sql sql sql this sql sql setsql get the dynamic parameter for the request return the dynamic parameter public parameter map get dynamic parameter map return dynamic parameter map parametermap getdynamicparametermap dynamicparametermap set the dynamic parameter for the request param dynamic parameter map the dynamic parameter public void set dynamic parameter map parameter map dynamic parameter map this dynamic parameter map dynamic parameter map dynamicparametermap setdynamicparametermap parametermap dynamicparametermap dynamicparametermap dynamicparametermap get the dynamic sql for the request return the dynamic sql public string get dynamic sql return dynamic sql getdynamicsql dynamicsql set the dynamic sql for the request param dynamic sql the dynamic sql public void set dynamic sql string dynamic sql this dynamic sql dynamic sql dynamicsql setdynamicsql dynamicsql dynamicsql dynamicsql public result set get result set return result set resultset getresultset resultset public void set result set result set result set this result set result set setresultset resultset resultset resultset resultset public map get unique keys result map map if unique keys null return null return map unique keys get map getuniquekeys resultmap uniquekeys uniquekeys public void set unique keys result map map map keys if unique keys null unique keys new hash map this unique keys put map keys setuniquekeys resultmap uniquekeys uniquekeys hashmap uniquekeys public boolean is row data found return row data found isrowdatafound rowdatafound public void set row data found boolean row data found this row data found row data found setrowdatafound rowdatafound rowdatafound rowdatafound public void reset super reset error context reset session null statement null parameter map null result map null sql null dynamic parameter map null dynamic sql null result set null unique keys null row data found true errorcontext parametermap resultmap dynamicparametermap dynamicsql resultset uniquekeys rowdatafound constructor param result map the result map param result object the result object param row handler the row handler object public row handler callback result map result map object result object row handler row handler this row handler row handler this result map result map this result object result object resultmap resultobject rowhandler rowhandlercallback resultmap resultmap resultobject rowhandler rowhandler rowhandler rowhandler resultmap resultmap resultobject resultobject prepares the row object and passes it to the row handler param request the request scope param results the result data public void handle result object request scope request object results result set rs throws sql exception object object request set current nested key null object result map resolve sub map request rs set result object values request result object results if object result map no value xml only special processing converts elements to string for easy insertion int stack depth request get session get request stack depth if stack depth 1 class target type request get result map get result class if xml type marker class is assignable from target type object instanceof document object document to string document object row handler handle row object handleresultobject requestscope resultset sqlexception setcurrentnestedkey resultmap resolvesubmap setresultobjectvalues resultobject resultmap no_value stackdepth getsession getrequeststackdepth stackdepth targettype getresultmap getresultclass xmltypemarker isassignablefrom targettype documenttostring rowhandler handlerow private string document to string document document string s null try transformer factory t factory transformer factory new instance transformer transformer t factory new transformer dom source source new dom source document string writer writer new string writer stream result result new stream result writer transformer transform source result s writer get buffer to string catch transformer exception e throw new runtime exception error occurred cause e e return s documenttostring transformerfactory tfactory transformerfactory newinstance tfactory newtransformer domsource domsource stringwriter stringwriter streamresult streamresult getbuffer tostring transformerexception runtimeexception public row handler get row handler return row handler rowhandler getrowhandler rowhandler public abstract class base tag handler implements sql tag handler public int do start fragment sql tag context ctx sql tag tag object parameter object ctx push remove first prepend marker tag return sql tag handler include body basetaghandler sqltaghandler dostartfragment sqltagcontext sqltag parameterobject pushremovefirstprependmarker sqltaghandler include_body public int do end fragment sql tag context ctx sql tag tag object parameter object string buffer body content if tag is close available tag get handler instanceof iterate tag handler if body content to string trim length 0 body content append tag get close attr return sql tag handler include body doendfragment sqltagcontext sqltag parameterobject stringbuffer bodycontent iscloseavailable gethandler iteratetaghandler bodycontent tostring bodycontent getcloseattr sqltaghandler include_body public void do prepend sql tag context ctx sql tag tag object parameter object string buffer body content if tag is open available tag get handler instanceof iterate tag handler if body content to string trim length 0 body content insert 0 tag get open attr if tag is prepend available if body content to string trim length 0 if tag get parent null ctx peek remove first prepend marker tag ctx disable remove first prepend marker else body content insert 0 tag get prepend attr doprepend sqltagcontext sqltag parameterobject stringbuffer bodycontent isopenavailable gethandler iteratetaghandler bodycontent tostring bodycontent getopenattr isprependavailable bodycontent tostring getparent peekremovefirstprependmarker disableremovefirstprependmarker bodycontent getprependattr public class dynamic tag handler extends base tag handler public int do start fragment sql tag context ctx sql tag tag object parameter object ctx push remove first prepend marker tag return base tag handler include body dynamictaghandler basetaghandler dostartfragment sqltagcontext sqltag parameterobject pushremovefirstprependmarker basetaghandler include_body public class transaction exception extends exception public transaction exception transactionexception transactionexception public transaction exception string msg super msg transactionexception public transaction exception throwable cause super cause transactionexception public transaction exception string msg throwable cause super msg cause transactionexception default constructor public sql map executor delegate mapped statements new hash map cache models new hash map result maps new hash map parameter maps new hash map request pool new throttled pool request scope class default max requests session pool new throttled pool session scope class default max sessions sql executor new sql executor type handler factory new type handler factory data exchange factory new data exchange factory type handler factory sqlmapexecutordelegate mappedstatements hashmap cachemodels hashmap resultmaps hashmap parametermaps hashmap requestpool throttledpool requestscope default_max_requests sessionpool throttledpool sessionscope default_max_sessions sqlexecutor sqlexecutor typehandlerfactory typehandlerfactory dataexchangefactory dataexchangefactory typehandlerfactory getter for the data exchange factory return the data exchange factory public data exchange factory get data exchange factory return data exchange factory dataexchangefactory dataexchangefactory dataexchangefactory getdataexchangefactory dataexchangefactory getter for the type handler factory return the type handler factory public type handler factory get type handler factory return type handler factory typehandlerfactory typehandlerfactory typehandlerfactory gettypehandlerfactory typehandlerfactory getter for the status of lazy loading return the status public boolean is lazy loading enabled return lazy loading enabled islazyloadingenabled lazyloadingenabled turn on or off lazy loading param lazy loading enabled the new state of caching public void set lazy loading enabled boolean lazy loading enabled this lazy loading enabled lazy loading enabled lazyloadingenabled setlazyloadingenabled lazyloadingenabled lazyloadingenabled lazyloadingenabled getter for the status of caching return the status public boolean is cache models enabled return cache models enabled iscachemodelsenabled cachemodelsenabled turn on or off caching param cache models enabled the new state of caching public void set cache models enabled boolean cache models enabled this cache models enabled cache models enabled cachemodelsenabled setcachemodelsenabled cachemodelsenabled cachemodelsenabled cachemodelsenabled getter for the status of cg lib enhancements return the status public boolean is enhancement enabled return enhancement enabled cglib isenhancementenabled enhancementenabled turn on or off cg lib enhancements param enhancement enabled the new state public void set enhancement enabled boolean enhancement enabled this enhancement enabled enhancement enabled cglib enhancementenabled setenhancementenabled enhancementenabled enhancementenabled enhancementenabled getter for the maximum number of requests return the maximum number of requests public int get max requests return max requests getmaxrequests maxrequests setter for the maximum number of requests param max requests the maximum number of requests public void set max requests int max requests this max requests max requests request pool new throttled pool request scope class max requests maxrequests setmaxrequests maxrequests maxrequests maxrequests requestpool throttledpool requestscope maxrequests getter for the maximum number of sessions return the maximum number of sessions public int get max sessions return max sessions getmaxsessions maxsessions setter for the maximum number of sessions param max sessions the maximum number of sessions public void set max sessions int max sessions this max sessions max sessions this session pool new throttled pool session scope class max sessions maxsessions setmaxsessions maxsessions maxsessions maxsessions sessionpool throttledpool sessionscope maxsessions getter for the the maximum number of transactions return the maximum number of transactions public int get max transactions return max transactions getmaxtransactions maxtransactions setter for the maximum number of transactions param max transactions the maximum number of transactions public void set max transactions int max transactions this max transactions max transactions maxtransactions setmaxtransactions maxtransactions maxtransactions maxtransactions getter for the transaction manager return the transaction manager public transaction manager get tx manager return tx manager transactionmanager gettxmanager txmanager setter for the transaction manager param tx manager the transaction manager public void set tx manager transaction manager tx manager this tx manager tx manager txmanager settxmanager transactionmanager txmanager txmanager txmanager add a mapped statement param ms the mapped statement to add public void add mapped statement mapped statement ms if mapped statements contains key ms get id throw new sql map exception there is already a statement named ms get id in this sql map ms set base cache key hash code mapped statements put ms get id ms addmappedstatement mappedstatement mappedstatements containskey getid sqlmapexception getid sqlmap setbasecachekey hashcode mappedstatements getid get an iterator of the mapped statements return the iterator public iterator get mapped statement names return mapped statements key set iterator getmappedstatementnames mappedstatements keyset get a mappedstatement by its id param id the statement id return the mapped statement public mapped statement get mapped statement string id mapped statement ms mapped statement mapped statements get id if ms null throw new sql map exception there is no statement named id in this sql map return ms mappedstatement getmappedstatement mappedstatement mappedstatement mappedstatements sqlmapexception sqlmap add a cache model param model the model to add public void add cache model cache model model cache models put model get id model addcachemodel cachemodel cachemodels getid get an iterator of the cache models return the cache models public iterator get cache model names return cache models key set iterator getcachemodelnames cachemodels keyset get a cache model by id param id the id return the cache model public cache model get cache model string id cache model model cache model cache models get id if model null throw new sql map exception there is no cache model named id in this sql map return model cachemodel getcachemodel cachemodel cachemodel cachemodels sqlmapexception sqlmap add a result map param map the result map to add public void add result map result map map result maps put map get id map addresultmap resultmap resultmaps getid get an iterator of the result maps return the result maps public iterator get result map names return result maps key set iterator getresultmapnames resultmaps keyset get a result map by id param id the id return the result map public result map get result map string id result map map result map result maps get id if map null throw new sql map exception there is no result map named id in this sql map return map resultmap getresultmap resultmap resultmap resultmaps sqlmapexception sqlmap add a parameter map param map the map to add public void add parameter map parameter map map parameter maps put map get id map addparametermap parametermap parametermaps getid get an iterator of all of the parameter maps return the parameter maps public iterator get parameter map names return parameter maps key set iterator getparametermapnames parametermaps keyset get a parameter map by id param id the id return the parameter map public parameter map get parameter map string id parameter map map parameter map parameter maps get id if map null throw new sql map exception there is no parameter map named id in this sql map return map parametermap getparametermap parametermap parametermap parametermaps sqlmapexception sqlmap flush all of the data caches public void flush data cache iterator models cache models values iterator while models has next cache model models next flush flushdatacache cachemodels hasnext cachemodel flush a single cache by id param id the id public void flush data cache string id cache model model get cache model id if model null model flush flushdatacache cachemodel getcachemodel basic methods call an insert statement by id param session the session param id the statement id param param the parameter object return the generated key or null throws sql exception if the insert fails public object insert session scope session string id object param throws sql exception object generated key null mapped statement ms get mapped statement id transaction trans get transaction session boolean auto start trans null try trans auto start transaction session auto start trans select key statement select key statement null if ms instanceof insert statement select key statement insert statement ms get select key statement if select key statement null select key statement is after generated key execute select key session trans ms param request scope request pop request session ms try ms execute update request trans param finally push request request if select key statement null select key statement is after generated key execute select key session trans ms param auto commit transaction session auto start finally auto end transaction session auto start return generated key sqlexception sessionscope sqlexception generatedkey mappedstatement getmappedstatement gettransaction autostart autostarttransaction autostart selectkeystatement selectkeystatement insertstatement selectkeystatement insertstatement getselectkeystatement selectkeystatement selectkeystatement isafter generatedkey executeselectkey requestscope poprequest executeupdate pushrequest selectkeystatement selectkeystatement isafter generatedkey executeselectkey autocommittransaction autostart autoendtransaction autostart generatedkey private object execute select key session scope session transaction trans mapped statement ms object param throws sql exception object generated key null request scope request insert statement insert insert statement ms select key statement select key statement insert get select key statement if select key statement null request pop request session select key statement try generated key select key statement execute query for object request trans param null string key prop select key statement get key property if key prop null probe set object param key prop generated key finally push request request return generated key executeselectkey sessionscope mappedstatement sqlexception generatedkey requestscope insertstatement insertstatement selectkeystatement selectkeystatement getselectkeystatement selectkeystatement poprequest selectkeystatement generatedkey selectkeystatement executequeryforobject keyprop selectkeystatement getkeyproperty keyprop setobject keyprop generatedkey pushrequest generatedkey execute an update statement param session the session scope param id the statement id param param the parameter object return the number of rows updated throws sql exception if the update fails public int update session scope session string id object param throws sql exception int rows 0 mapped statement ms get mapped statement id transaction trans get transaction session boolean auto start trans null try trans auto start transaction session auto start trans request scope request pop request session ms try rows ms execute update request trans param finally push request request auto commit transaction session auto start finally auto end transaction session auto start return rows sqlexception sessionscope sqlexception mappedstatement getmappedstatement gettransaction autostart autostarttransaction autostart requestscope poprequest executeupdate pushrequest autocommittransaction autostart autoendtransaction autostart execute a delete statement param session the session scope param id the statement id param param the parameter object return the number of rows deleted throws sql exception if the delete fails public int delete session scope session string id object param throws sql exception return update session id param sqlexception sessionscope sqlexception execute a select for a single object param session the session scope param id the statement id param param object the parameter object return the result of the query throws sql exception if the query fails public object query for object session scope session string id object param object throws sql exception return query for object session id param object null paramobject sqlexception queryforobject sessionscope paramobject sqlexception queryforobject paramobject execute a select for a single object param session the session scope param id the statement id param param object the parameter object param result object the result object if not supplied or null a new object will be created return the result of the query throws sql exception if the query fails public object query for object session scope session string id object param object object result object throws sql exception object object null mapped statement ms get mapped statement id transaction trans get transaction session boolean auto start trans null try trans auto start transaction session auto start trans request scope request pop request session ms try object ms execute query for object request trans param object result object finally push request request auto commit transaction session auto start finally auto end transaction session auto start return object paramobject resultobject sqlexception queryforobject sessionscope paramobject resultobject sqlexception mappedstatement getmappedstatement gettransaction autostart autostarttransaction autostart requestscope poprequest executequeryforobject paramobject resultobject pushrequest autocommittransaction autostart autoendtransaction autostart execute a query for a list param session the session scope param id the statement id param param object the parameter object return the data list throws sql exception if the query fails public list query for list session scope session string id object param object throws sql exception return query for list session id param object sql executor no skipped results sql executor no maximum results paramobject sqlexception queryforlist sessionscope paramobject sqlexception queryforlist paramobject sqlexecutor no_skipped_results sqlexecutor no_maximum_results execute a query for a list param session the session scope param id the statement id param param object the parameter object param skip the number of rows to skip param max the maximum number of rows to return return the data list throws sql exception if the query fails public list query for list session scope session string id object param object int skip int max throws sql exception list list null mapped statement ms get mapped statement id transaction trans get transaction session boolean auto start trans null try trans auto start transaction session auto start trans request scope request pop request session ms try list ms execute query for list request trans param object skip max finally push request request auto commit transaction session auto start finally auto end transaction session auto start return list paramobject sqlexception queryforlist sessionscope paramobject sqlexception mappedstatement getmappedstatement gettransaction autostart autostarttransaction autostart requestscope poprequest executequeryforlist paramobject pushrequest autocommittransaction autostart autoendtransaction autostart execute a query with a row handler the row handler is called once per row in the query results param session the session scope param id the statement id param param object the parameter object param row handler the row handler throws sql exception if the query fails public void query with row handler session scope session string id object param object row handler row handler throws sql exception mapped statement ms get mapped statement id transaction trans get transaction session boolean auto start trans null try trans auto start transaction session auto start trans request scope request pop request session ms try ms execute query with row handler request trans param object row handler finally push request request auto commit transaction session auto start finally auto end transaction session auto start paramobject rowhandler sqlexception querywithrowhandler sessionscope paramobject rowhandler rowhandler sqlexception mappedstatement getmappedstatement gettransaction autostart autostarttransaction autostart requestscope poprequest executequerywithrowhandler paramobject rowhandler pushrequest autocommittransaction autostart autoendtransaction autostart execute a query and return a paginated list param session the session scope param id the statement id param param object the parameter object param page size the page size return the data list throws sql exception if the query fails deprecated all paginated list features have been deprecated public paginated list query for paginated list session scope session string id object param object int page size throws sql exception return new paginated data list session get sql map executor id param object page size paramobject pagesize sqlexception paginatedlist queryforpaginatedlist sessionscope paramobject pagesize sqlexception paginateddatalist getsqlmapexecutor paramobject pagesize execute a query for a map the map has the table key as the key and the results as the map data param session the session scope param id the statement id param param object the parameter object param key prop the key property from the results for the map return the map throws sql exception if the query fails public map query for map session scope session string id object param object string key prop throws sql exception return query for map session id param object key prop null paramobject keyprop sqlexception queryformap sessionscope paramobject keyprop sqlexception queryformap paramobject keyprop execute a query for a map the map has the table key as the key and a property from the results as the map data param session the session scope param id the statement id param param object the parameter object param key prop the property for the map key param value prop the property for the map data return the map throws sql exception if the query fails public map query for map session scope session string id object param object string key prop string value prop throws sql exception map map new hash map list list query for list session id param object for int i 0 n list size i n i object object list get i object key probe get object object key prop object value null if value prop null value object else value probe get object object value prop map put key value return map paramobject keyprop valueprop sqlexception queryformap sessionscope paramobject keyprop valueprop sqlexception hashmap queryforlist paramobject getobject keyprop valueprop getobject valueprop transaction control methods start a transaction on the session param session the session throws sql exception if the transaction could not be started public void start transaction session scope session throws sql exception try tx manager begin session catch transaction exception e throw new nestedsql exception could not start transaction cause e e sqlexception starttransaction sessionscope sqlexception txmanager transactionexception nestedsqlexception start a transaction on the session with the specified isolation level param session the session throws sql exception if the transaction could not be started public void start transaction session scope session int transaction isolation throws sql exception try tx manager begin session transaction isolation catch transaction exception e throw new nestedsql exception could not start transaction cause e e sqlexception starttransaction sessionscope transactionisolation sqlexception txmanager transactionisolation transactionexception nestedsqlexception commit the transaction on a session param session the session throws sql exception if the transaction could not be committed public void commit transaction session scope session throws sql exception try auto batch execution if session is in batch execute batch session sql executor cleanup session tx manager commit session catch transaction exception e throw new nestedsql exception could not commit transaction cause e e sqlexception committransaction sessionscope sqlexception isinbatch executebatch sqlexecutor txmanager transactionexception nestedsqlexception end the transaction on a session param session the session throws sql exception if the transaction could not be ended public void end transaction session scope session throws sql exception try try sql executor cleanup session finally tx manager end session catch transaction exception e throw new nestedsql exception error while ending transaction cause e e sqlexception endtransaction sessionscope sqlexception sqlexecutor txmanager transactionexception nestedsqlexception start a batch for a session param session the session public void start batch session scope session session set in batch true startbatch sessionscope setinbatch execute a batch for a session param session the session return the number of rows impacted by the batch throws sql exception if the batch fails public int execute batch session scope session throws sql exception session set in batch false return sql executor execute batch session sqlexception executebatch sessionscope sqlexception setinbatch sqlexecutor executebatch execute a batch for a session param session the session return a list of batch result objects may be null if no batch has been initiated there will be one batch result object in the list for each sub batch executed throws sql exception if a database access error occurs or the drive does not support batch statements throws batch exception if the driver throws batch update exception public list execute batch detailed session scope session throws sql exception batch exception session set in batch false return sql executor execute batch detailed session batchresult batchresult sqlexception batchexception batchupdateexception executebatchdetailed sessionscope sqlexception batchexception setinbatch sqlexecutor executebatchdetailed use a user provided transaction for a session param session the session scope param user connection the user supplied connection public void set user provided transaction session scope session connection user connection if session get transaction state transaction state state user provided session recall transaction state if user connection null connection conn user connection session save transaction state session set transaction new user provided transaction conn session set transaction state transaction state state user provided else session set transaction null session close prepared statements session reset used to be push session which is probably incorrect userconnection setuserprovidedtransaction sessionscope userconnection gettransactionstate transactionstate state_user_provided recalltransactionstate userconnection userconnection savetransactionstate settransaction userprovidedtransaction settransactionstate transactionstate state_user_provided settransaction closepreparedstatements pushsession get the data source for the session return the data source public data source get data source data source ds null if tx manager null ds tx manager get data source return ds datasource datasource datasource getdatasource datasource txmanager txmanager getdatasource getter for the sql executor return the sql executor public sql executor get sql executor return sql executor sqlexecutor sqlexecutor sqlexecutor getsqlexecutor sqlexecutor get a transaction for the session param session the session return the transaction public transaction get transaction session scope session return session get transaction gettransaction sessionscope gettransaction protected void auto end transaction session scope session boolean auto start throws sql exception if auto start session get sql map tx mgr end transaction autoendtransaction sessionscope autostart sqlexception autostart getsqlmaptxmgr endtransaction protected void auto commit transaction session scope session boolean auto start throws sql exception if auto start session get sql map tx mgr commit transaction autocommittransaction sessionscope autostart sqlexception autostart getsqlmaptxmgr committransaction protected transaction auto start transaction session scope session boolean auto start transaction trans throws sql exception transaction transaction trans if auto start session get sql map tx mgr start transaction transaction get transaction session return transaction autostarttransaction sessionscope autostart sqlexception autostart getsqlmaptxmgr starttransaction gettransaction public boolean equals object obj return this obj public int hash code cache key key new cache key if tx manager null key update tx manager if tx manager get data source null key update tx manager get data source key update system identity hash code this return key hash code hashcode cachekey cachekey txmanager txmanager txmanager getdatasource txmanager getdatasource identityhashcode hashcode protected request scope pop request session scope session mapped statement mapped statement request scope request request scope request pool pop session increment request stack depth request set session session mapped statement init request request return request requestscope poprequest sessionscope mappedstatement mappedstatement requestscope requestscope requestpool incrementrequeststackdepth setsession mappedstatement initrequest protected void push request request scope request request get session decrement request stack depth request reset request pool push request pushrequest requestscope getsession decrementrequeststackdepth requestpool protected session scope pop session return session scope session pool pop sessionscope popsession sessionscope sessionpool protected void push session session scope session session reset session pool push session pushsession sessionscope sessionpool public result object factory get result object factory return result object factory resultobjectfactory getresultobjectfactory resultobjectfactory public void set result object factory result object factory result object factory this result object factory result object factory setresultobjectfactory resultobjectfactory resultobjectfactory resultobjectfactory resultobjectfactory public boolean is statement cache enabled return statement cache enabled isstatementcacheenabled statementcacheenabled public void set statement cache enabled boolean statement cache enabled this statement cache enabled statement cache enabled setstatementcacheenabled statementcacheenabled statementcacheenabled statementcacheenabled getter for the resource causing the problem return the resource public string get resource return resource getresource setter for the resource causing the problem param resource the resource public void set resource string resource this resource resource setresource getter for the activity that was happening when the error happened return the activity public string get activity return activity getactivity getter for the activity that was happening when the error happened param activity the activity public void set activity string activity this activity activity setactivity getter for the object id where the problem happened return the object id public string get object id return object id getobjectid objectid setter for the object id where the problem happened param object id the object id public void set object id string object id this object id object id objectid setobjectid objectid objectid objectid getter for more information about the error return more information public string get more info return more info getmoreinfo moreinfo setter for more information about the error param more info more information public void set more info string more info this more info more info moreinfo setmoreinfo moreinfo moreinfo moreinfo getter for the cause of the error return the cause public throwable get cause return cause getcause setter for the cause of the error param cause the cause public void set cause throwable cause this cause cause setcause public string to string string buffer message new string buffer resource if resource null message append n the error occurred in message append resource message append activity if activity null message append n the error occurred while message append activity message append object if object id null message append n check the message append object id message append more info if more info null message append n message append more info cause if cause null message append n cause message append cause to string return message to string tostring stringbuffer stringbuffer objectid objectid moreinfo moreinfo tostring tostring clear the error context public void reset resource null activity null object id null more info null cause null objectid moreinfo sets a parameter on a prepared statement param ps the prepared statement param i the parameter index param parameter the parameter value param jdbc type the jdbc type of the parameter throws sql exception if setting the parameter fails public void set parameter prepared statement ps int i object parameter string jdbc type jdbctype sqlexception setparameter preparedstatement jdbctype gets a column from a result set param rs the result set param column name the column name to get return the column value throws sql exception if getting the value fails public object get result result set rs string column name columnname sqlexception getresult resultset columnname gets a column from a result set param rs the result set param column index the column to get by index return the column value throws sql exception if getting the value fails public object get result result set rs int column index columnindex sqlexception getresult resultset columnindex gets a column from a callable statement param cs the statement param column index the column to get by index return the column value throws sql exception if getting the value fails public object get result callable statement cs int column index columnindex sqlexception getresult callablestatement columnindex converts the string to the type that this handler deals with param s the string value return the converted value compares two values that this handler deals with for equality param object one of the objects param string the other object as a string return true if they are equal public interface transaction config public data source get data source transactionconfig datasource getdatasource public data source get data source public void set data source data source ds datasource getdatasource setdatasource datasource public void set data source data source ds public void initialize properties props throws sql exception transaction exception setdatasource datasource sqlexception transactionexception public void initialize properties props throws sql exception transaction exception public transaction new transaction int transaction isolation throws sql exception transaction exception sqlexception transactionexception newtransaction transactionisolation sqlexception transactionexception public transaction new transaction int transaction isolation throws sql exception transaction exception public int get maximum concurrent transactions newtransaction transactionisolation sqlexception transactionexception getmaximumconcurrenttransactions public int get maximum concurrent transactions public void set maximum concurrent transactions int maximum concurrent transactions getmaximumconcurrenttransactions setmaximumconcurrenttransactions maximumconcurrenttransactions public interface transaction public void commit throws sql exception transaction exception sqlexception transactionexception public void commit throws sql exception transaction exception public void rollback throws sql exception transaction exception sqlexception transactionexception sqlexception transactionexception public void rollback throws sql exception transaction exception public void close throws sql exception transaction exception sqlexception transactionexception sqlexception transactionexception public void close throws sql exception transaction exception public connection get connection throws sql exception transaction exception sqlexception transactionexception getconnection sqlexception transactionexception gets a named object out of the scope param key the name of the object to get return the object puts a named value into the scope param key the name of the object to put param value the value to associate with that name public void set attribute object key object value clears all data out of the scope public void reset setattribute public interface execute listener public void on execute statement mapped statement statement executelistener onexecutestatement mappedstatement public interface mapped statement public string get id mappedstatement getid public string get id public statement type get statement type getid statementtype getstatementtype public statement type get statement type public integer get result set type statementtype getstatementtype getresultsettype public integer get result set type public int execute update request scope request transaction trans object parameter object throws sql exception getresultsettype executeupdate requestscope parameterobject sqlexception throws sql exception public object execute query for object request scope request transaction trans object parameter object object result object throws sql exception sqlexception executequeryforobject requestscope parameterobject resultobject sqlexception throws sql exception public list execute query for list request scope request transaction trans object parameter object int skip results int max results throws sql exception sqlexception executequeryforlist requestscope parameterobject skipresults maxresults sqlexception throws sql exception public void execute query with row handler request scope request transaction trans object parameter object row handler row handler throws sql exception sqlexception executequerywithrowhandler requestscope parameterobject rowhandler rowhandler sqlexception throws sql exception public cache key get cache key request scope request object parameter object sqlexception cachekey getcachekey requestscope parameterobject public cache key get cache key request scope request object parameter object public parameter map get parameter map cachekey getcachekey requestscope parameterobject parametermap getparametermap public parameter map get parameter map public result map get result map parametermap getparametermap resultmap getresultmap public result map get result map public void set base cache key int base resultmap getresultmap setbasecachekey public void set base cache key int base public void add execute listener execute listener listener setbasecachekey addexecutelistener executelistener public void add execute listener execute listener listener public void notify listeners addexecutelistener executelistener notifylisteners public void notify listeners public void init request request scope request notifylisteners initrequest requestscope public void init request request scope request public sql get sql initrequest requestscope getsql public sql get sql public class get parameter class getsql getparameterclass public class get parameter class public integer get fetch size getparameterclass getfetchsize public integer get fetch size public integer get timeout getfetchsize gettimeout public integer get timeout public boolean has multiple result maps gettimeout hasmultipleresultmaps public boolean has multiple result maps public result map get additional result maps hasmultipleresultmaps resultmap getadditionalresultmaps public static final int repeat body 2 public int do start fragment sql tag context ctx sql tag tag object parameter object repeat_body dostartfragment sqltagcontext sqltag parameterobject public int do start fragment sql tag context ctx sql tag tag object parameter object public int do end fragment sql tag context ctx sql tag tag object parameter object string buffer body content dostartfragment sqltagcontext sqltag parameterobject doendfragment sqltagcontext sqltag parameterobject stringbuffer bodycontent public int do end fragment sql tag context ctx sql tag tag object parameter object string buffer body content public void do prepend sql tag context ctx sql tag tag object parameter object string buffer body content doendfragment sqltagcontext sqltag parameterobject stringbuffer bodycontent doprepend sqltagcontext sqltag parameterobject stringbuffer bodycontent public interface dynamic parent public void add child sql child child dynamicparent addchild sqlchild public interface sql public string get sql request scope request object parameter object getsql requestscope parameterobject public string get sql request scope request object parameter object public parameter map get parameter map request scope request object parameter object getsql requestscope parameterobject parametermap getparametermap requestscope parameterobject public parameter map get parameter map request scope request object parameter object public result map get result map request scope request object parameter object parametermap getparametermap requestscope parameterobject resultmap getresultmap requestscope parameterobject public result map get result map request scope request object parameter object public void cleanup request scope request resultmap getresultmap requestscope parameterobject requestscope returns a new instance of the requested class ibatis will call this method in these circumstances ul li when processing a result set to create new instances of result objects li li when processing the output parameters of a stored procedure to create instances of output parameters li li when processing a nested select to create instances of parameter objects on the nested select li li when processing result maps with nested result maps ibatis will ask the factory to create an instance of the nested object if the nested object is some implementation of code java util collection code then ibatis will supply default implementations of the common interfaces if the factory chooses not to create the object if the embedded object is a code java util list code or code java util collection code the default behavior is to create an code java util array list code if the embedded object is a code java util set code the default behavior is to create a code java util hash set code li ul if you return code null code from this method ibatis will attempt to create in instance of the class with it s normal mechanism this means that you can selectively choose which objects to create with this interface in the event that you choose not to create an object ibatis will translate some common interfaces to their common implementations if the requested class is list or collection ibatis will create an array list if the requested class is set then ibatis will create a hash set but these rules only apply if you choose not to create the object so you can use this factory to supply custom implementations of those interfaces if you so desire param statement id the id of the statement that generated the call to this method param clazz the type of object to create return a new instance of the specified class the instance must be castable to the specified class if you return code null code ibatis will attempt to create the instance using it s normal mechanism throws instantiation exception if the instance cannot be created if you throw this exception ibatis will throw a runtime exception in response and will end throws illegal access exception if the constructor cannot be accessed if you throw this exception ibatis will throw a runtime exception in response and will end arraylist hashset arraylist hashset statementid instantiationexception illegalaccessexception called for each property configured in the sql map cong file all the properties will be set before any call is made to create instance param name param value sqlmapcong createinstance a way to identify the result map return an id resultmap perform the mapping and return the results param request the request scope param rs the result set to map return an object array with the data in it throws sql exception if an exception is thrown processing the results public object get results request scope request result set rs sqlexception getresults requestscope resultset callback method for row handler param request the request scope param result object the object being populated param values the values from the database return the populated object rowhandler resultobject getter for the result mapping objects return an array of result mapping objects resultmapping resultmapping getter for the class that data wil be mapped into return the class gets a unique key based on the values provided param values result values representing a single row of results return the unique key public object get unique key object values public result map resolve sub map request scope request result set rs throws sql exception getuniquekey resultmap resolvesubmap requestscope resultset sqlexception public result map resolve sub map request scope request result set rs throws sql exception public discriminator get discriminator resultmap resolvesubmap requestscope resultset sqlexception getdiscriminator getter for the property this will do mapping for return the property name public interface parameter map public string get id parametermap getid public string get id public void set parameters request scope request prepared statement ps object parameters throws sql exception getid setparameters requestscope preparedstatement sqlexception throws sql exception public object get parameter object values request scope request object parameter object sqlexception getparameterobjectvalues requestscope parameterobject public object get parameter object values request scope request object parameter object public cache key get cache key request scope request object parameter object getparameterobjectvalues requestscope parameterobject cachekey getcachekey requestscope parameterobject public cache key get cache key request scope request object parameter object public void refresh parameter object values request scope request object parameter object object values cachekey getcachekey requestscope parameterobject refreshparameterobjectvalues requestscope parameterobject public void refresh parameter object values request scope request object parameter object object values public parameter mapping get parameter mappings refreshparameterobjectvalues requestscope parameterobject parametermapping getparametermappings public parameter mapping get parameter mappings public class get parameter class parametermapping getparametermappings getparameterclass public interface parameter mapping public string get property name parametermapping getpropertyname public string get property name public boolean is output allowed getpropertyname isoutputallowed get the sql delegate return the sql map executor delegate sqlmapexecutordelegate get a mapped statement by id param id the id return the mapped statement get the sql executor return the sql executor get the status of lazy loading return the status get the status of cg lib enhancements return the status cglib public boolean is enhancement enabled public result object factory get result object factory isenhancementenabled resultobjectfactory getresultobjectfactory initializes the data exchange instance param properties gets a data array from a parameter object param request the scope of the request param parameter map the parameter map param parameter object the parameter object return the objects parametermap parameterobject sets values from a data array into a result object param request the request scope param result map the result map param result object the result object param values the values to be mapped return the result object resultmap resultobject resultobject sets values from a data array into a parameter object param request the request scope param parameter map the parameter map param parameter object the parameter object param values the values to set return parameter object parametermap parameterobject parameterobject returns an object capable of being a unique cache key for a parameter object param request the request scope param parameter map the parameter map param parameter object the parameter object return a cache key parametermap parameterobject simple method to initialize configure a datasource param map the configuration information returns a datasource return an implementation of data source datasource flush a cache model param cache model the model to flush cachemodel get an object from a cache model param cache model the model param key the key to the object return the object if in the cache or null cachemodel remove an object from a cache model param cache model the model to remove the object from param key the key to the object return the removed object cachemodel put an object into a cache model param cache model the model to add the object to param key the key to the object param object the object to add cachemodel configure a cache controller param props the properties object continaing configuration information get a reader based on another reader param reader a reader for the file to convert return the converted file convert an xml file into another xml file param reader a reader for the xml to be converted from param writer a writer for the xml to be converted to get an input stream based on another input stream param input stream an input stream for the file to convert return the converted file inputstream inputstream inputstream inputstream sets all of the properties of a bean param object the bean param values the property values gets all of the properties of a bean param object the bean return the properties performs processing on a value before it is used to set the parameter of a prepared statement param setter the interface for setting the value on the prepared statement param parameter the value to be set throws sql exception if any error occurs public void set parameter parameter setter setter object parameter preparedstatement preparedstatement sqlexception setparameter parametersetter performs processing on a value before after it has been retrieved from a result set param getter the interface for getting the value from the result set return the processed value throws sql exception if any error occurs public object get result result getter getter resultset resultset sqlexception getresult resultgetter casts the string representation of a value into a type recognized by this type handler this method is used to translate null value values into types that can be appropriately compared if your custom type handler cannot support null values or if there is no reasonable string representation for this type e g file type you can simply return the string representation as it was passed in it is not recommended to return null unless null was passed in param s a string representation of a valid value for this type return one of the following ol li the casted repersentation of the string value li li the string as is li li null only if null was passed in li ol nullvalue nullvalues set an array on the underlying prepared statement param x the array to set throws sql exception thrown if the underlying prepared statement throws it sqlexception set an input stream on the underlying prepared statement param x the input stream param length the length of the input stream throws sql exception thrown if the underlying prepared statement throws it inputstream inputstream inputstream sqlexception set an on the underlying prepared statement param x throws sql exception thrown if the underlying prepared statement throws it sqlexception set an input stream on the underlying prepared statement param x the input stream param length the length of the input stream throws sql exception thrown if the underlying prepared statement throws it inputstream inputstream inputstream sqlexception set a blob on the underlying prepared statement param x the blob throws sql exception thrown if the underlying prepared statement throws it sqlexception set a boolean on the underlying prepared statement param x the boolean throws sql exception thrown if the underlying prepared statement throws it sqlexception set a byte on the underlying prepared statement param x the byte throws sql exception thrown if the underlying prepared statement throws it sqlexception set a byte array on the underlying prepared statement param x the byte throws sql exception thrown if the underlying prepared statement throws it sqlexception set a character stream on the underlying prepared statement param reader the reader param length the length of the reader throws sql exception thrown if the underlying prepared statement throws it sqlexception set a clob on the underlying prepared statement param x the clob throws sql exception thrown if the underlying prepared statement throws it sqlexception set a date on the underlying prepared statement param x the date throws sql exception thrown if the underlying prepared statement throws it sqlexception set a date with a calendar on the underlying prepared statement param x the date param cal the calendar throws sql exception thrown if the underlying prepared statement throws it sqlexception set a double on the underlying prepared statement param x the double throws sql exception thrown if the underlying prepared statement throws it sqlexception set a float on the underlying prepared statement param x the float throws sql exception thrown if the underlying prepared statement throws it sqlexception set an integer on the underlying prepared statement param x the int throws sql exception thrown if the underlying prepared statement throws it sqlexception set a long on the underlying prepared statement param x the long throws sql exception thrown if the underlying prepared statement throws it sqlexception set a null on the underlying prepared statement param sql type the type for the null value throws sql exception thrown if the underlying prepared statement throws it sqltype sqlexception set a null on the underlying prepared statement param sql type the type for the null value param type name the name of the type throws sql exception thrown if the underlying prepared statement throws it sqltype typename sqlexception set an object on the underlying prepared statement param x the object to set throws sql exception thrown if the underlying prepared statement throws it sqlexception set an object on the underlying prepared statement param x the object to set param target sql type the sql type of the object throws sql exception thrown if the underlying prepared statement throws it targetsqltype sqlexception set an object on the underlying prepared statement param x the object to set param target sql type the sql type of the object param scale the scale of the object throws sql exception thrown if the underlying prepared statement throws it targetsqltype sqlexception set a reference on the underlying prepared statement param x the reference to set throws sql exception thrown if the underlying prepared statement throws it sqlexception set a short on the underlying prepared statement param x the short to set throws sql exception thrown if the underlying prepared statement throws it sqlexception set a string on the underlying prepared statement param x the string to set throws sql exception thrown if the underlying prepared statement throws it sqlexception set a time on the underlying prepared statement param x the time to set throws sql exception thrown if the underlying prepared statement throws it sqlexception set a time with a calendar on the underlying prepared statement param x the time to set param cal the calendar to use throws sql exception thrown if the underlying prepared statement throws it sqlexception set a timestamp on the underlying prepared statement param x the timestamp to set throws sql exception thrown if the underlying prepared statement throws it sqlexception set a timestamp on the underlying prepared statement param x the timestamp to set param cal the calendar to use throws sql exception thrown if the underlying prepared statement throws it sqlexception set a url on the underlying prepared statement param x the url to set throws sql exception thrown if the underlying prepared statement throws it sqlexception public void seturl url x throws sql exception returns the underlying prepared statement be careful public prepared statement get prepared statement sqlexception preparedstatement getpreparedstatement returns the index of the parameter being set return the parameter index used to set the value in the underlying prepared statement preparedstatement gets an array from the underlying result set return the array throws sql exception if the underlying result set throws an exception sqlexception gets a big decimal from the underlying result set return the big decimal throws sql exception if the underlying result set throws an exception bigdecimal bigdecimal sqlexception gets a blob from the underlying result set return the blob throws sql exception if the underlying result set throws an exception sqlexception gets a boolean from the underlying result set return the boolean throws sql exception if the underlying result set throws an exception sqlexception gets a byte from the underlying result set return the byte throws sql exception if the underlying result set throws an exception sqlexception gets a byte from the underlying result set return the byte throws sql exception if the underlying result set throws an exception sqlexception gets a clob from the underlying result set return the clob throws sql exception if the underlying result set throws an exception sqlexception gets a date from the underlying result set return the date throws sql exception if the underlying result set throws an exception sqlexception gets a date from the underlying result set using a calendar param cal the calendar return the date throws sql exception if the underlying result set throws an exception sqlexception gets a double from the underlying result set return the double throws sql exception if the underlying result set throws an exception sqlexception gets a float from the underlying result set return the float throws sql exception if the underlying result set throws an exception sqlexception gets an int from the underlying result set return the int throws sql exception if the underlying result set throws an exception sqlexception gets a long from the underlying result set return the long throws sql exception if the underlying result set throws an exception sqlexception gets an object from the underlying result set return the object throws sql exception if the underlying result set throws an exception sqlexception gets an object from the underlying result set using a map param map the map return the object throws sql exception if the underlying result set throws an exception sqlexception gets a ref from the underlying result set return the ref throws sql exception if the underlying result set throws an exception sqlexception gets a short from the underlying result set return the short throws sql exception if the underlying result set throws an exception sqlexception gets a string from the underlying result set return the string throws sql exception if the underlying result set throws an exception sqlexception gets a time from the underlying result set return the time throws sql exception if the underlying result set throws an exception sqlexception gets a time from the underlying result set using a calendar param cal the calendar return the time throws sql exception if the underlying result set throws an exception sqlexception gets a timestamp from the underlying result set return the timestamp throws sql exception if the underlying result set throws an exception sqlexception gets a timestamp from the underlying result set param cal the calendar return the timestamp throws sql exception if the underlying result set throws an exception sqlexception gets a url from the underlying result set return the url throws sql exception if the underlying result set throws an exception sqlexception tells if the field was null return true if it was null throws sql exception if the underlying result set throws an exception sqlexception returns the underlying result set be careful return a result set instance resultset resultset returns the name of the column being got in the underlying result set may be code null code in which case the code get column index code method should be used return the column name may be null resultset getcolumnindex returns the index of the column being got in the underlying result set only use this method if the value returned from code get column name code is null return the index of the column if zero then use the column name resultset getcolumnname handles a single row of a result set p this method will be called for each row in a result set for each row the result map will be applied to build the value object which is then passed in as the value object parameter param value object the object representing a single row from the query see com ibatis sqlmap client sql map session valueobject valueobject sqlmapsession demarcates the beginning of a transaction scope transactions must be properly committed or rolled back to be effective use the following pattern when working with transactions pre try sql map start transaction do work sql map commit transaction finally sql map end transaction pre p always call end transaction once start transaction has been called throws java sql sql exception if an error occurs while starting the transaction or the transaction could not be started sqlmap starttransaction sqlmap committransaction sqlmap endtransaction endtransaction starttransaction sqlexception demarcates the beginning of a transaction scope using the specified transaction isolation transactions must be properly committed or rolled back to be effective use the following pattern when working with transactions pre try sql map start transaction connection transaction repeatable read do work sql map commit transaction finally sql map end transaction pre p always call end transaction once start transaction has been called throws java sql sql exception if an error occurs while starting the transaction or the transaction could not be started sqlmap starttransaction transaction_repeatable_read sqlmap committransaction sqlmap endtransaction endtransaction starttransaction sqlexception commits the currently started transaction throws sql exception if an error occurs while committing the transaction or the transaction could not be committed sqlexception ends a transaction and rolls back if necessary if the transaction has been started but not committed it will be rolled back upon calling end transaction throws sql exception if an error occurs during rollback or the transaction could not be ended endtransaction sqlexception allows the developer to easily use an externally supplied connection when executing statements p b important b using a user supplied connection basically sidesteps the transaction manager so you are responsible for appropriately here s a very simple example throws sql exception pre try connection connection data source get connection sql map set user connection connection do work connection commit catch sql exception e try if connection null commit rollback catch sql exception ignored generally ignored throw e rethrow the exception finally try if connection null connection close catch sql exception ignored generally ignored pre param connnection throws sql exception sqlexception datasource getconnection sqlmap setuserconnection sqlexception sqlexception sqlexception sqlexception returns the current user supplied connection as set by set user connection p todo deprecated return the current user supplied connection throws sql exception deprecated use get current connection instead setuserconnection sqlexception getcurrentconnection returns the current connection in use if no connection exists null will be returned there may be no connection if no transaction has been started and if no user provided connection has been set return the current connection or null throws sql exception sqlexception returns the data source instance currently being used by the sql map session return the data source instance currently being used by the sql map session datasource sqlmapsession datasource sqlmapsession returns a single threaded sql map session implementation for use by one user remember though that sql map client itself is a thread safe sql map session implementation so you can also just work directly with it if you do get a session explicitly using this method b be sure to close it b you can close a session using the sql map session close method p return an sql map session instance sqlmapsession sqlmapclient sqlmapsession sqlmapsession sqlmapsession returns a single threaded sql map session implementation for use by one user remember though that sql map client itself is a thread safe sql map session implementation so you can also just work directly with it if you do get a session explicitly using this method b be sure to close it b you can close a session using the sql map session close method p this particular implementation takes a user provided connection as a parameter this connection will be used for executing statements and therefore overrides any configured datasources using this approach allows the developer to easily use an externally supplied connection for executing statements p b important b using a user supplied connection basically sidesteps the datasource so you are responsible for appropriately handling your connection lifecycle i e closing here s a very simple example throws sql exception pre try connection connection data source get connection sql map session session sql map open session connection do work connection commit catch sql exception e try if connection null commit rollback catch sql exception ignored generally ignored throw e rethrow the exception finally try if connection null connection close catch sql exception ignored generally ignored pre param conn the connection to use for the session return an sql map session instance sqlmapsession sqlmapclient sqlmapsession sqlmapsession sqlexception datasource getconnection sqlmapsession sqlmap opensession sqlexception sqlexception sqlexception sqlmapsession todo deprecated and will be removed return a session deprecated deprecated use open session instead this method will be removed before final release opensession public sql map session get session flushes all data caches public void flush data cache sqlmapsession getsession flushdatacache flushes the data cache that matches the cache model id provided cache id should include the namespace even when use statement namespaces false param cache id the cache model to flush cacheid usestatementnamespaces cacheid executes a mapped sql insert statement insert is a bit different from other update methods as it provides facilities for returning the primary key of the newly inserted row rather than the effected rows this functionality is of course optional p the parameter object is generally used to supply the input data for the insert values param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc return the primary key of the newly inserted row this might be automatically generated by the rdbms or selected from a sequence table or other source throws java sql sql exception if an error occurs parameterobject javabean sqlexception executes a mapped sql insert statement insert is a bit different from other update methods as it provides facilities for returning the primary key of the newly inserted row rather than the effected rows this functionality is of course optional p this overload assumes no parameter is needed param id the name of the statement to execute return the primary key of the newly inserted row this might be automatically generated by the rdbms or selected from a sequence table or other source throws java sql sql exception if an error occurs sqlexception executes a mapped sql update statement update can also be used for any other update statement type such as inserts and deletes update returns the number of rows effected p the parameter object is generally used to supply the input data for the update values as well as the where clause parameter s param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc return the number of rows effected throws java sql sql exception if an error occurs parameterobject javabean sqlexception executes a mapped sql update statement update can also be used for any other update statement type such as inserts and deletes update returns the number of rows effected p this overload assumes no parameter is needed param id the name of the statement to execute return the number of rows effected throws java sql sql exception if an error occurs sqlexception executes a mapped sql delete statement delete returns the number of rows effected p the parameter object is generally used to supply the input data for the where clause parameter s of the delete statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc return the number of rows effected throws java sql sql exception if an error occurs parameterobject javabean sqlexception executes a mapped sql delete statement delete returns the number of rows effected p this overload assumes no parameter is needed param id the name of the statement to execute return the number of rows effected throws java sql sql exception if an error occurs sqlexception executes a mapped sql select statement that returns data to populate a single object instance p the parameter object is generally used to supply the input data for the where clause parameter s of the select statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc return the single result object populated with the result set data or null if no result was found throws java sql sql exception if more than one result was found or if any other error occurs parameterobject javabean sqlexception executes a mapped sql select statement that returns data to populate a single object instance p this overload assumes no parameter is needed param id the name of the statement to execute return the single result object populated with the result set data or null if no result was found throws java sql sql exception if more than one result was found or if any other error occurs sqlexception executes a mapped sql select statement that returns data to populate the supplied result object p the parameter object is generally used to supply the input data for the where clause parameter s of the select statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc param result object the result object instance that should be populated with result data return the single result object as supplied by the result object parameter populated with the result set data or null if no result was found throws java sql sql exception if more than one result was found or if any other error occurs parameterobject javabean resultobject resultobject sqlexception executes a mapped sql select statement that returns data to populate a number of result objects p the parameter object is generally used to supply the input data for the where clause parameter s of the select statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc return a list of result objects throws java sql sql exception if an error occurs parameterobject javabean sqlexception executes a mapped sql select statement that returns data to populate a number of result objects p this overload assumes no parameter is needed param id the name of the statement to execute return a list of result objects throws java sql sql exception if an error occurs sqlexception executes a mapped sql select statement that returns data to populate a number of result objects within a certain range p the parameter object is generally used to supply the input data for the where clause parameter s of the select statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc param skip the number of results to ignore param max the maximum number of results to return return a list of result objects throws java sql sql exception if an error occurs parameterobject javabean sqlexception executes a mapped sql select statement that returns data to populate a number of result objects within a certain range p this overload assumes no parameter is needed param id the name of the statement to execute param skip the number of results to ignore param max the maximum number of results to return return a list of result objects throws java sql sql exception if an error occurs sqlexception executes a mapped sql select statement that returns a number of result objects that will be handled one at a time by a row handler p this is generally a good approach to take when dealing with large sets of records i e hundreds thousands that need to be processed without eating up all of the system resources p the parameter object is generally used to supply the input data for the where clause parameter s of the select statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc param row handler a row handler instance throws java sql sql exception if an error occurs rowhandler parameterobject javabean rowhandler rowhandler sqlexception executes a mapped sql select statement that returns a number of result objects that will be handled one at a time by a row handler p this is generally a good approach to take when dealing with large sets of records i e hundreds thousands that need to be processed without eating up all of the system resources p this overload assumes no parameter is needed param id the name of the statement to execute param row handler a row handler instance throws java sql sql exception if an error occurs rowhandler rowhandler rowhandler sqlexception executes a mapped sql select statement that returns data to populate a number of result objects a page at a time p the parameter object is generally used to supply the input data for the where clause parameter s of the select statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc param page size the maximum number of result objects each page can hold return a paginated list of result objects throws java sql sql exception if an error occurs deprecated all paginated list features have been deprecated parameterobject javabean pagesize paginatedlist sqlexception executes a mapped sql select statement that returns data to populate a number of result objects a page at a time p this overload assumes no parameter is needed param id the name of the statement to execute param page size the maximum number of result objects each page can hold return a paginated list of result objects throws java sql sql exception if an error occurs deprecated all paginated list features have been deprecated pagesize paginatedlist sqlexception executes a mapped sql select statement that returns data to populate a number of result objects that will be keyed into a map p the parameter object is generally used to supply the input data for the where clause parameter s of the select statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc param key prop the property to be used as the key in the map return a map keyed by key prop with values being the result object instance throws java sql sql exception if an error occurs parameterobject javabean keyprop keyprop sqlexception executes a mapped sql select statement that returns data to populate a number of result objects from which one property will be keyed into a map p the parameter object is generally used to supply the input data for the where clause parameter s of the select statement param id the name of the statement to execute param parameter object the parameter object e g java bean map xml etc param key prop the property to be used as the key in the map param value prop the property to be used as the value in the map return a map keyed by key prop with values of value prop throws java sql sql exception if an error occurs parameterobject javabean keyprop valueprop keyprop valueprop sqlexception starts a batch in which update statements will be cached before being sent to the database all at once this can improve overall performance of updates update when dealing with numerous updates e g inserting 1 m related data throws java sql sql exception if the batch could not be started sqlexception executes flushes all statements currently batched return the number of rows updated in the batch throws java sql sql exception if the batch could not be executed or if any of the statements fails sqlexception executes flushes all statements currently batched return a list of batch result objects there will be one element in the list for each sub batch executed a sub batch is created by adding a statement to the batch that does not equal the prior statement throws sql exception if a database access error occurs or the drive does not support batch statements throws batch exception if the driver throws batch update exception see com ibatis sqlmap engine execution batch exception batchresult sqlexception batchexception batchupdateexception batchexception public interface sql map session extends sql map executor sql map transaction manager closes the session public void close sqlmapsession sqlmapexecutor sqlmaptransactionmanager for a registered x path the nodelet parser will call the nodelet s process method for processing param node the node represents any xml node that can be registered under an x path supported by the nodelet parser possible nodes are ul li text use node get node value for the text value li attribute use node get node value for the attribute value li element this is the most flexible type you can get the node content and iterate over the node s child nodes if neccessary this is useful where a single x path registration cannot describe the complex structure for a given xml stanza ul xpath nodeletparser xpath nodeletparser getnodevalue getnodevalue xpath returns the maximum number of items per page return the maximum number of items per page is the current page the first page return true if the current page is the first page or if only a single page exists is the current page a middle page ie not first or last return true if the current page is not the first or last page and more than one page exists always returns false if only a single page exists is the current page the last page return true if the current page is the last page or if only a single page exists is a page available after the current page return true if the next page is available is a page available before the current page return true if the previous page is available moves to the next page after the current page if the current page is the last page wrap to the first page return true if the page changed moves to the page before the current page if the current page is the first page wrap to the last page return true if the page changed moves to a specified page if the specified page is beyond the last page wrap to the first page if the specified page is before the first page wrap to the last page param page number the page to go to pagenumber returns the current page index which is a zero based integer all paginated list implementations should know what index they are on even if they don t know the ultimate boundaries min max return the current page public interface log boolean is debug enabled isdebugenabled boolean is debug enabled void error string s throwable e isdebugenabled void error string s throwable e void error string s void error string s public void debug string s public void debug string s public void warn string s gets an object property from another object param object the object param name the property name return the property value as an object sets the value of a property on an object param object the object to change param name the name of the property to set param value the new value to set returns the class that the setter expects when setting a property param object the object to check param name the name of the property return the type of the property returns the class that the getter will return when reading a property param object the object to check param name the name of the property return the type of the property checks to see if an object has a writable property by a given name param object the object to check param property name the property to check for return true if the property exists and is writable propertyname checks to see if an object has a readable property by a given name param object the object to check param property name the property to check for return true if the property exists and is readable propertyname