## ============================================================================ ## Filename : FWAuditTrailDataObjectTemplate.vm ## Note(s) : This template is used to generate the base class for all ## data object classes. ## ## Note: The generated code is dependent on the ThinkUI framework. ## Please refer to the SQL Client documentation for details. ## ## Copyright (c) 2007 ThinkUI Software Inc. All rights reserved. ## ============================================================================ ## ## **************************************************************************** ## The following variables are available in this template. For more ## information on any of the following variable, please refer to the user guide. ## **************************************************************************** ## $projectName ## $authorName ## $headerText ## $className ## $packageName ## $prjPkgName ## $prjClassPrefix ## $superClassName ## $date ## $codeGen ## #if ($packageName) package $packageName; #end #parse( "ClassHeaderInclude.vm" ) import thinkui.common.User; import thinkui.db.AbstractDataObject; /** * Extends AbstractDataObject to implement the base class for all data objects * with audit trail columns. */ public abstract class ${className} extends AbstractDataObject { // Attribute names common to all ${className} classes. public static final String CREATE_DATETIME = AuditTrailDataClass.CREATE_DATETIME; public static final String CREATE_USER = AuditTrailDataClass.CREATE_USER; public static final String UPDATE_DATETIME = AuditTrailDataClass.UPDATE_DATETIME; public static final String UPDATE_USER = AuditTrailDataClass.UPDATE_USER; /** * ${className} constructor. */ public ${className}() { super(); } /** * @return the Create User of the data object. */ public final String getCreateUser() { return getString(CREATE_USER); } /** * Sets the Create User of the data object. */ public final void setCreateUser(String createUser) { setValue(CREATE_USER, createUser); } /** * @return the Update User of the data object. */ public final String getUpdateUser() { return getString(UPDATE_USER); } /** * Sets the Update User of the data object. */ public final void setUpdateUser(String updateUser) { setValue(UPDATE_USER, updateUser); } /** * Copies the user name from the specified user to the audit columns, */ public final void setUser(User user) { if (user != null) { String userName = user.getUserName(); if (isNew()) { setCreateUser(userName); } setUpdateUser(userName); } } }