## this template's parameters likes bellow
##
##set( $aspect_targetTable = $table )
##set( $aspect_pointcut = "peer.before.save" )
##set( $aspect_localObjName = "obj" )
##
#macro( insertAspects $tbl $localObjName)
	#foreach( $aspect in $tbl.getAspects() )
		#if( $aspect.getWhere() == $aspect_pointcut )
			#foreach( $action in $aspect.getActions() )
				#if( $tbl.getColumn( $action.getColumnName() ) )
					#set( $col = $tbl.getColumn( $action.getColumnName() ) )	
					#set ( $colJavaType = $col.getJavaType() )
					#set ( $methodType = $stringUtils.capitalize( $colJavaType ) )
					#if( $action.getType() == "bean" ) 
			${localObjName}.set${col.getJavaName()}( PropertyUtils.getPropertyAs${methodType}( this, "${action.getValue()}" ) );
					#else 
			${localObjName}.set${col.getJavaName()}( $action.getValue() );
					#end
				#end
			#end
		#end	
	#end
#end
#insertAspects( $aspect_targetTable $aspect_localObjName )
#macro( insertJoinAspect $joins $parentLocalName)
	#foreach( $join in $joins )
		#if( $join.getType() == "oneToOne" )
			#set( $joinTable = $join.getTargetTable() )
			#set( $newObjName = "${parentLocalName}_${stringUtils.uncapitalize( $joinTable.getJavaName() )}" )
			${joinTable.getJavaName()} $newObjName = ${parentLocalName}.get${join.getBeanNameCapitalized()}();
			#insertAspects( $joinTable $newObjName )
			#insertJoinAspect( $join.getChildren() $newObjName )
		#end
	#end
#end
#insertJoinAspect( $aspect_targetTable.getJoins() $aspect_localObjName )