## please note than in a strict MVC design pattern, modifications should NOT be triggered from inside templates
## but rather by an assermented controller object !!!
The Bookstore Sample
#if($query.author_id)
#set($success = $db.author.update($query))
#else
## automatic id generation is not standardized among DBMS
## here since it's a demo we'll use random numbers
## and obfuscate it, since it will be deobfuscated...
#set($query.author_id = $db.obfuscate($random.nextInt()))
#set($success = $db.author.insert($query))
#end
#if($success)
Operation successfull.
#else
Error encountered : $db.error
#end
[home]