Hi,
I`m using the Hibernate Tools Version 3.1 beta4 and I`m trying to create my own custom template to insert an "I" for all non-primitive and non-collection types in the mutators of my pojo. So I need to check if a property in the velocity template is a primitive or a collection are the methods available to do this????
I can`t find a Java Doc for any of the classes used in the templates after searching the Tools docs and the website.
Thanks
Darran
Example of what I`m trying to do :-
Code:
// Property accessors
#foreach($property in $pojo.getAllPropertiesIterator())
#if($pojo.getMetaAttribAsBool($property, "gen-property", true))
#if($pojo.hasFieldJavaDoc($property))
/**
* $pojo.getFieldJavaDoc($property, 4)
*/
#end
#if($property.<[b]isPrimary????[/b]>)
$templates.Ejb3PropertyGetAnnotation
$pojo.getPropertyGetModifiers($property) $pojo.getJavaTypeName($property, $jdk5) $pojo.getGetterSignature($property)() {
return this.$property.name;
}
$pojo.getPropertySetModifiers($property) void set$pojo.getPropertyName($property)($pojo.getJavaTypeName($property, $jdk5) $property.Name) {
this.$property.Name = $property.Name;
}
#else
$templates.Ejb3PropertyGetAnnotation
$pojo.getPropertyGetModifiers($property) I$pojo.getJavaTypeName($property, $jdk5) $pojo.getGetterSignature($property)() {
return this.$property.name;
}
$pojo.getPropertySetModifiers($property) void set$pojo.getPropertyName($property)(I$pojo.getJavaTypeName($property, $jdk5) $property.Name) {
this.$property.Name = $property.Name;
}
#end
#end