##included template. Generates the @Basic, @Id, @Version annotations. ##Assumes that the context has a "column" object ## #set ($mappingKind = $column.mappingKind) #if ($mappingKind == "id") @Id #set ($idGenerator = $table.idGenerator) #if ($idGenerator == "auto") #set ($generationType = "GenerationType.AUTO") #elseif ($idGenerator == "identity") #set ($generationType = "GenerationType.IDENTITY") #elseif ($idGenerator == "sequence") #set ($generationType = "GenerationType.SEQUENCE") #elseif ($idGenerator == "table") #set ($generationType = "GenerationType.TABLE") #else #set ($generationType = "") #end #if ($idGenerator == "sequence" ) #set ($generatorName = "${table.name.toUpperCase()}_${column.propertyName.toUpperCase()}_GENERATOR") #if( $table.formattedSequence != "" ) @SequenceGenerator(name="$generatorName", sequenceName="$table.formattedSequence") #else @SequenceGenerator(name="$generatorName" ) #end @GeneratedValue(strategy=$generationType, generator="$generatorName") #elseif ($generationType != "") @GeneratedValue(strategy=$generationType) #end #elseif ($mappingKind == "version") @Version() #else ##DEFAULT is @Basic(), no need to generate #end