All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.velocity.casban.perschema.jsoncodec.vm Maven / Gradle / Ivy

The newest version!
#parse( "schema.include.vm" )
#parse( "header.include.vm" )
#set ( $javaClassName = 'JsonCodec' )

$codewriter.setCurrentJavaFilename($pkg, "${javaClassName}.java")
package $pkg;
#####################
#if($codewriter.fastjsonClassDeserializer)
import gu.sql2java.json.FastjsonDeserializer;
#end
#if($codewriter.jacksonClassDeserializer)
import gu.sql2java.json.JacksonDeserializer;
#end
/**
 * JSON deserializer declaration 
 * @author guyadong
 */
public class $javaClassName {

#foreach($table in $tables)
#set ( $beanClass = ${table.asBeanClassNSP()} )
#if($codewriter.fastjsonClassDeserializer)
    public static class ${beanClass}FastjsonDeserializer extends FastjsonDeserializer{
        public ${beanClass}FastjsonDeserializer() {
            super(Constant.$table.asConstantVar()_CLASS);
        }
    }
#end
#if($codewriter.jacksonClassDeserializer)
    public static class ${beanClass}JacksonDeserializer extends JacksonDeserializer{
        private static final long serialVersionUID = ${table.getSerialVersionUID("${pkg}.${javaClassName}.${beanClass}JacksonDeserializer")}L;
        public ${beanClass}JacksonDeserializer() {
            super(Constant.$table.asConstantVar()_CLASS);
        }
    }
#end
#end
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy