Dashboard > WOProject / WOLips > ... > EOGenerator Templates and Additions > Veogen Tips and Tricks
  WOProject / WOLips Log In View a printable version of the current page.  
  Veogen Tips and Tricks
Added by chuckhill, last edited by chuckhill on Mar 03, 2008
Labels: 
(None)

Accessing Values

Simple expressions like ${relationship.actualDestination.classNameWithDefault} work as long as the methods use the is... or get... prefix from JavaBeans. For other methods, use () to indicate that it is a regular method name: ${attribute.name.toUpperCase()}.

Number vs Integer or Long

If you prefer your classes to be generated with Number instead of Integer or Long, add this macro to the start of your template:

#macro( genericClass $specificClass )
#if($specificClass == "Integer" || $specificClass == "Long")Number#else$specificClass#end
#end

And use it like this:

public #genericClass($attribute.javaClassName) ${attribute.name}() {
    return (#genericClass($attribute.javaClassName)) storedValueForKey("$attribute.name");
}

public void set${attribute.capitalizedName}(#genericClass($attribute.javaClassName) value) 
{
    takeStoredValueForKey(value, "$attribute.name");
}

Site running on a free Atlassian Confluence Open Source Project License granted to ObjectStyle. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators