[opf] Changed mapping check criteria from pid to classtype
[opf] Moving sql stuff to sqlmapping; converting execute<sql> to generate<sql>statement