blob: 54b98b64426f7d4166e55a5b627ac53cff856dbe [file] [log] [blame]
##included template. Generates the @Column annotation.
##Assumes that the context has a "column" and a "table" object
##generate annotation only the parameters for the column NOT default
##and the generateDLLAnnotation property is not set on the table
###------------------------------------------------
#macro( append $members $parameters )
#if( $members == "")
#set( $members = $parameters )
#else
#set( $members = "$members, $parameters" )
#end
#end
###------------------------------------------------
#if ( $column.dataTypeLOB)
@Lob()
#end
#if ( $column.needMapTemporalType)
@Temporal( TemporalType.$column.temporalType)
#end
#set ($members = "")
#if ( !$column.default || $customizer.generateDDLAnnotations )
#if ( !${column.defaultname} )
#append($members "name=$customizer.quote($column.name)" )
#end
#if (!$column.insertable)
#append(${members} "insertable=false")
#end
#if (!$column.updateable)
#append(${members} "updatable=false")
#end
#end
#if( $customizer.generateDDLAnnotations )
#if ($column.unique)
#append($members "unique=true")
#end
#if (!$column.nullable)
#append($members "nullable=false")
#end
#if ($column.size > 0)
#if ($column.numeric)
#append($members "precision=$column.size")
#if ($column.decimalDigits != 0 && $column.decimalDigits != -1)
#append($members "scale=$column.decimalDigits")
#end
#else
#if ( !$column.dataTypeLOB)
#append($members "length=$column.size")
#end
#end
#end
#end
#if( $members !="" )
@Column($members)
#end